From eb33be98450522e29155eb8b4796fb6a565c2576 Mon Sep 17 00:00:00 2001 From: uzaxirr Date: Tue, 20 Jan 2026 15:01:17 +0530 Subject: [PATCH 1/6] Update Streamlit cookbook paths --- cookbook/streamlit/agentic-rag.mdx | 49 +++++++++---------- cookbook/streamlit/answer-engine.mdx | 36 ++++++-------- cookbook/streamlit/overview.mdx | 8 ++-- cookbook/streamlit/text-to-sql.mdx | 71 ++++++++++++---------------- 4 files changed, 72 insertions(+), 92 deletions(-) diff --git a/cookbook/streamlit/agentic-rag.mdx b/cookbook/streamlit/agentic-rag.mdx index be39095fb..a3f28cef5 100644 --- a/cookbook/streamlit/agentic-rag.mdx +++ b/cookbook/streamlit/agentic-rag.mdx @@ -1,5 +1,5 @@ --- -title: Agentic RAG +title: Knowledge Agent (Agentic RAG) description: Document Q&A with knowledge base, citations, and conversation memory. --- @@ -8,25 +8,16 @@ A sophisticated RAG (Retrieval Augmented Generation) system that leverages searc ## The agent can: - Process and understand documents from multiple sources (PDFs, websites, text files) -- Build a searchable knowledge base using vector embeddings +- Build a searchable knowledge base using vector embeddings with hybrid search - Maintain conversation context and memory across sessions - Provide relevant citations and sources for its responses -- Generate summaries and extract key insights -- Answer follow-up questions and clarifications +- Handle uncertainty gracefully (ambiguous queries, partial matches, conflicting sources) ## The agent uses: -- Vector similarity search for relevant document retrieval -- Conversation memory for contextual responses +- Hybrid search (semantic + keyword) for relevant document retrieval +- Conversation memory for contextual responses (5 turns) - Citation tracking for source attribution -- Dynamic knowledge base updates - - +- ReasoningTools for think/analyze capabilities ## Example queries to try: - "What are the key points from this document?" @@ -35,11 +26,10 @@ A sophisticated RAG (Retrieval Augmented Generation) system that leverages searc - "How does this relate to [topic X]?" - "What are the limitations or gaps in this analysis?" - "Can you explain [concept X] in more detail?" -- "What other sources support or contradict these claims?" ## Code -The complete code is available in the [Agno repository](https://github.com/agno-agi/agno). +The complete code is available in the [Agno repository](https://github.com/agno-agi/agno/tree/main/cookbook/01_showcase/01_agents/knowledge_agent). ## Usage @@ -60,7 +50,7 @@ The complete code is available in the [Agno repository](https://github.com/agno- ```bash - uv pip install -r cookbook/02_examples/streamlit_apps/agentic_rag/requirements.txt + pip install agno openai psycopg[binary] pgvector ``` @@ -86,24 +76,29 @@ The complete code is available in the [Agno repository](https://github.com/agno- ``` - ```bash - # Required export OPENAI_API_KEY=*** - # Optional - export ANTHROPIC_API_KEY=*** - export GOOGLE_API_KEY=*** + ``` + + + ```bash + python cookbook/01_showcase/01_agents/knowledge_agent/scripts/load_knowledge.py ``` - We recommend using gpt-5-mini for optimal performance. - + ```bash - streamlit run cookbook/02_examples/streamlit_apps/agentic_rag/app.py + # Basic Q&A + python cookbook/01_showcase/01_agents/knowledge_agent/examples/basic_query.py + + # Multi-turn conversation + python cookbook/01_showcase/01_agents/knowledge_agent/examples/conversation.py + + # Edge cases and uncertainty + python cookbook/01_showcase/01_agents/knowledge_agent/examples/edge_cases.py ``` - Open localhost:8501 to start using the Agentic RAG. diff --git a/cookbook/streamlit/answer-engine.mdx b/cookbook/streamlit/answer-engine.mdx index d99096f90..e3c380240 100644 --- a/cookbook/streamlit/answer-engine.mdx +++ b/cookbook/streamlit/answer-engine.mdx @@ -20,14 +20,6 @@ Sage: - Chat history export - Interactive Streamlit UI - - ## Simple queries to try - "Tell me about the tariffs the US is imposing in 2025" - "Which is a better reasoning model: o3-mini or DeepSeek R1?" @@ -42,7 +34,7 @@ Sage: ## Code -The complete code is available in the [Agno repository](https://github.com/agno-agi/agno). +The complete code is available in the [Agno repository](https://github.com/agno-agi/agno/tree/main/cookbook/01_showcase/01_agents/research_agent). ## Usage @@ -63,29 +55,31 @@ The complete code is available in the [Agno repository](https://github.com/agno- ```bash - uv pip install -r cookbook/02_examples/streamlit_apps/answer_engine/requirements.txt + pip install agno openai parallel-web ``` ```bash - # Required export OPENAI_API_KEY=*** - export EXA_API_KEY=*** - - # Optional (for additional models) - export ANTHROPIC_API_KEY=*** - export GOOGLE_API_KEY=*** - export GROQ_API_KEY=*** + export PARALLEL_API_KEY=*** ``` - We recommend using gpt-5-mini for optimal performance. - + ```bash - streamlit run cookbook/02_examples/streamlit_apps/answer_engine/app.py + # Fast overview research (3-5 sources) + python cookbook/01_showcase/01_agents/research_agent/examples/quick_research.py + + # Comprehensive investigation (10-15 sources) + python cookbook/01_showcase/01_agents/research_agent/examples/deep_research.py + + # Comparison and decision support + python cookbook/01_showcase/01_agents/research_agent/examples/comparative.py + + # Automated accuracy testing + python cookbook/01_showcase/01_agents/research_agent/examples/evaluate.py ``` - Open localhost:8501 to start using Sage. diff --git a/cookbook/streamlit/overview.mdx b/cookbook/streamlit/overview.mdx index 73098a267..96d641afc 100644 --- a/cookbook/streamlit/overview.mdx +++ b/cookbook/streamlit/overview.mdx @@ -29,11 +29,11 @@ cd agno python3 -m venv .venv source .venv/bin/activate -# Install for specific app -uv pip install -r cookbook/02_examples/streamlit_apps/agentic_rag/requirements.txt +# Install agno +pip install agno -# Run -streamlit run cookbook/02_examples/streamlit_apps/agentic_rag/app.py +# Run an example +python cookbook/01_showcase/01_agents/text_to_sql/examples/basic_queries.py ``` Open `localhost:8501` to use the application. diff --git a/cookbook/streamlit/text-to-sql.mdx b/cookbook/streamlit/text-to-sql.mdx index f701921c7..27c90f933 100644 --- a/cookbook/streamlit/text-to-sql.mdx +++ b/cookbook/streamlit/text-to-sql.mdx @@ -1,6 +1,6 @@ --- -title: SQL Agent -description: Natural language to SQL with dynamic few-shot learning and Agentic RAG. +title: Text-to-SQL Agent +description: Natural language to SQL with dynamic few-shot learning and self-learning capabilities. --- A text-to-SQL system that: @@ -12,17 +12,10 @@ We'll use the F1 dataset as an example, but you can easily extend it to other da ### Key capabilities - Natural language to SQL conversion -- Retrieve table metadata, sample queries and rules using Agentic RAG -- Better query construction with the help of dynamic few-shot examples and rules -- Interactive Streamlit UI - - +- Semantic model for table metadata guidance +- Knowledge base with query patterns and data quality notes +- Self-learning workflow (save validated queries for future use) +- Agentic memory for user preferences across sessions ### Simple queries to try - "Who are the top 5 drivers with the most race wins?" @@ -41,7 +34,7 @@ We'll use the F1 dataset as an example, but you can easily extend it to other da ## Code -The complete code is available in the [Agno repository](https://github.com/agno-agi/agno). +The complete code is available in the [Agno repository](https://github.com/agno-agi/agno/tree/main/cookbook/01_showcase/01_agents/text_to_sql). ## Usage @@ -55,14 +48,20 @@ The complete code is available in the [Agno repository](https://github.com/agno- ```bash - python3 -m venv .venv - source .venv/bin/activate + uv venv .venvs/text-to-sql --python 3.12 + source .venvs/text-to-sql/bin/activate ``` ```bash - uv pip install -r cookbook/02_examples/streamlit_apps/sql_agent/requirements.txt + uv pip install -r cookbook/01_showcase/01_agents/text_to_sql/requirements.in + ``` + + + + ```bash + export OPENAI_API_KEY=*** ``` @@ -88,40 +87,32 @@ The complete code is available in the [Agno repository](https://github.com/agno- ``` - + ```bash - python cookbook/02_examples/streamlit_apps/sql_agent/load_f1_data.py + python cookbook/01_showcase/01_agents/text_to_sql/scripts/check_setup.py ``` - - The knowledge base contains table metadata, rules and sample queries that help the Agent generate better responses. - + ```bash - python cookbook/02_examples/streamlit_apps/sql_agent/load_knowledge.py + python cookbook/01_showcase/01_agents/text_to_sql/scripts/load_f1_data.py + python cookbook/01_showcase/01_agents/text_to_sql/scripts/load_knowledge.py ``` - - Pro tips for enhancing the knowledge base: - - Add `table_rules` and `column_rules` to guide the Agent on query formats - - Add sample queries to `cookbook/02_examples/apps/sql_agent/knowledge_base/sample_queries.sql` - + ```bash - # Required - export OPENAI_API_KEY=*** + # Basic queries + python cookbook/01_showcase/01_agents/text_to_sql/examples/basic_queries.py - # Optional - export ANTHROPIC_API_KEY=*** - export GOOGLE_API_KEY=*** - export GROQ_API_KEY=*** - ``` - We recommend using gpt-5-mini for optimal performance. - + # Self-learning demonstration + python cookbook/01_showcase/01_agents/text_to_sql/examples/learning_loop.py - - ```bash - streamlit run cookbook/02_examples/streamlit_apps/sql_agent/app.py + # Data quality edge cases + python cookbook/01_showcase/01_agents/text_to_sql/examples/edge_cases.py + + # Evaluate accuracy + python cookbook/01_showcase/01_agents/text_to_sql/examples/evaluate.py ``` Open localhost:8501 to start using the SQL Agent. From 8219880ef8ce3b5bfa46801b499655d47d2c7f72 Mon Sep 17 00:00:00 2001 From: uzaxirr Date: Tue, 20 Jan 2026 15:05:16 +0530 Subject: [PATCH 2/6] Update learning cookbook paths and setup instructions --- cookbook/learning/support-agent.mdx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cookbook/learning/support-agent.mdx b/cookbook/learning/support-agent.mdx index 683ccf690..baf8e2dc1 100644 --- a/cookbook/learning/support-agent.mdx +++ b/cookbook/learning/support-agent.mdx @@ -100,14 +100,18 @@ Key pattern: The `namespace=f"org:{org_id}:support"` isolates entity memory per ```bash git clone https://github.com/agno-agi/agno.git -cd agno/cookbook/08_learning +cd agno # Setup (requires Docker for Postgres) -./setup_venv.sh +./cookbook/08_learning/setup_venv.sh ./cookbook/scripts/run_pgvector.sh +# Activate the environment and set API key +source .venvs/learning/bin/activate +export OPENAI_API_KEY=*** + # Run -python 07_patterns/support_agent.py +python cookbook/08_learning/07_patterns/support_agent.py ``` Full source: [agno/cookbook/08_learning/07_patterns/support_agent.py](https://github.com/agno-agi/agno/blob/main/cookbook/08_learning/07_patterns/support_agent.py) From 3677dbe3667e237636c9c1c487b69a64f0d3da04 Mon Sep 17 00:00:00 2001 From: Uzair Ali <72073401+uzaxirr@users.noreply.github.com> Date: Tue, 20 Jan 2026 15:07:22 +0530 Subject: [PATCH 3/6] Update cookbook/streamlit/overview.mdx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- cookbook/streamlit/overview.mdx | 2 -- 1 file changed, 2 deletions(-) diff --git a/cookbook/streamlit/overview.mdx b/cookbook/streamlit/overview.mdx index 96d641afc..0d5612a83 100644 --- a/cookbook/streamlit/overview.mdx +++ b/cookbook/streamlit/overview.mdx @@ -35,5 +35,3 @@ pip install agno # Run an example python cookbook/01_showcase/01_agents/text_to_sql/examples/basic_queries.py ``` - -Open `localhost:8501` to use the application. From 4401c87380abb18594c1835dce990fa97d253ecc Mon Sep 17 00:00:00 2001 From: Uzair Ali <72073401+uzaxirr@users.noreply.github.com> Date: Tue, 20 Jan 2026 15:07:32 +0530 Subject: [PATCH 4/6] Update cookbook/streamlit/text-to-sql.mdx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- cookbook/streamlit/text-to-sql.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/streamlit/text-to-sql.mdx b/cookbook/streamlit/text-to-sql.mdx index 27c90f933..9d275e8e9 100644 --- a/cookbook/streamlit/text-to-sql.mdx +++ b/cookbook/streamlit/text-to-sql.mdx @@ -114,7 +114,7 @@ The complete code is available in the [Agno repository](https://github.com/agno- # Evaluate accuracy python cookbook/01_showcase/01_agents/text_to_sql/examples/evaluate.py ``` - Open localhost:8501 to start using the SQL Agent. + These scripts will run example text-to-SQL queries and demonstrate the SQL Agent in your terminal. From e2ed8d5089d652a0cbd10a64e9f14c6216b751d7 Mon Sep 17 00:00:00 2001 From: Uzair Ali <72073401+uzaxirr@users.noreply.github.com> Date: Tue, 20 Jan 2026 15:07:42 +0530 Subject: [PATCH 5/6] Update cookbook/streamlit/text-to-sql.mdx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- cookbook/streamlit/text-to-sql.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/streamlit/text-to-sql.mdx b/cookbook/streamlit/text-to-sql.mdx index 9d275e8e9..ef4d4ec22 100644 --- a/cookbook/streamlit/text-to-sql.mdx +++ b/cookbook/streamlit/text-to-sql.mdx @@ -55,7 +55,7 @@ The complete code is available in the [Agno repository](https://github.com/agno- ```bash - uv pip install -r cookbook/01_showcase/01_agents/text_to_sql/requirements.in + uv pip install -r cookbook/01_showcase/01_agents/text_to_sql/requirements.txt ``` From 9421f03ae69e92352f9444d45ce70e4cf246289a Mon Sep 17 00:00:00 2001 From: shalz Date: Fri, 30 Jan 2026 09:49:49 +0530 Subject: [PATCH 6/6] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- cookbook/streamlit/text-to-sql.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbook/streamlit/text-to-sql.mdx b/cookbook/streamlit/text-to-sql.mdx index ef4d4ec22..63dc4bf48 100644 --- a/cookbook/streamlit/text-to-sql.mdx +++ b/cookbook/streamlit/text-to-sql.mdx @@ -1,9 +1,9 @@ --- -title: Text-to-SQL Agent +title: Text to SQL Agent description: Natural language to SQL with dynamic few-shot learning and self-learning capabilities. --- -A text-to-SQL system that: +A text to SQL system that: 1. Uses Agentic RAG to search for table metadata, sample queries and rules for writing better SQL queries. 2. Uses dynamic few-shot examples and rules to improve query construction. 3. Provides an interactive Streamlit UI for users to query the database.