Deep Dive into the Agno Reasoning Demo
This post is a structured English summary of a Chinese forum article analyzing the Agno Reasoning Demo, a multi-agent system built on the Agno framework that showcases multi-agent collaboration, knowledge management, and reasoning capabilities for financial analysis, Q&A, math reasoning, and web search.
Key points
- Tech stack: Python 3.8+, Agno framework, OpenAI models (GPT-4o, GPT-4o-mini, o3-mini), PostgreSQL (agent state/memory), LanceDB (vector knowledge base), FastAPI (API serving), DuckDuckGo (search). Dependencies include openai, exa_py, ddgs, yfinance, pypdf, sqlalchemy, fastapi, youtube-transcript-api, python-docx.
- Layered architecture: data layer (PostgreSQL + LanceDB), model layer (OpenAI), tool layer (search, knowledge, reasoning tools), agent layer, team layer, and application layer (AgentOS exposing a FastAPI app).
- Core Agno components:
Agent,Team,Knowledge,Tools,Reasoning,VectorDB, andAgentOS. - Knowledge is stored in LanceDB with hybrid search; content is added via
add_content()(e.g., fromhttps://www.paulgraham.com/read.html). KnowledgeToolsenables think, search, analyze, and few-shot examples.- Reasoning machinery includes
NextAction(continue / validate / final answer / reset),ReasoningStep, andReasoningSteps. - Three reasoning modes are demonstrated: built-in reasoning (
reasoning=True), a dedicated reasoning model (reasoning_model), and reasoning tools (ReasoningTools()). AgentOSmanages all agents and teams;agent_os.serve(app="reasoning_demo:app", reload=True)launches the web service with hot reload.- Move hardcoded DB URLs into environment variables (
python-dotenv). - Add try/except error handling around knowledge-base ingestion.
- Add a proper
loggingsetup. - Dynamically select models by task complexity to control cost.
Agents implemented in the demo
| Agent | Model | Key features |
|---|---|---|
| Finance Agent | GPT-4o | DuckDuckGo news, always displays data as tables, 5-run history |
| Chain-of-Thought Agent | GPT-4o-mini | reasoning=True, 3-run history |
| Reasoning Model Agent | GPT-4o + o3-mini | Dual-model design: GPT-4o for generation, reasoning_model=o3-mini for reasoning, focused on math |
| Reasoning Tool Agent | GPT-4o-mini | Uses ReasoningTools() for structured reasoning |
| Web Search Agent | GPT-4o-mini | DuckDuckGo search, instructions to always include sources |
| Knowledge Agent | GPT-4o | Knowledge tools with think, search, and analyze enabled |
Team collaboration
A Reasoning Finance Team combines the web agent and finance agent under a GPT-4o team leader with ReasoningTools:
1. The team receives a financial query and allocates tasks.
2. The web agent searches for relevant information; the finance agent analyzes data and generates tables.
3. The leader integrates member responses (made visible via show_members_responses=True) and returns only the final answer in table format.
Knowledge base and reasoning
Suggested improvements from the original post
Application scenarios and takeaways
Use cases include real-time financial analysis, general Q&A, math reasoning, knowledge-base querying, and collaborative team tasks. The demo is a useful learning reference for modular architecture, agent design patterns, team orchestration, reasoning implementation, and knowledge management in agent systems.
References
1. Agno framework: https://github.com/agno-ai/agno 2. OpenAI API: https://platform.openai.com/docs/introduction 3. LanceDB: https://lancedb.github.io/lancedb/ 4. FastAPI: https://fastapi.tiangolo.com/ 5. PostgreSQL: https://www.postgresql.org/docs/