AI-powered conversational agent built using LangGraph, FastAPI, and a multi-tool agent system capable of performing PDF search and mathematical calculations.
This project demonstrates how to build a production-ready agent workflow using LangGraph, integrate custom tools, and expose the assistant through a clean FastAPI backend.
-
LangGraph-based Agent Workflow
Fully modular and deterministic agent pipeline built using LangGraph StateGraph. -
Multi-Tool Agent
- 🔍 PDF Search Tool — Extracts & summarizes content from PDF documents
- ➗ Math/Calculator Tool — Solves arithmetic expressions
- 💬 LLM Default Tool — Used when no tool matches
-
FastAPI Backend (
/chatendpoint) -
Duplicate Response Handling
-
Clean Code Structure
User Message
↓
LangGraph StateGraph
↓
Tool Router
├── PDF Search Tool
├── Calculator Tool
└── LLM Tool (default)
↓
Final Aggregated Response
↓
FastAPI Response → User
LangGraph-Chatbot/
├── Chatbot/
│ └── chatbot.py # LangGraph workflow, tools, routing logic
├── chatbot_api.py # FastAPI API for chatbot
├── requirements.txt # Dependencies
├── pyproject.toml # Project metadata
├── README.md # Documentation
├── .gitignore # Ignored files
└── uv.lock # Dependency lock file
git clone https://github.com/Saurav-kumar077/LangGraph-Chatbot.git
cd LangGraph-Chatbotpython -m venv .venv
Windows:
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
- Python 3.12+
- LangGraph (modular agent workflows)
- FastAPI (API server)
- LangChain (tool integration)
- Pydantic (validation)
- Uvicorn (ASGI server)
Saurav Kumar
AI & Mobile Developer
GitHub: https://github.com/Saurav-kumar077