Context Enrichment
Context enrichment automatically searches across your Knowledge Base, code index, and past session events to inject relevant information into every prompt, giving the AI agent deeper project awareness without manual intervention.
How It Works
When enabled, Pando enriches each user message before sending it to the LLM:
- Query Planning - A planner (heuristic or LLM-based) analyzes the user message
- Parallel Search - Searches KB, code index, and events simultaneously
- Score Filtering - Results below the minimum score threshold are discarded
- Context Injection - Relevant results are prepended to the user message
Configuration
[Remembrances]
ContextEnrichmentEnabled = true
# KB enrichment
ContextEnrichmentKBResults = 2
ContextEnrichmentKBMaxChars = 0
# Code enrichment
ContextEnrichmentCodeResults = 5
ContextEnrichmentCodeProject = 'pando'
ContextEnrichmentCodeMaxChars = 0
# Events enrichment
ContextEnrichmentEventsResults = 5
ContextEnrichmentEventsMaxChars = 0
# Global settings
ContextEnrichmentMinScore = 0.0
ContextEnrichmentTotalMaxChars = 0
# Planner selection
ContextEnrichmentUseAgentPlanner = false
ContextEnrichmentPlannerFallbackToCoder = falsePlanners
Heuristic Planner (Default)
Analyzes the user message using keyword extraction and pattern matching to determine which search sources to query. Fast and deterministic.
LLM-Based Planner
Uses a cheap LLM call to analyze the message and select optimal search strategies. More accurate but adds latency and token cost.
ContextEnrichmentUseAgentPlanner = trueContext Profile
The context-aware trimmer classifies each user message to optimize prompt composition:
{
"task_type": "code|debug|refactor|explain|test|search|general",
"relevant_tool_names": ["tool1", "tool2"],
"skip_sections": ["capabilities/web_search"],
"confidence": 0.85
}This allows Pando to skip irrelevant prompt sections, saving tokens and improving response quality.
ContextEnrichmentEnabled = true and configure result counts based on your project size.