
Semantic Frame
io.github.Anarkitty1由 GitHub 帳號 Anarkitty1 發布v0.2.1更新於 Nov 3, 2026
Token-efficient semantic compression for numerical data. 95%+ token reduction.
概覽
把數值資料序列壓縮成簡短的自然語言摘要,讓助理不必取得原始資料就能掌握趨勢、波動與異常。
- 可以做什麼
- 分析單一數值序列,回傳包含趨勢、波動、異常、季節性、分布、階躍變化與資料品質的簡短敘述
- 一次呼叫分析多條序列或 DataFrame 的所有數值欄位
- 以結構化 JSON 而非文字形式回傳結果,方便後續處理
- 執行交易類分析:回撤、績效指標、排名、多時間窗、市場狀態與配置建議
- 適用情境
- 適合助理需要解讀大量數值資料(例如監控指標、感測器讀值、銷售數據或價格序列),同時希望控制上下文長度並避免算術猜測的情境。也適用於需要以文字形式取得確定性統計摘要的代理流程。
- 執行需求
- 以本機 Python 套件形式執行,透過 pip 或 uv 安裝,MCP 伺服器需安裝 mcp 附加元件。未宣告需要帳號、API 金鑰或環境變數。README 提供以 uvx 或 mcp run 啟動的方式。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Semantic Frame,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Semantic Frame
[MCP Registry] [PyPI version] [License: MIT]
Token-efficient semantic compression for numerical data.
Semantic Frame converts raw numerical data (NumPy, Pandas, Polars) into natural language descriptions optimized for LLM consumption. Instead of sending thousands of data points to an AI agent, send a 50-word semantic summary.
The Problem
LLMs are terrible at arithmetic. When you send raw data like [100, 102, 99, 101, 500, 100, 98] to GPT-4 or Claude:
- Token waste: 1000 data points = ~2000 tokens
- Hallucination risk: LLMs guess trends instead of calculating them
- Context overflow: Large datasets fill the context window
The Solution
Semantic Frame provides deterministic analysis using NumPy, then translates results into token-efficient narratives:
Output:
Result: 95%+ token reduction, zero hallucination risk.
Installation
Or with uv:
🤖 Claude Integration (MCP)
Semantic Frame is available on the official MCP Registry, enabling direct integration with Claude.
Claude Code CLI:
Claude Desktop - Add to your claude_desktop_config.json:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Once configured, Claude can use these tools:
describe_data- Analyze a single data seriesdescribe_batch- Analyze multiple series at oncedescribe_json- Get structured JSON output
Quick Start
Analyze a Series
Analyze a DataFrame
Get Structured Output
JSON Output for APIs
Supported Data Types
- NumPy:
np.ndarray - Pandas:
pd.Series,pd.DataFrame - Polars:
pl.Series,pl.DataFrame - Python:
list
Analysis Features
LLM Integration
System Prompt Injection
LangChain Tool Output
Multi-Column Agent Context
Framework Integrations
Anthropic Claude (Native Tool Use)
LangChain
CrewAI
MCP (Model Context Protocol)
Run the MCP server:
Exposes describe_data tool for MCP clients like:
- ElizaOS: TypeScript-based agent framework
- Claude Desktop: Anthropic's desktop app
- Claude Code: Anthropic's CLI for Claude
- Any MCP-compatible client
Claude Code
Add Semantic Frame as a native tool in Claude Code:
Once configured, ask Claude to analyze data and it will use the describe_data tool automatically.
Advanced Tool Use (Beta)
Semantic Frame supports Anthropic's Advanced Tool Use features for efficient tool orchestration in complex agent workflows.
Features
Quick Start (Advanced)
Configuration Options
MCP Batch Analysis
See docs/advanced-tool-use.md for complete documentation.
Use Cases
Crypto Trading
DevOps Monitoring
Sales Analytics
IoT Sensor Data
📈 Trading Module (v0.4.0)
Specialized semantic analysis for trading agents, portfolio managers, and financial applications.
Trading Tools
Quick Examples
MCP Integration
All trading tools are available via MCP:
Tools: describe_drawdown, describe_trading_performance, describe_rankings, describe_anomalies, describe_windows, describe_regime, describe_allocation
📖 Full Trading Documentation | Quick Reference
API Reference
describe_series(data, context=None, output="text")
Analyze a single data series.
Parameters:
data: Input data (NumPy array, Pandas Series, Polars Series, or list)context: Optional label for the data (appears in narrative)output: Format -"text"(string),"json"(dict), or"full"(SemanticResult)
Returns: Semantic description in requested format.
describe_dataframe(df, context=None)
Analyze all numeric columns in a DataFrame.
Parameters:
df: Pandas or Polars DataFramecontext: Optional prefix for column context labels
Returns: Dict mapping column names to SemanticResult objects.
SemanticResult
Full analysis result with:
narrative: Human-readable text descriptiontrend: TrendState enumvolatility: VolatilityState enumdata_quality: DataQuality enumanomaly_state: AnomalyState enumanomalies: List of AnomalyInfo objectsseasonality: Optional SeasonalityStatedistribution: Optional DistributionShapestep_change: Optional StructuralChange (STEP_UP, STEP_DOWN, NONE)step_change_index: Optional int (index where step change occurred)profile: SeriesProfile with statisticscompression_ratio: Token reduction ratio
Development
License
MIT License - see LICENSE file.
來源:README.md,提交 4dfd560
工具
0版本歷史
1- v0.2.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分