Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Router Agent - Multi-Agent AI System

A sophisticated multi-agent AI system that processes and routes different types of input (JSON, Email) to specialized agents for intelligent processing and analysis.

Overview

This system implements a multi-agent architecture that can:

  • Accept input in various formats (JSON, Email)
  • Classify the format and intent
  • Route to specialized agents for processing
  • Maintain shared context and traceability

Input Format Requirements

The system currently accepts two types of text-based inputs:

  1. JSON Input

    • Must be valid JSON format
    • Should follow the target schema structure
    • Example: {"name": "John", "age": 30, "email": "john@example.com"}
  2. Email Input

    • Must be plain text email content
    • Should include standard email headers (From, Subject, etc.)
    • Example:
      From: sender@example.com
      Subject: Meeting Request
      Date: 2024-03-20
      
      Hello, I would like to schedule a meeting...
      

Note: The system does not currently support PDF or other file formats. All input must be provided as text in either JSON or email format.

Architecture

The system consists of three main components:

1. Classifier Agent

  • Acts as the central router
  • Classifies input format (JSON/Email)
  • Determines intent (Invoice, RFQ, Complaint, etc.)
  • Routes to appropriate specialized agent
  • Maintains format and intent logs

2. JSON Agent

  • Processes structured JSON payloads
  • Validates against target schema
  • Reformats data as needed
  • Flags anomalies and missing fields

3. Email Agent

  • Processes email content
  • Extracts key information:
    • Sender details
    • Subject
    • Intent
    • Urgency level
    • Sentiment
    • Response requirements
  • Formats output for CRM integration

Data Storage Schema

The system uses SQLite to store all agent interactions and messages. Below is the database schema:

Database Schema

The database stores:

  • Agent interactions
  • Message history
  • Processing results
  • Timestamps and metadata

Example Inputs and Outputs

JSON Processing Example

JSON Example

Email Processing Example

Email Example

Technical Implementation

Tech Stack

  • Python
  • LangChain
  • Google Gemini AI
  • SQLite for message storage
  • Streamlit for web interface

Key Features

  • Real-time message processing
  • Persistent storage of agent interactions
  • Structured data validation
  • Intelligent email analysis
  • Web-based interface

Setup and Installation

  1. Clone the repository
  2. Install dependencies:
pip install -r requirements.txt
  1. Set up environment variables:
export GOOGLE_API_KEY="your_gemini_api_key"
  1. Run the application:
streamlit run main.py

Usage

  1. Access the web interface at http://localhost:8501
  2. Enter your input in the text field
  3. The system will automatically:
    • Classify the input
    • Route to appropriate agent
    • Process and return results
    • Store interaction history

Data Storage

The system uses SQLite to store:

  • Agent interactions
  • Message history
  • Processing results
  • Timestamps and metadata

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages