Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions cookbook/learning/support-agent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

## Overview

A customer support agent that combines all learning stores to provide faster resolutions over time. Uses namespace isolation for multi-tenant deployments where different organizations share the system but have separate knowledge.

Check warning on line 8 in cookbook/learning/support-agent.mdx

View check run for this annotation

Mintlify / Mintlify Validation (agno-v2) - vale-spellcheck

cookbook/learning/support-agent.mdx#L8

Did you really mean 'namespace'?

## Code

Expand Down Expand Up @@ -100,14 +100,18 @@

```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)
Expand Down
49 changes: 22 additions & 27 deletions cookbook/streamlit/agentic-rag.mdx
Original file line number Diff line number Diff line change
@@ -1,32 +1,23 @@
---
title: Agentic RAG
title: Knowledge Agent (Agentic RAG)

Check warning on line 2 in cookbook/streamlit/agentic-rag.mdx

View check run for this annotation

Mintlify / Mintlify Validation (agno-v2) - vale-spellcheck

cookbook/streamlit/agentic-rag.mdx#L2

Did you really mean 'Agentic'?
description: Document Q&A with knowledge base, citations, and conversation memory.
---

A sophisticated RAG (Retrieval Augmented Generation) system that leverages search of a knowledge base with LLMs to provide deep insights into the data.

Check warning on line 6 in cookbook/streamlit/agentic-rag.mdx

View check run for this annotation

Mintlify / Mintlify Validation (agno-v2) - vale-spellcheck

cookbook/streamlit/agentic-rag.mdx#L6

Did you really mean 'LLMs'?


## The agent can:
- Process and understand documents from multiple sources (PDFs, websites, text files)

Check warning on line 10 in cookbook/streamlit/agentic-rag.mdx

View check run for this annotation

Mintlify / Mintlify Validation (agno-v2) - vale-spellcheck

cookbook/streamlit/agentic-rag.mdx#L10

Did you really mean 'PDFs'?
- 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

<video
autoPlay
muted
controls
className="w-full aspect-video"
src="/videos/agentic_rag.mp4"
></video>
- ReasoningTools for think/analyze capabilities

## Example queries to try:
- "What are the key points from this document?"
Expand All @@ -35,11 +26,10 @@
- "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

Expand All @@ -60,7 +50,7 @@

<Step title="Install dependencies">
```bash
uv pip install -r cookbook/02_examples/streamlit_apps/agentic_rag/requirements.txt
pip install agno openai psycopg[binary] pgvector
```
</Step>

Expand All @@ -86,24 +76,29 @@
```
</Step>


<Step title="Set up API keys">
```bash
# Required
export OPENAI_API_KEY=***
# Optional
export ANTHROPIC_API_KEY=***
export GOOGLE_API_KEY=***
```
</Step>

<Step title="Load knowledge base">
```bash
python cookbook/01_showcase/01_agents/knowledge_agent/scripts/load_knowledge.py
```
We recommend using gpt-5-mini for optimal performance.
</Step>

<Step title="Launch the app">
<Step title="Run examples">
```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.
</Step>
</Steps>

Expand Down
36 changes: 15 additions & 21 deletions cookbook/streamlit/answer-engine.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
Sage:
1. Uses real-time web search (DuckDuckGo) and deep contextual analysis (ExaTools) to provide comprehensive answers
2. Intelligently selects tools based on query complexity
3. Provides an interactive Streamlit UI with session management and chat history export

Check warning on line 11 in cookbook/streamlit/answer-engine.mdx

View check run for this annotation

Mintlify / Mintlify Validation (agno-v2) - vale-spellcheck

cookbook/streamlit/answer-engine.mdx#L11

Did you really mean 'Streamlit'?
4. Supports multiple LLM providers (OpenAI, Anthropic, Google, Groq)

Check warning on line 12 in cookbook/streamlit/answer-engine.mdx

View check run for this annotation

Mintlify / Mintlify Validation (agno-v2) - vale-spellcheck

cookbook/streamlit/answer-engine.mdx#L12

Did you really mean 'Groq'?

## Key capabilities
- Natural language query understanding and processing
Expand All @@ -18,20 +18,12 @@
- Multiple LLM provider support
- Session management using SQLite
- Chat history export
- Interactive Streamlit UI

Check warning on line 21 in cookbook/streamlit/answer-engine.mdx

View check run for this annotation

Mintlify / Mintlify Validation (agno-v2) - vale-spellcheck

cookbook/streamlit/answer-engine.mdx#L21

Did you really mean 'Streamlit'?

<video
autoPlay
muted
controls
className="w-full aspect-video"
src="/videos/answer-engine.mp4"
></video>

## 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?"
- "Tell me about Agno"

Check warning on line 26 in cookbook/streamlit/answer-engine.mdx

View check run for this annotation

Mintlify / Mintlify Validation (agno-v2) - vale-spellcheck

cookbook/streamlit/answer-engine.mdx#L26

Did you really mean 'Agno'?
- "What are the latest trends in renewable energy?"

## Advanced analysis queries
Expand All @@ -42,7 +34,7 @@

## 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

Expand All @@ -63,29 +55,31 @@

<Step title="Install dependencies">
```bash
uv pip install -r cookbook/02_examples/streamlit_apps/answer_engine/requirements.txt
pip install agno openai parallel-web
```
</Step>

<Step title="Set up API keys">
```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.
</Step>

<Step title="Launch the app">
<Step title="Run examples">
```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.
</Step>
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The instruction references "Open localhost:8501 to start using Sage" but the preceding step shows running Python example scripts instead of launching a Streamlit app with "streamlit run". This outdated reference should be removed since the examples are now command-line scripts, not a web application.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@uzaxirr can you review and address this one ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

</Steps>

Expand All @@ -94,7 +88,7 @@
- OpenAI (o3-mini, gpt-5-mini)
- Anthropic (claude-3-5-sonnet)
- Google (gemini-2.0-flash-exp)
- Groq (llama-3.3-70b-versatile)

Check warning on line 91 in cookbook/streamlit/answer-engine.mdx

View check run for this annotation

Mintlify / Mintlify Validation (agno-v2) - vale-spellcheck

cookbook/streamlit/answer-engine.mdx#L91

Did you really mean 'Groq'?

## Agent Configuration
The agent configuration is in `agents.py` and the prompts are in `prompts.py`:
Expand Down
10 changes: 4 additions & 6 deletions cookbook/streamlit/overview.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Streamlit Apps

Check warning on line 2 in cookbook/streamlit/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (agno-v2) - vale-spellcheck

cookbook/streamlit/overview.mdx#L2

Did you really mean 'Streamlit'?
sidebarTitle: Overview
description: 3 production-ready applications with Streamlit UI for RAG, SQL, and search.

Check warning on line 4 in cookbook/streamlit/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (agno-v2) - vale-spellcheck

cookbook/streamlit/overview.mdx#L4

Did you really mean 'Streamlit'?
---

Full-stack AI applications - not toy demos. Each app solves a real problem with proper architecture.
Expand Down Expand Up @@ -29,11 +29,9 @@
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.
75 changes: 33 additions & 42 deletions cookbook/streamlit/text-to-sql.mdx
Original file line number Diff line number Diff line change
@@ -1,33 +1,26 @@
---
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:
A text to SQL system that:
1. Uses Agentic RAG to search for table metadata, sample queries and rules for writing better SQL queries.

Check warning on line 7 in cookbook/streamlit/text-to-sql.mdx

View check run for this annotation

Mintlify / Mintlify Validation (agno-v2) - vale-spellcheck

cookbook/streamlit/text-to-sql.mdx#L7

Did you really mean 'Agentic'?
2. Uses dynamic few-shot examples and rules to improve query construction.
3. Provides an interactive Streamlit UI for users to query the database.

Check warning on line 9 in cookbook/streamlit/text-to-sql.mdx

View check run for this annotation

Mintlify / Mintlify Validation (agno-v2) - vale-spellcheck

cookbook/streamlit/text-to-sql.mdx#L9

Did you really mean 'Streamlit'?

We'll use the F1 dataset as an example, but you can easily extend it to other datasets.

### 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

<video
autoPlay
muted
controls
className="w-full aspect-video"
src="/videos/sql_agent.mp4"
></video>
- 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

Check warning on line 18 in cookbook/streamlit/text-to-sql.mdx

View check run for this annotation

Mintlify / Mintlify Validation (agno-v2) - vale-spellcheck

cookbook/streamlit/text-to-sql.mdx#L18

Did you really mean 'Agentic'?

### Simple queries to try
- "Who are the top 5 drivers with the most race wins?"
- "Compare Mercedes vs Ferrari performance in constructors championships"
- "Show me the progression of fastest lap times at Monza"

Check warning on line 23 in cookbook/streamlit/text-to-sql.mdx

View check run for this annotation

Mintlify / Mintlify Validation (agno-v2) - vale-spellcheck

cookbook/streamlit/text-to-sql.mdx#L23

Did you really mean 'Monza'?
- "Which drivers have won championships with multiple teams?"
- "What tracks have hosted the most races?"
- "Show me Lewis Hamilton's win percentage by season"
Expand All @@ -41,7 +34,7 @@

## 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

Expand All @@ -55,14 +48,20 @@

<Step title="Create virtual environment">
```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
```
</Step>

<Step title="Install dependencies">
```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.txt
```
</Step>

<Step title="Set up API keys">
```bash
export OPENAI_API_KEY=***
```
</Step>

Expand All @@ -88,42 +87,34 @@
```
</Step>

<Step title="Load F1 data">
<Step title="Check setup">
```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
```
</Step>

<Step title="Load knowledge base">
The knowledge base contains table metadata, rules and sample queries that help the Agent generate better responses.

<Step title="Load data and knowledge">
```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`
</Step>

<Step title="Set up API keys">
<Step title="Run examples">
```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.
</Step>
# Self-learning demonstration
python cookbook/01_showcase/01_agents/text_to_sql/examples/learning_loop.py

<Step title="Launch the app">
```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.
These scripts will run example text-to-SQL queries and demonstrate the SQL Agent in your terminal.
</Step>
</Steps>

Expand Down