A stateful AI Agent combining Retrieval-Augmented Generation (RAG) and Tool Execution (Calculations & Knowledge Retrieval) built with LangGraph, LangChain, Groq, FAISS, and Streamlit.
- 🧠 Stateful Agent (LangGraph): Built using
StateGraphwith custom nodes for LLM reasoning, dynamic tool selection, and state management. - 📚 Local Document Search (RAG): FAISS vector database indexed with Google Generative AI Embeddings (
models/gemini-embedding-001) for semantic search over AI/ML concepts. - 🧮 Math & Utility Tools: Custom agent tools for arithmetic calculations (
add,multiply,divide). - 🖥️ Streamlit Web Interface:
- Real-time interactive chat display.
- Live Tool Trace Sidebar showing exact tool calls, arguments, and execution outputs per turn.
- ⚡ Powered by Groq: Ultra-fast LLM inference via
ChatGroq.
graph TD
User([User Prompt]) --> START((Start))
START --> LLM[LLM Call Node]
LLM --> Decision{Requires Tool?}
Decision -- Yes --> ToolNode[Tool Execution Node]
ToolNode --> LLM
Decision -- No / Final Answer --> END((End))
END --> StreamlitUI[Streamlit Chat & Tool Trace]
RAG+LangGraph_Project/
├── app.py # Streamlit UI application with live tool tracking
├── agent.py # LangGraph agent definition & custom tools
├── ingest.py # Script to chunk documents & build FAISS vector index
├── assets/ # Streamlit UI screenshots & demo media
├── sample_docs/ # Knowledge base text files (e.g. ai_context.txt)
│ └── ai_context.txt
├── faiss_index/ # Generated local FAISS vector store
├── pyproject.toml # Project dependencies & configuration
├── .env.example # Environment variable template
└── README.md # Project documentation
Here is the interactive Streamlit web interface in action, showcasing sample question chips, live tool tracing, document search (RAG), and mathematical tool executions:
- Python
>= 3.11 - uv (recommended) or standard
pip
git clone https://github.com/Jaydeep0832/RAG-LangGraph.git
cd RAG-LangGraphUsing uv:
uv syncOr using standard pip:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r pyproject.tomlCopy .env.example to .env and fill in your API keys:
cp .env.example .envAdd your keys inside .env:
GOOGLE_API_KEY="your_google_ai_studio_key"
GROQ_API_KEY="your_groq_api_key"Build the local vector index from documents in sample_docs/:
uv run python ingest.pyLaunch the interactive agent interface:
uv run streamlit run app.pyOpen your browser at http://localhost:8501.
- Framework: LangGraph, LangChain Core
- LLM: Groq (
ChatGroq) - Embeddings: Google Generative AI Embeddings (
gemini-embedding-001) - Vector Store: FAISS (Facebook AI Similarity Search)
- UI: Streamlit
- Package Manager: UV
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.




