Skip to content

Repository files navigation

Deep Agent Chat

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:

  1. Chat Node → normal conversation
  2. RAG Node → answer using uploaded documents
  3. Research Node → live internet search and weather tools

Features

Smart Query Routing

The assistant automatically routes each prompt:

Query Type Route
General chat Chat Node
Document-related RAG Node
Real-time info Research Node

Examples

  • Explain machine learning → Chat
  • Summarize my uploaded PDF → RAG
  • Weather in New York → Research
  • Latest AI news → Research

RAG Support

Uses PostgreSQL + pgvector for:

  • Semantic search
  • PDF retrieval
  • Context-aware answers
  • Document understanding

Real-Time Research

Supports:

  • Live web search via Tavily
  • Weather lookup
  • Multi-step planning
  • Final answer synthesis

Session Memory

Maintains short-term memory per session:

  • Stores previous messages
  • Preserves conversation context
  • Trims old messages automatically

Project Structure

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_agent
Required 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/mcp

Technologies Used:

Python
LangChain
Groq LLM
PostgreSQL
pgvector
MCP Protocol
AsyncIO

Future Improvements

Planned enhancements:

Streaming responses
Multi-document retrieval
Long-term memory
Source citations
Better tool routing
Analytics dashboard

License

MIT License

Contributing

Contributions are welcome.

Steps
Fork the repository
Create your feature branch
Commit your changes
Push to the branch
Open a pull request

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages