Cognitive Architectures for Agent Reasoning in Oracle AI Developer Hub: CoT, ToT, and ReAct Explained

The Oracle AI Developer Hub supports four cognitive architectures for agent reasoning—Chain-of-Thought (CoT), Tree-of-Thoughts (ToT), ReAct, and a baseline Standard mode—each implemented as a dedicated Agent class and selectable at runtime via strategy keys.

The oracle-devrel/oracle-ai-developer-hub repository provides a flexible agent-reasoning framework that bundles these architectures into a unified API. Developers can instantiate these agents directly through Python classes or invoke them remotely via the agent registry and ensemble orchestrator. Each architecture emits distinct event streams and is optimized for different problem types, from linear step-by-step logic to branching strategic exploration.

Supported Cognitive Architectures

The framework implements each cognitive architecture as a concrete Agent subclass registered in the server’s agent registry. You select an architecture by passing its strategy key—cot, tot, react, or standard—to the orchestrator or instantiating the class directly.

Chain-of-Thought (CoT)

CoT (CoTAgent) generates a single linear reasoning trace, emitting a chain_step event for every "Step N" in the thought process. According to the source code in apps/agent-reasoning/src/agent_reasoning/agents/cot.py, this architecture breaks complex problems into explicit intermediate steps before reaching a final conclusion.

Use CoT for mathematical proofs, logic puzzles, and scenarios requiring transparent, step-by-step explanations where a single reasoning path suffices.

Tree-of-Thoughts (ToT)

ToT (ToTAgent) explores a breadth-first tree of candidate reasoning paths, scoring each node and pruning low-scoring branches to conserve compute. The implementation in apps/agent-reasoning/src/agent_reasoning/agents/tot.py handles tree generation, node evaluation, and automatic pruning based on configurable thresholds.

Deploy ToT for complex puzzles, strategic planning, and optimization problems where exploring multiple solution paths simultaneously improves answer quality.

ReAct

ReAct (ReActAgent) interleaves reasoning with tool calls—such as web search or calculator operations—following a thought → action → observation cycle. As implemented in apps/agent-reasoning/src/agent_reasoning/agents/react.py, this architecture emits react_step events that capture the agent’s internal monologue alongside external tool interactions.

ReAct excels at fact-checking, real-time data queries, and tasks requiring external knowledge or calculations that the base model cannot perform internally.

Standard Baseline

The Standard strategy (BaseAgent) provides plain LLM generation without reasoning scaffolding, serving as a baseline for comparison or for quick answers when reasoning overhead is unnecessary. This class lives in apps/agent-reasoning/src/agent_reasoning/agents/base.py and is registered under the "standard" strategy key.

Direct Instantiation of Agent Classes

You can instantiate any cognitive architecture directly by importing its class from the agents module. This bypasses the server registry and is useful for local testing or embedded pipelines.

from agent_reasoning.agents.cot import CoTAgent
from agent_reasoning.agents.tot import ToTAgent
from agent_reasoning.agents.react import ReActAgent

# CoT – linear step-by-step reasoning

cot = CoTAgent()
cot_response = cot.run("What is the sum of the first 10 prime numbers?")

# ToT – tree exploration (depth=3, width=2 by default)

tot = ToTAgent()
tot_response = tot.run("Find a strategy to reduce waste in a manufacturing plant.")

# ReAct – reasoning + tool usage

react = ReActAgent()
react_response = react.run("What is the current stock price of Tesla?")

Runtime Selection via the Agent Registry and Orchestrator

For production deployments, use the agent registry exposed through apps/agent-reasoning/src/agent_reasoning/server.py or the ensemble orchestrator in apps/agentic_rag/src/reasoning/rag_ensemble.py. These components load the appropriate Agent class based on the strategies parameter.

Using Strategy Cards

Retrieve declarative metadata for each architecture using the reasoning card helper:

from agentic_rag.src.reasoning_agent_cards import get_strategy_agent_card

cot_card = get_strategy_agent_card("cot")
print(cot_card["description"])

# → "Step‑by‑step reasoning using Chain‑of‑Thought prompting (Wei et al. 2022)"

HTTP API Invocation

Select a cognitive architecture via the orchestrator endpoint by specifying the strategy key in your payload:

import requests, json

url = "http://localhost:8000/reasoning.execute"

payload = {
    "query": "Explain why the sky is blue.",
    "strategies": ["cot"],          # Choose: standard, cot, tot, react

    "use_rag": False,
    "collection": "General"
}

resp = requests.post(url, json=payload)
print(json.loads(resp.text)["winner"]["response"])

The reasoning_ensemble_v1 orchestrator supports parallel execution by passing multiple strategies (e.g., ["cot", "react"]), automatically aggregating results and voting on the best answer.

Summary

  • The Oracle AI Developer Hub implements four cognitive architectures: Chain-of-Thought (CoT), Tree-of-Thoughts (ToT), ReAct, and Standard baseline.
  • Each architecture corresponds to a specific Python class (CoTAgent, ToTAgent, ReActAgent, BaseAgent) located in apps/agent-reasoning/src/agent_reasoning/agents/.
  • Select architectures at runtime using strategy keys ("cot", "tot", "react", "standard") via the agent registry or HTTP API.
  • CoT suits linear logic, ToT handles branching strategy problems, and ReAct enables tool-augmented reasoning for real-time data retrieval.

Frequently Asked Questions

What is the difference between CoT and ReAct reasoning?

CoT generates an internal monologue of sequential reasoning steps without external interaction, while ReAct alternates between reasoning and action steps that invoke tools like calculators or search engines. According to the source code, ReAct emits react_step events containing observation results from these tool calls, whereas CoT only streams chain_step events representing internal thought progression.

How do I switch between cognitive architectures at runtime?

Pass the desired strategy key to the get_strategy_agent_card() function or include it in the strategies list of your HTTP request payload. The orchestrator in apps/agentic_rag/src/reasoning/rag_ensemble.py dynamically loads the corresponding Agent class from the registry defined in apps/agent-reasoning/src/agent_reasoning/server.py based on this key.

Can I combine multiple cognitive architectures in a single request?

Yes. The ensemble orchestrator accepts a list of strategies (e.g., ["cot", "tot", "react"]) and executes them in parallel. It aggregates responses and applies a voting mechanism to select the winner, allowing you to compare how different cognitive architectures approach the same query.

Which architecture is best for mathematical reasoning?

Chain-of-Thought (CoT) is optimized for mathematical reasoning because it forces the model to decompose problems into explicit intermediate steps before generating a final answer. For problems requiring external calculation tools or real-time numerical data, ReAct is the superior choice as it can invoke calculators or APIs during the reasoning process.

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:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →