Recursive Companion offers a unique three-phase architecture for LLM agents, empowering them to critique and enhance their outputs. This transparency features a complete audit trail of decisions, making reasoning inspectable and fostering improved performance. Embrace clear and systematic self-improvement for LLMs with this innovative framework.
Recursive Companion is an innovative meta-framework designed for developing self-improving agents capable of transparent reasoning. It operates on a robust three-phase iterative refinement architecture, where Large Language Model (LLM) agents not only generate outputs but also critique and enhance their own responses. This contrasts sharply with traditional systems that only provide single-pass outputs. Each instance of an agent fully tracks its revision history, enabling transparency and debug-ability in decision-making.

See the detailed Architecture Documentation for an in-depth look at its system design.
Transparent Reasoning: Recursive Companion stands out by allowing users to understand the rationale behind decisions. Every agent maintains a detailed audit trail of critique-revision cycles, providing insight into the reasoning process.
Iterative Self-Improvement: Unlike systems offering isolated responses, RC agents continuously refine their outputs through systematic self-critiquing, enabling deeper thought processes.
Flexible Template Loading: Abilities to construct nuanced analytical patterns through the build_templates() utility. Users can manage and modify templates at various levels:
| Code Pattern | Importance | Rarity in OSS |
|---|---|---|
| Automatic Self-Improvement | Enables efficient multi-level refinement without manual setup | ✓✓ |
| Global Protocol Adjustment | Modify reasoning style universally with a single update | ✓ |
| Text-based Templates | Facilitates version control and hot reloading without restarts | ✓ |
| Simple Agent Inheritance | Quickly create new domain-specific companions with minimal coding | ✓✓ |
| Integrated Run Log Tracking | Historical analysis of decisions made throughout iterations | ✓✓ |
Recursive Companion allows for varied levels of engagement based on user familiarity and needs:
from recursive_companion import MarketingCompanion
# Instantiate an agent
agent = MarketingCompanion("gpt-4o-mini")
# Generate a refined output through critique cycles
answer = agent("Why did engagement drop 30% ... ?")
print(answer)
# Examine iteration details
print(f"Iterations: {len(agent.run_log)}")
# Configure agents for diverse use scenarios
custom_agent = MarketingCompanion(temperature=0.9, max_loops=5)
# Generate and view a detailed evolution of the response
answer, history = custom_agent.loop("Analyze Q3 performance trends...")
print(custom_agent.transcript_as_markdown())
The structure encourages clarity and separation of concerns among various roles:
core/chains.py—manages the engine and iteration process.recursive_companion/base.py—defines user interactions with agents.Recursive Companion emphasizes observability and flexibility, offering:
Recursive Companion opens pathways for advanced research into agent collaboration and enhanced problem-solving models. The framework inherently supports integrations and further explorations into recursive methodologies across various disciplines.
Through a structured design that reflects the nature of collaborative human-AI efforts, Recursive Companion marks a notable advancement in creating interconnected, intelligent, and adaptable software agents.
No comments yet.
Sign in to be the first to comment.