A state-of-the-art Agentic RAG system that leverages Gemini 2.0 Flash Thinking for deep reasoning over complex documents. This agent doesn't just retrieve; it thinks through the context to provide precise, cited, and search-grounded answers.
- Gemini Thinking Model: Utilizes
gemini-2.0-flash-thinking-expfor superior reasoning over large context windows. - Multi-Source Ingestion: Seamlessly processes PDFs and Web URLs into a unified knowledge base.
- Query Rewriting: An autonomous Query Rewriter Agent reformulates user questions to be search-friendly and precise.
- Exa Web Search: Deep integration with Exa.ai for retrieving "clean" neural web results instead of just keyword-based links.
- Vector Intelligence: Persistent ChromaDB storage with custom monkey-patching for high stability on macOS.
- Citations: Every answer focus on relevant details and direct citations from the uploaded sources.
- Models: Gemini 2.0 Flash Thinking / exp
- Framework: Agno
- Search Tool: Exa AI Tools
- Embeddings: Google Gemini Embeddings (
models/embedding-001) - Vector DB: ChromaDB (with
hnswliboptimizations) - UI: Streamlit
- Install dependencies:
pip install streamlit agno google-generativeai langchain-community bs4 chromadb hnswlib
- Acquire API Keys:
- Google AI Studio (Gemini Key)
- Exa AI Dashboard (Exa Key)
- Run the Agent:
streamlit run agentic_rag.py
| Step | Agent / Tool | Rationale |
|---|---|---|
| Ingestion | PyPDFLoader / WebBaseLoader |
Extracting raw intelligence from unstructured data. |
| Search | ExaTools |
Fetching real-time context from the open web as a fallback. |
| Reasoning | Gemini RAG Agent |
Synthesizing final answers using the Thinking model for maximum accuracy. |
Advanced Agentic Reasoning powered by Gemini & Agno