An enterprise-grade, production-ready Multi-Agent Research Assistant built with LangGraph, LangChain, Ollama (llama3.1), FAISS, SQLite, Streamlit, and Tavily Web Search API.
It combines document-based RAG, real-time web search, intelligent query routing, answer verification, citations, and conversational memory to deliver context-aware research with PDF, DOCX, and Markdown export.
Unlike simple RAG chatbots, this application employs a Planner Agent to dynamically analyze query intent, uploaded document availability, retrieval confidence scores, and freshness requirements to route queries along optimal agent execution paths.
sentence-transformers/all-MiniLM-L6-v2), and indexes into FAISS vector store with normalized confidence scores.Brief, Detailed, Bullet Points, ELI5, Professional, Research).llm_only: General knowledge, programming, or coding questions.rag_only: Questions strictly pertaining to uploaded documents.web_search: Latest/current news, real-time events, external facts.hybrid_rag_llm: Related to uploaded documents, but augmented with LLM reasoning when document facts are partial.hybrid_rag_web: Comparing uploaded document facts with latest live web research.graph TD
User([User Input]) --> App[Streamlit UI]
App --> Memory[Memory Agent: Follow-up Reformulation]
Memory --> Planner[Planner Agent: Routing Logic]
Planner -- LLM Direct --> Reasoning[Reasoning Agent]
Planner -- Document Related --> Retriever[Retriever Agent: FAISS Index]
Planner -- Fresh Info --> WebSearch[Web Search Agent: Tavily]
Planner -- Hybrid RAG+Web --> Retriever & WebSearch
Retriever --> Verifier[Verifier Agent: Grounding & Conflict Check]
WebSearch --> Verifier
Verifier --> Reasoning
Reasoning --> Summarizer[Summarizer Agent: Response Style]
Summarizer --> Citation[Citation Agent: Sources & References]
Citation --> App
Citation --> DB[(SQLite Database)]
multi-agent-research-assistant/
│
├── app.py # Main Streamlit UI dashboard
├── graph.py # LangGraph StateGraph orchestration
├── config.py # Centralized configuration & environment loader
├── database.py # SQLite database for persistent history & metadata
├── prompts.py # System & user prompts for all 8 agents
├── utils.py # Logging setup and PDF/DOCX/MD export utilities
│
├── agents/ # Modular Agent Implementations
│ ├── __init__.py
│ ├── planner.py # Query intent & routing agent
│ ├── retriever.py # PDF/DOCX/TXT loader & FAISS vector search agent
│ ├── web_search.py # Tavily web search agent
│ ├── reasoning.py # Multi-source answer synthesis agent
│ ├── verifier.py # Groundedness & conflict verification agent
│ ├── summarizer.py # Multi-style formatting agent
│ ├── citation.py # Citation extraction agent
│ └── memory.py # History & follow-up reformulation agent
│
├── uploads/ # Directory for uploaded documents
├── vector_store/ # FAISS vector store index directory
├── database/ # SQLite database location
├── logs/ # Application logs directory
├── sample_docs/ # Test documents for quick RAG testing
├── requirements.txt # Python dependencies
├── README.md # Documentation
└── .env.example # Sample environment variables
llama3.1 pulled:
ollama pull llama3.1
Windows (PowerShell):
python -m venv .venv
.\.venv\Scripts\Activate.ps1
Windows (CMD):
python -m venv .venv
.\.venv\Scripts\Activate.ps1
Linux / macOS:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Note: Always run from inside the activated
.venvenvironment. If you seeModuleNotFoundError, ensure.venvis activated or use the full path to.venv\Scripts\python.exe -m streamlit run app.py.
Copy .env.example to .env:
cp .env.example .env # Linux/macOS
copy .env.example .env # Windows
Update .env with your Tavily API Key (or OpenAI key if using fallback):
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=llama3.1
TAVILY_API_KEY=your_tavily_api_key_here
After activating .venv:
Or directly with venv Python (no activation needed):
# Windows
.\.venv\Scripts\python.exe -m streamlit run app.py
# Linux/macOS
.venv/bin/python -m streamlit run app.py
"What is LangChain?" or "Write a Python function to quicksort an array."ROUTE: LLM_ONLYsample_docs/sample_research.txt in the sidebar and click Process & Index Documents."What is Project Titan and what is its latency benchmark?"ROUTE: RAG_ONLY or ROUTE: HYBRID_RAG_LLM with document citations."What are the latest updates on GPT-5?"ROUTE: WEB_SEARCH with web source links."Explain LangGraph.""Compare it with CrewAI."MIT License. Built for enterprise Agentic AI development.