Learn how to create AI agents that can perform step-by-step reasoning and extract information
A workflow where a reasoning agent breaks down complex problems into steps, followed by a smaller agent that processes these steps to provide concise answers.
Install Package
Install required packages:
praisonaiagents[llm] includes all necessary dependencies for reasoning agents
Set API Key
Configure your API key:
Create File
Create a new file called app.py
and add
the following code:
Run Application
Execute the script:
Break down complex problems into logical steps.
Combine reasoning and processing agents.
Use different models for reasoning and processing.
Connect reasoning output to processing tasks.
Reasoning agents enable:
If reasoning steps aren’t clear:
If agents aren’t coordinating:
The reasoning agent uses a specialized model (deepseek-reasoner) optimized for step-by-step analysis, while the small agent can use a more general-purpose model for processing the reasoning output.