An AI-powered research assistant that answers user queries by combining:
- Retrieval-Augmented Generation (RAG)
- Vector database search (pgvector)
- Real-time web search (Tavily API)
- Multi-agent orchestration using LangGraph
The system retrieves relevant information from both a local knowledge base and the web, then generates a structured response.
User Query
↓
Retrieval Agent (vector search)
↓
Router Agent
├──→ Synthesis Agent (if context is sufficient)
└──→ Web Agent → Synthesis Agent
↓
Final Answer
- Converts the query into embeddings
- Searches the vector database (pgvector)
- Returns relevant stored content
- Checks if retrieved context exists
- Routes execution to the next agent
- Calls Tavily API
- Retrieves relevant web content
- Combines vector and web context
- Generates:
- Explanation
- Key insights
- Final summary
| Layer | Technology |
|---|---|
| Backend | FastAPI, LangGraph |
| Database | PostgreSQL + pgvector |
| Embeddings | Sentence Transformers (all-MiniLM-L6-v2) |
| Web Search | Tavily API |
| Frontend | Streamlit |
| Infrastructure | Docker, Docker Compose |
git clone <repo-url>
cd <project-folder>
docker-compose up -d --buildRequest:
{
"query": "What is RAG?"
}Response:
{
"final_answer": "..."
}app/
├── main.py
├── graph.py
├── state.py
├── db.py
├── vector_store.py
├── tools/
│ ├── embedder.py
│ └── web_search.py
└── agents/
├── retrieval_agent.py
├── web_agent.py
├── synthesis_agent.py
└── router_agent.py
frontend/
└── streamlit_app.py
The system processes a query by retrieving relevant context from a vector database, optionally augmenting it with live web results, and generating a structured answer through a multi-agent workflow.