A production-grade Multi-Agent AI Chatbot built with LangGraph β featuring intelligent routing, RAG pipeline, real-time web search, Python code execution via MCP, and persistent memory backed by PostgreSQL.
| Feature | Description |
|---|---|
| π Smart Router | Classifies every query and sends it to the right agent automatically |
| π Python Executor | Runs Python code in real-time via a remote FastMCP server |
| π Web Search | Google search with full page content extraction (Apify) |
| π RAG Pipeline | Document Q&A using Pinecone Vector DB + BM25 hybrid retrieval |
| π§ Persistent Memory | Multi-thread conversation memory backed by PostgreSQL (Neon) |
| π Observability | Full tracing via LangSmith |
| π Bilingual | Responds in Roman Urdu or English based on user language |
User Query
β
βΌ
βββββββββββββββ
β router_node β Classifies β python_tool / web_search / rag / direct
ββββββββ¬βββββββ
β
ββββββ΄βββββββββββ¬βββββββββββββββ
βΌ βΌ βΌ
python_tool web_search rag
(FastMCP) (Apify) (Pinecone)
β
βΌ
answer_node β END
βββ langgraph_agent.py # Main agent β graph, nodes, tools
βββ config.py # All settings loaded from .env
βββ requirements.txt # Dependencies
βββ .env.example # Environment variables template
βββ docs/
β βββ architecture.md # Deep-dive architecture docs
β βββ api_reference.md # API reference
βββ tests/
β βββ test_agent.py # pytest test suite
βββ README.md
git clone https://github.com/Pokemon455/langgraph-multi-agent.git
cd langgraph-multi-agent
pip install -r requirements.txtcp .env.example .env
# Open .env and fill in your API keysimport asyncio
from langgraph_agent import build_and_run
result = asyncio.run(build_and_run("python version check karo", thread_id="1"))
print(result)| Variable | Description | Get it from |
|---|---|---|
NVIDIA_API_KEY |
LLM inference | build.nvidia.com |
PINECONE_API_KEY |
Vector database | pinecone.io |
DATABASE_URL |
PostgreSQL memory | neon.tech |
APIFY_API_TOKEN |
Web search | apify.com |
LANGCHAIN_API_KEY |
Tracing (optional) | smith.langchain.com |
MCP_SERVER_URL |
FastMCP Python REPL | fastmcp-python-repl-server |
- fastmcp-python-repl-server β The MCP Python REPL server used by this agent
- langchain-ai/langgraph β The graph framework powering this project
- langchain-mcp-adapters β MCP integration for LangChain
Contributions, issues and feature requests are welcome! See CONTRIBUTING.md for guidelines.
MIT Β© Arbaz