Recursive Context
Recursive Context, previously documented as RELP, lets your LLM work with documentation larger than its context window by decomposing queries and orchestrating multiple focused retrievals.
Reduced Hallucination
Recursive Context grounds responses in your actual documentation, providing source-attributed answers that reduce unsupported claims.
The Problem
Modern LLMs have context windows ranging from 8K to 200K tokens. But real-world documentation often exceeds these limits:
- A typical codebase: 500K+ tokens of docs, comments, and READMEs
- Enterprise documentation: Often 1M+ tokens across wikis and specs
- API references: Can easily reach 200K+ tokens
Without Recursive Context, you either truncate your docs (losing context) or pay to send everything (expensive and slow). Both approaches lead to incomplete answers and unsupported claims.
How Recursive Context Works
Recursive Context solves this by breaking complex queries into focused sub-queries, each retrieving precisely relevant context within your token budget.
The Three Recursive Context Tools
snipara_decompose
Breaks a complex query into focused sub-queries with dependency analysis. Returns an execution plan optimized for your token budget.
snipara_decompose({ query: "implement auth system", max_depth: 2, hints: ["JWT", "existing validation patterns"]})snipara_multi_query
Executes multiple queries in a single call with shared token budget. Efficiently retrieves context for all sub-queries.
snipara_multi_query({ queries: [ { query: "login flow", max_tokens: 3000 }, { query: "JWT tokens", max_tokens: 3000 } ], max_tokens: 8000})snipara_plan
Generates a complete execution plan for complex tasks. Includes dependency ordering, estimated tokens, and execution strategy.
snipara_plan({ query: "refactor auth to use OAuth2", strategy: "relevance_first", max_tokens: 16000})Plan Availability
| Tool | Free | Solo ($9/mo) | Pro ($49/mo) | Team ($149/mo) | Enterprise |
|---|---|---|---|---|---|
snipara_context_query | ✓ | ✓ | ✓ | ✓ | ✓ |
snipara_decompose | ✗ | ✓ | ✓ | ✓ | ✓ |
snipara_multi_query | ✗ | ✓ | ✓ | ✓ | ✓ |
snipara_plan | ✗ | ✓ | ✓ | ✓ | ✓ |
Token Budget Management
Recursive Context distributes the requested token budget across sub-queries. The table below is illustrative guidance, not a latency or token-consumption benchmark:
Reducing Hallucination
Recursive Context reduces unsupported claims through several mechanisms:
- Grounded retrieval: Returned context and answer packs identify the indexed sources used for synthesis
- Focused context: Each sub-query gets precisely relevant sections, reducing ambiguity
- Source attribution: Responses include file paths and line numbers for verification
- Shared context: Linked team standards can be retrieved when shared context is enabled and relevant to the task
Example: Complex Task Execution
# Your LLM receives this complex request"Implement user authentication with JWT tokens, following our existing patterns and error handling" Step 1: LLM calls snipara_decomposesnipara_decompose({ query: "implement auth with JWT", max_depth: 2 }) Step 2: LLM calls snipara_multi_query for each sub-querysnipara_multi_query({ queries: [{ query: "login flow" }, { query: "JWT tokens" }, { query: "sessions" }], max_tokens: 12000 }) Step 3: LLM calls snipara_shared_context for team standardssnipara_shared_context({ categories: ["MANDATORY", "BEST_PRACTICES"], max_tokens: 4000 }) Result: Accurate, grounded implementationExpected Query Usage
Different task complexities consume different numbers of queries:
| Task Complexity | Example | Queries Used |
|---|---|---|
| Simple | "What is the API endpoint for users?" | 1-2 |
| Medium | "How does authentication work?" | 3-5 |
| Complex | "Implement a new feature following our patterns" | 8-15 |
| Planning | "Refactor the entire auth system" | 15-25 |
Next Steps
MCP Tools Reference
Complete documentation for all Snipara MCP tools including Recursive Context tools.
Integration Guide
Set up Snipara with Claude Code, Cursor, Continue, and other MCP clients.
Getting Started
New to Snipara? Start here for a 5-minute setup guide.
Try Recursive Context
Free plans include the primary context query. Solo and higher plans add the recursive tools within plan capacity; the actual callable surface still depends on the active caller and Hosted MCP/Companion exposure. Use snipara_help to verify it.