When sending memories to an LLM, you often face a token budget. Mneno’s Context Builder helps you select the most relevant memories that fit within a specified budget, while explaining why each was included or excluded.Documentation Index
Fetch the complete documentation index at: https://mneno.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Building Context
Use thebuild_context() method to generate a ContextPackage.
Presets
Mneno comes with several built-in presets for common use cases:cheap: Smallest useful context, optimized for cost. (max 400 tokens)balanced: Default tradeoff between quality and cost. (max 1200 tokens)high_recall: Includes more context to avoid missing useful memories. (max 2500 tokens)agent_state: Prioritizes operational state, goals, constraints, and preferences.
Custom Policies
For full control, you can define aContextPolicy.
Policy Parameters
| Parameter | Default | Description |
|---|---|---|
max_tokens | 1200 | Total token budget for the context. |
reserve_tokens | 200 | Tokens to reserve (subtracted from max_tokens). |
min_score | 0.15 | Minimum score required for inclusion. |
strategy | "score" | How to sort candidates (score, recency, or importance). |
max_items | None | Hard limit on the number of memories included. |
dedupe | True | Whether to remove memories with duplicate content. |
Explainable Context
TheContextPackage contains detailed lists of included and excluded items, each with a reason.