MCP Catalogs
Home

Matryoshka

by yogthos·134·Score 48

MCP server for analyzing documents larger than context windows using recursive language models and symbolic commands.

ai-llmdeveloper-toolsfile-system
16
Forks
0
Open issues
this month
Last commit
2d ago
Indexed

Overview

Matryoshka is an innovative MCP server that enables analysis of documents up to 100x larger than a language model's context window. Instead of traditional RAG or chunking approaches, it uses a Recursive Language Model (RLM) approach where the LLM outputs symbolic commands in a specialized Nucleus DSL that are executed by a logic engine. This architecture reduces token usage by 97%+ and maintains document-wide context without vector databases. The server provides two MCP interfaces: one with full LLM orchestration and another exposing direct Nucleus commands for programmatic access.

Try asking AI

After installing, here are 5 things you can ask your AI assistant:

you:Analyzing large log files or error reports beyond context limits
you:Processing and querying multi-document collections without chunking
you:Building memory-aware agents that reference large context efficiently
you:How does Matryoshka handle documents larger than context window?
you:What is the Nucleus DSL?

When to choose this

Choose Matryoshka when you need to analyze very large documents that exceed your LLM's context window, especially when traditional chunking or vector database approaches lose important connections across document sections.

When NOT to choose this

Don't choose Matryoshka if you need fine-grained control over individual document chunks or require advanced metadata preservation that goes beyond its symbolic language capabilities.

Tools this server exposes

9 tools extracted from the README
  • lattice_load

    Load a document for analysis

  • lattice_query

    Execute Nucleus commands on the loaded document

  • lattice_expand

    Expand a handle to see full data with optional limit/offset

  • lattice_memo

    Store arbitrary context as a memo handle

  • lattice_memo_delete

    Delete a stale memo to free memory

  • lattice_close

    Close the session and free memory

  • lattice_status

    Get session status, document info, and memo usage

  • lattice_bindings

    Show current variable bindings and memo labels

  • lattice_reset

    Reset all bindings and clear the current document

Comparable tools

vectorstore-mcpdoc-search-mcpfile-system

Installation

Install from npm:

pnpm add -g matryoshka-rlm

Or run without installing:

npx matryoshka-rlm "How many ERROR entries are there?" ./server.log

For Claude Desktop integration, create claude_desktop_config.json with:

{
  "mcpServers": {
    "matryoshka": {
      "command": "npx",
      "args": ["matryoshka-rlm", "mcp"]
    }
  }
}

FAQ

How does Matryoshka handle documents larger than context window?
It uses a recursive language model approach where the LLM outputs symbolic commands that are executed by a logic engine against the full document, eliminating the need for chunking.
What is the Nucleus DSL?
Nucleus is a constrained symbolic language based on S-expressions designed specifically for document analysis. It provides commands like grep, filter, and sum that the LLM can output to manipulate document data.

Compare Matryoshka with

GitHub →

Last updated · Auto-generated from public README + GitHub signals.