An intelligent, agentic RAG (Retrieval-Augmented Generation) system that routes user queries between a local knowledge base and real-time web search β powered by LangGraph, Groq, and Streamlit.
- Overview
- Features
- Tech Stack
- Project Structure
- Getting Started
- Environment Variables
- How It Works
- Contributing
- License
AgenticIQ is a full-stack agentic RAG pipeline that intelligently decides how to answer user questions. It uses a router node powered by an LLM to determine whether to retrieve documents from a local ChromaDB vector store or perform a live web search via Tavily β giving users the best of both worlds: deep domain knowledge and real-time information.
- π Intelligent Routing β LLM-based router decides between vector store and web search
- π RAG Pipeline β Ingests and retrieves documents from ChromaDB
- π Web Search β Real-time search using Tavily API
- β‘ Fast Inference β Powered by Groq's ultra-fast LLM API
- π₯οΈ Streamlit UI β Clean, interactive frontend for querying the agent
- π LangGraph Orchestration β Robust agentic workflow using graph-based state management
| Layer | Technology |
|---|---|
| LLM | Groq (LLaMA / Mixtral) |
| Orchestration | LangGraph, LangChain |
| Vector Store | ChromaDB |
| Embeddings | HuggingFace |
| Web Search | Tavily API |
| Frontend | Streamlit |
| Language | Python 3.12 |
AgenticIQ/
βββ src/
β βββ RAG/
β β βββ __init__.py
β β βββ ingest.py # PDF ingestion & vector store creation
β β βββ retrieve.py # Document retrieval from ChromaDB
β βββ __init__.py
β βββ config.py # Centralized configuration & env variables
β βββ frontend.py # Streamlit UI
β βββ generation.py # LangGraph agent nodes & routing logic
βββ knowledge-base/ # Source PDF documents (not tracked in git)
βββ chroma_db/ # Persistent vector store (not tracked in git)
βββ .env.example # Environment variable template
βββ .gitignore
βββ requirements.txt
βββ README.md
- Python 3.10+
- Groq API Key
- Tavily API Key
- HuggingFace Token
git clone https://github.com/your-username/agenticiq.git
cd agenticiqpython -m venv venv
# Windows
venv\Scripts\activate
# macOS / Linux
source venv/bin/activatepip install -r requirements.txtcp .env.example .envFill in your API keys in the .env file (see Environment Variables).
Add your PDF files to the knowledge-base/ folder, then run:
python -c "from src.RAG.ingest import ingest_pdfs_into_vectordb; ingest_pdfs_into_vectordb()"streamlit run src/frontend.pyCreate a .env file in the root directory based on .env.example:
GROQ_API_KEY=your_groq_api_key
TAVILY_API_KEY=your_tavily_api_key
USER_AGENT=your_user_agent_string
HF_TOKEN=your_huggingface_token
β οΈ Never commit your.envfile. It is already listed in.gitignore.
User Query
β
βΌ
βββββββββββββββ
β Router Node β β LLM decides: vectorstore or web_search?
βββββββββββββββ
β β
βΌ βΌ
βββββββββββ ββββββββββββββ
β RAG β β Web Search β
βRetrieve β β (Tavily) β
βββββββββββ ββββββββββββββ
β β
ββββββ¬ββββββ
βΌ
βββββββββββββββ
β Generation β β LLM generates final answer
βββββββββββββββ
β
βΌ
Response
- Ingest β PDFs are chunked, embedded, and stored in ChromaDB
- Route β The router LLM analyzes the query and picks the best source
- Retrieve β Documents are fetched from ChromaDB or Tavily web search
- Generate β The LLM generates a final, grounded response
- Display β Answer is shown in the Streamlit UI
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature/your-feature) - Commit your changes (
git commit -m "feat: add your feature") - Push to the branch (
git push origin feature/your-feature) - Open a Pull Request