An intelligent multi-route AI assistant that combines:
- Standard conversational chat
- Retrieval-Augmented Generation (RAG)
- Real-time web research
- Weather lookup
- Session memory
- MCP tool integration
The system automatically decides whether a user query should be handled by:
- Chat Node → normal conversation
- RAG Node → answer using uploaded documents
- Research Node → live internet search and weather tools
The assistant automatically routes each prompt:
| Query Type | Route |
|---|---|
| General chat | Chat Node |
| Document-related | RAG Node |
| Real-time info | Research Node |
Explain machine learning→ ChatSummarize my uploaded PDF→ RAGWeather in New York→ ResearchLatest AI news→ Research
Uses PostgreSQL + pgvector for:
- Semantic search
- PDF retrieval
- Context-aware answers
- Document understanding
Supports:
- Live web search via Tavily
- Weather lookup
- Multi-step planning
- Final answer synthesis
Maintains short-term memory per session:
- Stores previous messages
- Preserves conversation context
- Trims old messages automatically
Deep_Agent_Chat/
│── auth.py
│── database.py
│── embedding.py
│── models.py
│── rag_pgvector.py
│── title_app.py
│── mcp_weather_tool.py
│── weather_mcp1.py
│── tavily_mcp_server.py
---
```bash
Installation
1. Clone Repository
git clone https://github.com/yourusername/deep-agent-chat.git
cd deep-agent-chat
2. Create Virtual Environment
python -m venv venv
Linux / macOS
source venv/bin/activate
Windows
venv\Scripts\activate
3. Install Dependencies
pip install -r requirements.txt
4. Create .env File
GROQ_API_KEY=your_groq_api_key
DATABASE_URL=postgresql://user:password@localhost:5432/deep_agentRequired Services
PostgreSQL + pgvector
Enable extension:
CREATE EXTENSION vector;
Tavily MCP Server
Runs on:
http://localhost:8002/mcp
Weather MCP Server
Runs on:
http://localhost:8001/mcpTechnologies Used:
Python
LangChain
Groq LLM
PostgreSQL
pgvector
MCP Protocol
AsyncIOFuture Improvements
Planned enhancements:
Streaming responses
Multi-document retrieval
Long-term memory
Source citations
Better tool routing
Analytics dashboardLicense
MIT LicenseContributing
Contributions are welcome.
Steps
Fork the repository
Create your feature branch
Commit your changes
Push to the branch
Open a pull request