Skip to content

alphatechlogics/Multi-Agent-AI-Assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

15 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– Multi-Agent AI Assistant with Supervisor Orchestration

A powerful multi-modal AI assistant powered by Supervisor Agent Architecture, specialized domain agents, and advanced tools for research, finance, travel, shopping, jobs, and recipes.

๐ŸŒŸ Evolution: From Single Agent to Multi-Agent System

Previously: Basic mem0 + Anam avatar with single LLM

Now: Full supervisor-orchestrated multi-agent system with:

  • โœ… Specialized agents for 6 different domains
  • โœ… Intelligent routing based on user intent
  • โœ… Parallel processing capabilities
  • โœ… Long-term memory with Mem0
  • โœ… Multi-modal interactions (text)

๐Ÿ“Š Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Streamlit Frontend                    โ”‚
โ”‚                       (Text / voice)                     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                   โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                 FastAPI Backend                          โ”‚
โ”‚         /multi-agent/stream Endpoint                     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                   โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚           SUPERVISOR AGENT (LangGraph)                   โ”‚
โ”‚   โ€ข Intent Classification                                โ”‚
โ”‚   โ€ข Domain Routing                                       โ”‚
โ”‚   โ€ข Context Management                                   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                   โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚              โ”‚              โ”‚            โ”‚
    โ–ผ              โ–ผ              โ–ผ            โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚Researchโ”‚   โ”‚ Finance  โ”‚   โ”‚Travel  โ”‚   โ”‚Shopping โ”‚
โ”‚ Agent  โ”‚   โ”‚  Agent   โ”‚   โ”‚ Agent  โ”‚   โ”‚ Agent   โ”‚
โ””โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚
โ”Œโ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Jobs  โ”‚   โ”‚ Recipes  โ”‚
โ”‚ Agent  โ”‚   โ”‚  Agent   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

        โ”‚
        โ”œโ”€ Tools & Services โ”€โ”
        โ”‚                    โ”‚
    โ”Œโ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚  SerpApi  โ”‚  Mem0 โ”‚ ChromaDB โ”‚ Groq  โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚
    โ”Œโ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚  External APIs & Knowledge Bases      โ”‚
    โ”‚  โ€ข Google Search/Jobs/Flights/Recipes โ”‚
    โ”‚  โ€ข Zep Knowledge Graph                โ”‚
    โ”‚  โ€ข Vector Database                    โ”‚
    โ”‚  โ€ข LLM Providers                      โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐ŸŽฏ Specialized Agents

Agent Purpose Tools
๐Ÿ” Research Web research, articles, information gathering News search, ChromaDB RAG, document retrieval
๐Ÿ’ฐ Finance Financial info, stocks, investment advice Financial news, market data, guidance
โœˆ๏ธ Travel Flights, hotels, trip planning Flight search, hotel booking, guides
๐Ÿ›๏ธ Shopping Product recommendations Product search, price comparison
๐Ÿ’ผ Jobs Job search, career advice Google Jobs, resume tips, guidance
๐Ÿ‘จ๐Ÿณ Recipes Recipe discovery with ratings Recipe search, ingredients, cooking tips

๐Ÿš€ Key Features

Multi-Modal Interactions

  • ๐Ÿ—ฃ๏ธ Unified Voice & Chat - Semantic voice interaction with auto-summarization
  • ๐Ÿ“ Smart Summaries - Tabbed view with concise spoken summaries and full detail
  • ๐ŸŽฅ AI Video Avatar - Anam AI integration (demo mode available)

Advanced Capabilities

  • ๐Ÿง  Long-term Memory - Mem0 integration (never forgets)
  • ๐Ÿ“š Retrieval-Augmented Generation - ChromaDB + Groq for multi-PDF context
  • ๐Ÿ”— Knowledge Graph - Zep Cloud for structured entity relationships
  • โšก Parallel Processing - Concurrent agent execution
  • ๐Ÿค– Intelligent Routing - Automatic domain classification

Tech Stack

Component Technology
Agent Orchestration LangGraph with Supervisor pattern
LLM Groq (Llama 3.1 / Mixtral)
Memory Mem0 (persistent, never forgets)
Vector DB ChromaDB for RAG
Web Tools SerpApi for search/jobs/flights/recipes
Knowledge Graph Zep Cloud
Backend FastAPI with streaming
Frontend Streamlit
AI Avatar Anam AI (optional)

๐Ÿ“ฆ Installation

Prerequisites

  • Python 3.12+
  • UV package manager

Install Dependencies

uv sync

Configure Environment

Copy .env.example to .env and fill in your API keys:

cp .env.example .env

Required API Keys:

๐ŸŽฎ Running the Application

1. Ingest Data (Optional)

Populate the knowledge graph with your data:

python scripts/ingest_to_graph.py

2. Start Backend Server

uvicorn backend:app --port 8000 --reload

3. Start Frontend (in separate terminal)

Option A: Multi-Modal Frontend (Recommended)

streamlit run app_v2.py

4. Access the Application

๐Ÿ“ก API Endpoints

Session Management

POST /mem0/session
- Create user session in Mem0

Request:
{
  "user_id": "demo-user",
  "first_name": "John",
  "last_name": "Doe",
  "email": "john@example.com"
}

Intelligent Routing

POST /route
- Get supervisor routing decision

Request:
{
  "user_id": "demo-user",
  "session_id": "session-demo-user",
  "message": "Find me a job as a data scientist",
  "conversation_history": [...]
}

Response:
{
  "recommended_agent": "jobs",
  "classified_domain": "jobs",
  "context": {...}
}

Multi-Agent Streaming

POST /multi-agent/stream
- Stream response from appropriate specialized agent

Request:
{
  "user_id": "demo-user",
  "session_id": "session-demo-user",
  "message": "Show me flights to NYC",
  "mode": "text",
  "conversation_history": [...]
}

Returns: Server-Sent Events (SSE) stream

Health Check

GET /health
GET /agents
GET /zep/test-graph?q=<query>

๐Ÿง  How Agent Routing Works

  1. User sends message โ†’ "Find me a data scientist job"
  2. Supervisor Agent analyzes intent using LLM
  3. Domain Classification โ†’ "jobs" domain detected
  4. Route to Specialist โ†’ Jobs Agent selected
  5. Execute Tools โ†’ SerpApi Google Jobs search
  6. Generate Response โ†’ Jobs agent streams response
  7. Save Memory โ†’ Store in Mem0 + Zep for future context

๐Ÿ’พ Memory Management

Mem0 Integration

  • Persistent Memory: Survives across sessions
  • Semantic Search: Find relevant past interactions
  • User Profile: Build understanding of preferences

Zep Cloud Integration

  • Thread Memory: Conversation history
  • Knowledge Graph: Entity relationships
  • User Context: Automatic context extraction

Example memory usage:

# Add memory
await mem0_service.add_memory(
    user_id="demo-user",
    message="Interested in Python data science roles",
    metadata={"domain": "jobs", "query": "data scientist"}
)

# Retrieve memories
memories = await mem0_service.retrieve_memories(
    user_id="demo-user",
    query="jobs I'm interested in"
)

๐Ÿ“š Multi-Modal Interaction Examples

Text Chat

User: "What are the best flights to Tokyo?"
โ†’ Routed to Travel Agent
โ†’ Uses SerpApi flight search
โ†’ Returns options with prices

๐Ÿ” Example: Research Agent

# User query
"What are the latest developments in quantum computing?"

# Supervisor routes to Research Agent
# Research Agent:
# 1. Searches recent news via SerpApi
# 2. Queries ChromaDB for relevant documents
# 3. Uses Groq LLM for RAG synthesis
# 4. Streams response to user

# Example response flow:
news_results = await serpapi_service.search_news(
    "quantum computing latest", num_results=5
)

doc_results = await chromadb_service.query_documents(
    "quantum computing breakthroughs"
)

response = await chromadb_service.generate_rag_response(
    query="quantum computing developments",
    context_documents=doc_results
)

๐Ÿ“– Learn More

๐Ÿค Contributing

Contributions welcome! Feel free to:

  • Add new specialized agents for other domains
  • Improve routing logic
  • Add new tools/integrations
  • Enhance memory management
  • Submit pull requests

๐Ÿ“œ License

This project is open source. See LICENSE for details.

๐ŸŽ“ Learning Resources

Multi-Agent Systems:

  • Agent design patterns
  • Supervisor/hierarchical architectures
  • Tool selection and execution
  • Memory management strategies

Our Stack:

  • LangGraph for orchestration
  • Specialized agent patterns
  • RAG implementation

Built with โค๏ธ using LangGraph, Anam AI, and modern AI tools

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages