multi-agent-system-using-langgraph
This system helps teams tackle complex projects by coordinating multiple artificial intelligence agents. It automatically breaks down requests, like comparing two products or creating a detailed tutorial, and assigns them to specialized AI assistants. Businesses can use this to quickly generate high-quality content, such as market analyses or product comparisons, without needing to manually research and write everything. The system allows for human review and approval at each stage, ensuring accuracy and quality. It’s particularly useful for companies needing to produce a lot of informative material efficiently and reliably. What sets it apart is its ability to handle diverse tasks and its design for ongoing, real-world use.
README
# Multi-Agent System using LangGraph
A production-ready, general-purpose multi-agent system using LangGraph for orchestration, Redis for state management, Celery for asynchronous tasks, and FastAPI for the backend.
  
## Overview
This system allows **collaborative AI agents** to work together to solve complex tasks. Unlike simple chatbots, this framework orchestrates specialized agents—a **Research Agent** that gathers information and a **Writing Agent** that synthesizes it—to produce high-quality, comprehensive outputs for **any** user request.
**Key Capabilities:**
- **Dynamic Research**: Automatically identifies research topics from your prompt (e.g., "Compare X vs Y", "How to install Z").
- **Adaptive Writing**: intelligent template selection for Comparisons, Tutorials, Analyses, and Summaries.
- **Human-in-the-Loop**: Inspect and approve drafts before they are finalized.
- **Production Architecture**: Scalable, async design with persistent state and real-time updates.
## Architecture

See [ARCHITECTURE.md](ARCHITECTURE.md) for detailed diagrams and component breakdown.
## Quick Start
### Prerequisites
- Docker & Docker Compose
- API Key for Groq or OpenAI
### 1. Configure Environment
Copy the example file and add your API key:
```bash
cp .env.example .env
# Edit .env:
# LLM_API_KEY=your_key_here
```
### 2. Start Services
Launch the entire stack (API, DB, Redis, Worker):
```bash
docker-compose up -d
```
### 3. Create a Task
The system handles natural language prompts automatically:
**Comparison Task:**
```bash
curl -X POST http://localhost:8000/api/v1/tasks \
-H "Content-Type: application/json" \
-d '{"prompt": "Compare Redis vs PostgreSQL for caching"}'
```
**Tutorial Task:**
```bash
curl -X POST http://localhost:8000/api/v1/tasks \
-H "Content-Type: application/json" \
-d '{"prompt": "Create a beginner tutorial for Docker setup"}'
```
**Analysis Task:**
```bash
curl -X POST http://localhost:8000/api/v1/tasks \
-H "Content-Type: application/json" \
-d '{"prompt": "Analyze microservices vs monolithic architecture"}'
```
### 4. Monitor & Approve
Check task status and approve the draft:
```bash
# Get Status
curl http://localhost:8000/api/v1/tasks/{task_id}
# Approve
curl -X POST http://localhost:8000/api/v1/tasks/{task_id}/approve \
-H "Content-Type: application/json" \
-d '{"approved": true}'
```
## Technology Stack
| Component | Technology | Role |
|-----------|------------|------|
| **Orchestration** | **LangGraph** | Manages agent state and workflow structure |
| **API** | **FastAPI** | Async REST endpoints & WebSockets |
| **Queue** | **Celery** | Asynchronous task processing |
| **Database** | **PostgreSQL** | Persistent storage for tasks and results |
| **State/Cache** | **Redis** | High-speed agent workspace & broker |
| **LLM** | **LangChain** | LLM abstraction (OpenAI / Groq) |
## Testing
Run the end-to-end test suite to verify system health:
```bash
docker-compose exec api pytest tests/test_e2e.py -v
```
## License
MIT License.PUBLIC HISTORY
IDENTITY
Identity inferred from code signals. No PROVENANCE.yml found.
Is this yours? Claim it →METADATA
README BADGE
Add to your README:
