Matryoshka
by yogthos·★ 134·综合分 48
通过递归语言模型和符号命令分析超出上下文窗口大小的文档的 MCP 服务器。
概述
Matryoshka 是一个创新的 MCP 服务器,能够分析比语言模型上下文窗口大 100 倍的文档。它采用递归语言模型方法,让 LLM 输出专门的 Nucleus DSL 符号命令,由逻辑引擎执行。这种架构减少 97%+ 的令牌使用,无需向量数据库即可保持文档级上下文。服务器提供两个 MCP 接口:一个具有完整 LLM 编排功能,另一个暴露直接 Nucleus 命令以实现程序化访问。
试试问 AI
装完之后,这里有 5 个你可以让 AI 做的事:
什么时候选它
当你需要分析超过 LLM 上下文窗口的超大型文档时,选择 Matryoshka,特别是当传统的分块或向量数据库方法会丢失文档各部分之间的重要连接时。
什么时候不要选它
如果你需要细粒度控制单个文档块或需要超出其符号语言能力的高级元数据保留,不要选择 Matryoshka。
此 server 暴露的工具
从 README 抽取出 9 个工具lattice_loadLoad a document for analysis
lattice_queryExecute Nucleus commands on the loaded document
lattice_expandExpand a handle to see full data with optional limit/offset
lattice_memoStore arbitrary context as a memo handle
lattice_memo_deleteDelete a stale memo to free memory
lattice_closeClose the session and free memory
lattice_statusGet session status, document info, and memo usage
lattice_bindingsShow current variable bindings and memo labels
lattice_resetReset all bindings and clear the current document
可对比工具
安装
通过 npm 安装:
pnpm add -g matryoshka-rlm或直接运行(无需安装):
npx matryoshka-rlm "有多少错误条目?" ./server.log对于 Claude Desktop 集成,创建 claude_desktop_config.json 文件:
{
"mcpServers": {
"matryoshka": {
"command": "npx",
"args": ["matryoshka-rlm", "mcp"]
}
}
}FAQ
- Matryoshka 如何处理超出上下文窗口的文档?
- 它采用递归语言模型方法,LLM 输出由逻辑引擎针对完整文档执行的符号命令,无需分块。
- 什么是 Nucleus DSL?
- Nucleus 是基于 S 表达式的受限符号语言,专为文档分析设计。它提供 grep、filter、sum 等命令,供 LLM 输出来操作文档数据。
Matryoshka 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。