Skip to main content

Context-guru

Context-guru is a Rossoctl Cortex plugin that compacts an agent's growing tool-output context before it reaches the LLM, so a task whose raw context exceeds the model's window still fits — and the agent gets the right answer because of the compaction.

Same agent, same model, same window. The only variable is context-guru:

modecontext-gururequest the model seesagent answer
offdisabled (kill-switch)raw ~18K toktruncated to the 12K window❌ misses the anomaly, hallucinates a wrong refund
observeshadow (measures, doesn't apply)raw ~18K tok (truncated); logs it would save 52KB→30KB❌ same wrong answer — proves the measurement is free
enforceappliedcompacted ~10K tokfits✅ finds the TX4827 duplicate, clears the others

Architecture

context-guru is an in-process AuthBridge plugin (not a sidecar service). The agent's outbound LLM calls are routed through AuthBridge's forward proxy (HTTP_PROXY=:8081); the plugin runs in the outbound pipeline and rewrites the request body before it leaves the pod.

context-guru architecture: the finance-agent routes outbound LLM calls through AuthBridge's forward proxy, whose OUTBOUND pipeline runs inference-parser then the context-guru plugin to compact tool context before the request reaches Ollama

The pipeline is inference-parser → context-guru. context-guru is the single outbound WritesBody plugin (mutually exclusive with sparc).

See the Cortex repo for details and architecture.