Skip to content

Sharkyii/Multi-Agent

Repository files navigation

🤖 Multi-Agent AI System A high-performance, LangGraph-powered AI system with a Gradio front-end for evaluating multi-agent interactions across documents such as PDFs, Emails, and JSON. It uses intelligent input classification, specialized LLM agents, and a shared memory store—designed for scalable enterprise deployment.

🚀 Project Highlights ⚙️ LangGraph Multi-Agent Orchestration

🤝 Tool-Equipped Agents with shared context

📎 Input-Aware Routing: Email, PDF, JSON-specific logic

🧠 Cohere LLM for semantic extraction and intent recognition

💾 SQLite Context Memory with async and TTL support

🌐 Gradio Interface for testing and live interaction

🐳 Dockerized for consistent deployment

🧩 Agent Architecture mermaid Copy Edit graph TD A[User Input] --> B[Classifier Agent] B --> |PDF| C[PDF Agent] B --> |Email| D[Email Agent] B --> |JSON| E[JSON Agent] C --> F[Shared SQLite Memory] D --> F E --> F G --> H[Gradio Interface] ✨ Features Feature Description 🧭 LangGraph Routing Dynamically controls agent execution paths 📄 PDF Agent Extracts text with pdfplumber or OCR fallback ✉️ Email Agent Parses MIME emails, extracts metadata, analyzes urgency 📊 JSON Agent Validates schema, standardizes data 🔍 Evaluator Agent Automatically scores responses using Cohere 🧠 Redis Memory Shared context store with TTL 📈 Gradio UI Live, interactive testing 🛠️ Tool Integration Agents invoke external tools as needed

🛠️ Tech Stack 🧠 LLM: Cohere

🧭 Framework: LangGraph

⚡ Optional Backend: FastAPI

💾 Memory: SQLite

🐳 Deployment: Docker + Docker Compose

🧪 Testing: Pytest

⚡ Quickstart 🔋 Requirements Python 3.10+

Docker + Docker Compose

SQLite

Redis

Cohere API Key

🧪 Run Locally bash Copy Edit git clone https://github.com/S-n-e-h/Multi-Agent cd Multi-Agent

Set environment

cp .env.example .env

Fill in COHERE_API_KEY and REDIS_URL in .env

Install dependencies

pip install -r requirements.txt

Start the app

python app.py 🐳 Docker Setup (Recommended) bash Copy Edit docker-compose up --build 🧠 Core Agents 🧭 Classifier Agent Detects input type (PDF, Email, JSON)

Uses Cohere to extract business intent (e.g., Invoice, Complaint)

Routes to appropriate agent

Example: Input: email.eml Output: Routed to Email Agent with intent: Complaint

📄 PDF Agent Text extraction using pdfplumber or OCR

Extracts fields like invoice number, date, amount

Calls LLM for contract analysis

Example: PDF: Invoice-2024.pdf Output: { "InvoiceNo": "INV-123", "Total": "$400", "Vendor": "Acme Corp" }

✉️ Email Agent Parses .eml files

Extracts sender, urgency, tone, and subject

Converts to structured CRM-ready format

Example: Email: "Your service was delayed!" Output: { "Urgency": "High", "Sentiment": "Negative", "Sender": "john@example.com" }

⚙️ JSON Agent Validates schema

Detects missing or malformed fields

Extracts actionable entities

Example: Input: { "order_id": 123, "amount": null } Output: "amount" is missing or invalid.

📊 Evaluator Node Feature Details 🎯 Purpose Validate agent-generated responses 🔄 Inputs User query, Ground truth, Agent response 📉 Outputs Score (0–1), Comment, Reason 🤖 Powered By Cohere or a fine-tuned evaluator model

Example:

Ground Truth: Order total is $400

Model Output: Invoice shows $450

Score: 0.6 – mismatch in value

📁 Folder Structure css Copy Edit Multi-Agent/ ├── agents/ │ ├── classifier_agent.py │ ├── pdf_agent.py │ ├── email_agent.py │ └── json_agent.py ├── memory/ │ └── memory_store.py ├── Screenchots/ ├── inputs/ │ └── Demo-input-files ├── utils/ │ └── pdf_loader.py ├── router/ │ └── action_router.py ├── app.py ├── docker-compose.yml ├── Dockerfile ├── *.db (SQLite files) └── .env.example 🔍 API Overview Endpoint Method Description /process POST Accepts file input for processing /evaluate POST Evaluate agent response /health GET Basic health check /contexts GET Lists saved memory contexts

🧠 Future Roadmap 🔄 Webhook-based Input Ingestion

📚 Vector DB Integration (Pinecone/Weaviate)

💬 Chat-style Conversational Chains

📊 LangSmith / OpenInference Support

📈 Feedback Loop for Continual Agent Improvement

📌 Example Use Case 🎯 Scenario: Email Complaint → CRM-ready Output Input: .eml file with subject: "Billing issue – incorrect charges"

Classifier Agent: → Type: Email | Intent: Complaint

Email Agent: → { "Urgency": "High", "Sentiment": "Negative", "CustomerName": "Jane Doe" }

Memory Store: → Stores complaint ID and context for follow-up

🙌 Contributions Pull requests and suggestions are welcome! For major changes, open an issue first to discuss what you’d like to change.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages