Spaces:
Sleeping
title: Multi Agent Research Assistant
emoji: π
colorFrom: blue
colorTo: red
sdk: docker
pinned: false
Multi-Agent Research System π
This repository contains a full-stack, AI-powered Multi-Agent Research System By providing a target research topic, you can trigger a team of autonomous LangGraph agents to collaboratively browse the web, aggregate raw data, write a draft, fact-check it, and render a finalized markdown report in real-time.
ποΈ Architecture Stack
Backend
- Framework: FastAPI for blazing-fast asynchronous endpoints.
- AI Orchestration: LangGraph & LangChain.
- LLM Provider: Groq using the
llama-3.3-70b-versatilemodel for lightning-fast inference. - Search Tooling: Tavily for optimized web retrieval.
- Streaming: Server-Sent Events (SSE) via
sse_starletteproviding real-time UI logging of the LangGraph execution.
Frontend
- Interface: Pure Vanilla JavaScript & HTML/CSS.
- Styling: Custom, highly responsive futuristic dark mode design featuring glassmorphism micro-interactions.
- Rendering: Marked.js for beautiful, out-of-the-box markdown conversion from the final AI report.
π€ The Agent Workflow
The underlying LangGraph StateGraph defines three specialized nodes:
- Researcher Node: Takes the user's initial query (or feedback loop instructions) and performs comprehensive web lookups via Tavily's Search API.
- Analyst Node: Consumes the unstructured, raw web-scraped data to intelligently synthesize a structured Markdown draft.
- Reviewer Node: Meticulously fact-checks the draft against the raw data.
- If satisfactory: It yields an
[APPROVED]signal and the final report. - If data is missing/hallucinated: It yields a
[REJECTED]signal with specific feedback, seamlessly routing execution back to the Researcher Node for a new iteration.
- If satisfactory: It yields an
π» Installation & Setup
Clone the repository.
Install system requirements: Ensure you have Python 3.9+ available.
pip install fastapi uvicorn langchain langchain-groq langgraph sse-starlette python-dotenv langchain-community tavily-pythonConfigure Environment Variables: Create a
.envfile in the project's root directory containing:GROQ_API_KEY=your_groq_api_key_here TAVILY_API_KEY=your_tavily_api_key_here
π How to Run Locally
You will need to run the Backend API and the Frontend Web App concurrently in two separate terminal windows.
1. Run the Backend (Terminal 1)
From the root directory, start the FastAPI server on port 8000:
# Note: On Windows, use `py` instead of `python` if you see a "Python was not found" error.
py -m uvicorn backend.main:app --host 127.0.0.1 --port 8000
2. Run the Frontend (Terminal 2)
Navigate to the frontend/ directory and spin up a lightweight Python HTTP server on port 3000:
cd frontend
py -m http.server 3000
3. Test the App
Navigate to http://localhost:3000 in your web browser. Type a topic (e.g., "Latest breakthroughs in Quantum Computing") and hit Research. Keep an eye on the live event log as the agents collaborate!