Overview
Context pollution is the #1 production failure mode. Old/failed messages accumulate, causing agents to drift toward “plausible-but-wrong” outputs. The ContextCurator automatically cleans conversation context before each LLM call.Quick Start
Failed Result Handling
Tool calls fail. Those error messages stay in context and confuse the model. The curator handles them:What counts as a “failed result”?
The curator detects errors by pattern matching:[ERROR]markersError:prefixes- HTTP 4xx/5xx status codes
timeout,ECONNREFUSED,Permission denied- Stack traces
Relevance Decay
Messages far back in the conversation become less relevant. The curator assigns a weight based on turn distance:Parameters
Clean-Room Mode
Instead of filtering the full conversation, build a purpose-specific context:- System prompt
- Memory context
- Messages containing entities from the current query
- Last N recent messages