16 Cognitive Architectures Demonstrated in the Agent Reasoning Demo
The Oracle AI Developer Hub implements 16 distinct cognitive architectures that transform standard LLMs into specialized problem-solving agents, ranging from Chain-of-Thought reasoning to Monte-Carlo Tree Search.
The oracle-devrel/oracle-ai-developer-hub repository provides a comprehensive agent reasoning framework that demonstrates how structured cognitive architectures can enhance large language model capabilities. These architectures are showcased in the agent_reasoning_demo.ipynb notebook and documented in the README's 🧠 Architectures in Detail table, offering side-by-side comparison of reasoning strategies from simple token generation to sophisticated multi-step planning.
Complete List of Cognitive Architectures
The demo implements the following 16 architectures, each defining a unique "thinking" strategy for solving complex tasks:
1. Chain-of-Thought (CoT)
Chain-of-Thought prompting injects step-by-step reasoning instructions that force the model to enumerate its logic before generating a final answer. According to the repository documentation, this architecture excels at mathematical problems, logical puzzles, and explanations requiring transparent reasoning traces, based on research by Wei et al. (2022).
2. Self-Reflection
The Self-Reflection architecture generates an initial draft, critiques its own output, and iteratively refines the response until meeting quality thresholds. This approach is optimal for creative writing and high-accuracy content generation (Shinn et al., 2023).
3. ReAct
ReAct interleaves reasoning and action steps, allowing the model to decide when to invoke external tools like web search or calculators, then incorporates those observations back into its reasoning loop. This architecture handles fact-checking, calculations, and data-driven answers effectively (Yao et al., 2022).
4. Tree of Thoughts (ToT)
Tree of Thoughts explores multiple reasoning branches simultaneously using breadth-first or depth-first search, scoring each path and pruning weak candidates. This method solves complex riddles and strategic planning challenges that require exploring alternative solution paths (Yao et al., 2023).
5. Decomposed
The Decomposed architecture breaks complex queries into ordered sub-tasks, solves each independently, then aggregates results into a coherent final answer. This approach excels at long-form planning and multi-step problem solving (Khot et al., 2022).
6. Recursive (RLM)
Recursive architecture executes a Python REPL inside the reasoning loop, allowing the model to define variables, execute code, and maintain state across recursive calls. This enables long-context processing and sophisticated code generation capabilities.
7. Refinement Loop
The Refinement Loop runs a generator-critic-refiner cycle, using learned scoring metrics to determine when iterative improvement should stop. This architecture polishes technical writing and documentation through systematic quality gates.
8. Complex Refinement
Extending the basic refinement cycle, Complex Refinement implements five distinct stages: accuracy verification, clarity enhancement, depth addition, example generation, and final polish. This produces production-grade articles and tutorials.
9. Adversarial Debate
Adversarial Debate deploys two agent instances arguing opposing viewpoints on a topic, with a judge agent selecting the more convincing argument. This architecture generates balanced perspectives on controversial subjects.
10. Monte-Carlo Tree Search (MCTS)
MCTS applies UCB1-based simulation to explore decision trees, balancing exploration of new branches against exploitation of promising paths. This approach optimizes game-style planning and strategic decision-making.
11. Analogical
The Analogical architecture identifies structural similarities in existing knowledge bases and applies these patterns to novel problems. This enables cross-domain reasoning and innovative problem solving in unfamiliar contexts.
12. Socratic
Socratic reasoning guides users (or the model itself) through progressive questioning to deepen understanding incrementally. This method facilitates philosophical inquiry and educational dialogues.
13. Meta-Reasoning
Meta-Reasoning automatically classifies incoming queries and routes them to the most suitable specialized architecture. This acts as an auto-selector that adapts the reasoning strategy to match problem requirements.
14. Self-Consistency
Self-Consistency samples multiple Chain-of-Thought answers to the same question, then selects the majority vote as the final response. This technique improves robustness in scenarios where stochastic outputs vary significantly.
15. Least-to-Most
The Least-to-Most architecture begins with the easiest sub-question and progressively builds toward harder components, feeding intermediate results forward. This hierarchical decomposition handles complex multi-layered problems.
16. Standard (Direct Generation)
Standard mode provides no scaffolding, allowing the model to answer directly as a baseline for comparison. This architecture serves quick one-shot queries where minimal latency is prioritized over reasoning depth.
Implementing Cognitive Architectures in Python
You can invoke any of these architectures through the ReasoningInterceptor class, which automatically dispatches to the appropriate agent based on model name suffixes. The interceptor is defined in apps/agent-reasoning/src/agent_reasoning/interceptor.py.
from agent_reasoning import ReasoningInterceptor
# Initialize the interceptor
client = ReasoningInterceptor()
# Chain-of-Thought example
cot_response = client.generate(
model="gemma3:270m+cot",
prompt="Explain the steps to solve a quadratic equation."
)
# ReAct with tool use
react_response = client.generate(
model="gemma3:270m+react",
prompt="What's the current CEO of Google? Then compute 12 × 7."
)
# Refinement Loop for content polishing
refine_response = client.generate(
model="gemma3:270m+refine",
prompt="Write a concise, accurate summary of the latest GPT-4 paper."
)
Each response reflects the specific cognitive architecture's reasoning pattern—CoT returns step-by-step explanations, ReAct includes tool observation traces, and Refinement Loop delivers iteratively improved content.
Key Source Files and Architecture
The cognitive architectures reside in specific locations within the repository:
apps/agent-reasoning/README.md- Central documentation listing all 16 architectures with research lineages and use-case recommendationsapps/agent-reasoning/src/agent_reasoning/agents/- Python package containing concrete implementations (e.g.,cot.py,react.py,tot.py)apps/agent-reasoning/src/agent_reasoning/interceptor.py- The dispatch layer that parses+strategysuffixes and routes to appropriate agentsapps/agent-reasoning/notebooks/agent_reasoning_demo.ipynb- Interactive notebook running all architectures simultaneously for side-by-side comparisonapps/agent-reasoning/tui/- Go-based terminal UI providing Arena Mode for visualizing reasoning traces and comparing latency metrics
The Agent Guide sidebar in the demo UI lists all 16 agents, while Arena Mode executes them simultaneously to compare token usage, latency, and answer quality across different cognitive strategies.
Summary
- The Oracle AI Developer Hub implements 16 distinct cognitive architectures ranging from simple direct generation to sophisticated search algorithms.
- Architectures are invoked via the
ReasoningInterceptorclass using+strategysuffixes on model names. - Key implementations reside in
apps/agent-reasoning/src/agent_reasoning/agents/with specific modules for Chain-of-Thought, ReAct, Tree of Thoughts, and others. - The
agent_reasoning_demo.ipynbnotebook provides interactive comparison of all reasoning strategies. - Selection criteria depend on task requirements: use Chain-of-Thought for transparent reasoning, ReAct for tool integration, Tree of Thoughts for strategic planning, and Meta-Reasoning for automatic architecture selection.
Frequently Asked Questions
How do I select the right cognitive architecture for my use case?
Choose Chain-of-Thought for mathematical and logical tasks requiring explanation transparency. Select ReAct when your task requires real-time data or calculations via external tools. Deploy Tree of Thoughts or MCTS for complex strategic planning with multiple solution paths. Use Meta-Reasoning to automatically route queries to the optimal architecture without manual selection.
What is the difference between the Refinement Loop and Complex Refinement architectures?
The Refinement Loop implements a basic generator-critic-refiner cycle with learned stopping criteria, suitable for general content improvement. Complex Refinement extends this into five explicit stages—accuracy, clarity, depth, examples, and polish—specifically designed for production-grade technical documentation and tutorials requiring systematic quality assurance.
Can I run multiple cognitive architectures simultaneously for comparison?
Yes. The repository includes an Arena Mode in the terminal UI (apps/agent-reasoning/tui/) and the agent_reasoning_demo.ipynb notebook that executes all 16 architectures on identical queries simultaneously. This allows direct comparison of reasoning traces, token consumption, latency metrics, and output quality across different cognitive strategies.
Where are the cognitive architecture implementations located in the source code?
Concrete agent implementations are located in apps/agent-reasoning/src/agent_reasoning/agents/ with individual Python files for each strategy (e.g., cot.py, react.py, tot.py). The ReasoningInterceptor class in interceptor.py handles dispatch and routing, while the README (apps/agent-reasoning/README.md) provides detailed documentation of each architecture's research origins and optimal use cases.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →