Overview
Agents hit an 85–90% reliability ceiling without self-correction. The ReflectionManager adds a critique loop that catches errors, detects stuck loops, and records post-mortem lessons for continuous improvement.Quick Start
Configuration
Features
Output Critique
After the LLM generates a response, the reflection manager evaluates it on:- Correctness — factual accuracy, no hallucinations
- Completeness — addresses all parts of the query
- Relevance — stays on topic
- Clarity — well-structured output
maxReflections times).
Loop Escape Detection
Detects when agents get stuck calling the same tool with the same arguments repeatedly:Post-Mortem Learning
When a run fails and memory is available, the reflection manager generates a lesson and stores it inLearnedKnowledge:
Plan Critique
Before executing tool calls, review the planned actions:Using a Cheaper Critic
Save costs by using a smaller model for critique:Events
| Event | Payload |
|---|---|
reflection.critique | { runId, pass, score, feedback } |
reflection.loop.escaped | { runId, tool, repeatCount } |
reflection.postmortem | { runId, lesson, category } |