Agents that
think step-by-step
Built-in plan → reason → act → reflect → respond cognitive loop. Create AI agents that break down complex problems systematically.
The Five-Step Cognitive Loop
Cogency agents follow a structured reasoning process inspired by human cognitive patterns. Each step builds on the previous, creating intelligent, deliberate responses.
Plan
Break down the problem into actionable steps
Reason
Analyze information and consider approaches
Act
Execute tools and gather information
Reflect
Evaluate results and adjust approach
Respond
Synthesize findings into final answer
Multi-step Reasoning in Action
Watch an agent systematically solve a complex problem
from cogency.agent import Agent from cogency.llm import GeminiLLM from cogency.tools import WebSearchTool, CalculatorTool # Create an agent with reasoning capabilities agent = Agent( name="Research Analyst", llm=GeminiLLM(api_key="your-key"), tools=[WebSearchTool(), CalculatorTool()] ) # Complex query requiring multi-step reasoning result = await agent.run( "Compare the market cap of Tesla vs Toyota, then calculate " "what percentage Tesla would need to grow to match Toyota" )
How the Agent Thinks
Plan Phase
"I need to: 1) Find Tesla's current market cap, 2) Find Toyota's market cap, 3) Calculate the difference, 4) Determine growth percentage needed"
Reason Phase
"Market caps change frequently, so I need current data. Web search will give me the most recent figures for both companies."
Act Phase
🔍 Searching web for "Tesla market cap 2024"...
🔍 Searching web for "Toyota market cap 2024"...
🧮 Calculating percentage difference...
Reflect Phase
"I found Tesla at $800B and Toyota at $250B. Wait, that seems wrong - let me double-check Toyota's figure as Tesla is typically smaller..."
Respond Phase
"Based on current data: Tesla ($800B) vs Toyota ($250B). Tesla would need to grow by 31.25% to match Toyota's market cap."
Why Multi-step Reasoning Matters
Systematic Problem Solving
Break complex queries into manageable steps, ensuring thorough analysis and comprehensive solutions.
Self-Correction
Built-in reflection allows agents to catch errors, verify results, and adjust their approach mid-execution.
Transparent Reasoning
Every step is visible and traceable, making agent behavior predictable and debuggable in production.
Ready for Intelligent Reasoning?
Build AI agents that think step-by-step with Cogency's built-in cognitive loop