This project implements a multi-agent research assistant using LangGraph, designed to retrieve, refine, and generate research-based responses. The pipeline intelligently selects sources (PubMed, Arxiv, Global), rewrites queries if needed, and generates a structured response.
- The
managernode determines the most suitable retriever based on the query type:- PubMed → For medical and healthcare-related queries
- Arxiv → For AI, technology, and computer science-related queries
- Global Retrieve → For general topics
- The assigned retriever fetches documents.
- If the retrieved documents are relevant, they are passed to the
generatenode. - If not, the query is rewritten using the
rewrite_querynode and retrieval is attempted again.
- Once relevant documents are found, they are passed as context to the
generatenode. - The final response is generated and returned.
The pipeline consists of the following components:
manager→ Classifies the query into PubMed, Arxiv, or Global Retrievegenerate_pubmed/generate_arxiv/global_retrieve→ Retrieves relevant documentsrewrite_query→ Rewrites queries if no relevant documents are foundgenerate→ Produces the final response
- Python
>=3.10 - Install dependencies:
pip install poetry
poetry installexport TOGETHER_API_KEY="your-key-here"