Skip to content

thedixitjain/Multi-Agent-AI-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– Multi-Agent AI System

Intelligent Data Analysis & Research Assistant Platform

A sophisticated multi-agent AI system that seamlessly processes both structured business data and unstructured research documents through natural language queries and intelligent agent orchestration.

Python FastAPI Streamlit Docker

🎯 Overview

This system addresses the common business challenge of analyzing both structured data (CSV/Excel files) and unstructured research documents (PDFs) through a single, intuitive interface. Instead of switching between different tools, users can ask natural language questions and get intelligent responses with automatic visualizations and insights.

Key Features

  • 🧠 Intelligent Query Routing: Automatically determines whether your question is about data or research
  • πŸ“Š Data Intelligence: Analyzes business data with natural language queries and auto-generated charts
  • πŸ“„ Research Assistant: Processes research papers with summarization, keyword extraction, and Q&A
  • πŸ’¬ Unified Chat Interface: Single interface for all types of queries
  • πŸ“ˆ Interactive Visualizations: Real-time charts and graphs based on your questions
  • πŸš€ Multiple Deployment Options: Local, Docker, and cloud deployment ready

πŸ—οΈ System Architecture

The system follows a multi-agent architecture pattern with three specialized AI agents coordinated by an intelligent orchestrator:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    USER INTERFACE (Streamlit)                   β”‚
β”‚                     Natural Language Queries                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  ORCHESTRATOR AGENT                            β”‚
β”‚              β€’ Query Classification                             β”‚
β”‚              β€’ Intent Recognition                               β”‚
β”‚              β€’ Agent Routing                                    β”‚
β”‚              β€’ Context Management                               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β”‚                                 β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   DATA INTELLIGENCE       β”‚     β”‚   RESEARCH ASSISTANT          β”‚
β”‚        AGENT               β”‚     β”‚         AGENT                 β”‚
β”‚                           β”‚     β”‚                               β”‚
β”‚ β€’ CSV/Excel Processing    β”‚     β”‚ β€’ PDF Text Extraction         β”‚
β”‚ β€’ Pandas Integration      β”‚     β”‚ β€’ Document Chunking           β”‚
β”‚ β€’ SQL Query Generation    β”‚     β”‚ β€’ Semantic Embeddings         β”‚
β”‚ β€’ Chart Generation        β”‚     β”‚ β€’ Vector Search (FAISS)       β”‚
β”‚ β€’ Statistical Analysis    β”‚     β”‚ β€’ Summarization               β”‚
β”‚                           β”‚     β”‚ β€’ Keyword Extraction          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β”‚                                 β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    BACKEND API (FastAPI)                        β”‚
β”‚               RESTful endpoints with OpenAPI docs               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Architecture Components

🎯 Orchestrator Agent

  • Purpose: Central coordinator that analyzes user queries and routes them to appropriate specialists
  • Technology: Custom classification algorithm with keyword analysis and context awareness
  • Intelligence: Handles query disambiguation and maintains conversation context

πŸ“Š Data Intelligence Agent

  • Purpose: Specializes in structured data analysis and business intelligence
  • Technology: Pandas for data processing, Plotly for visualizations, SQLite for storage
  • Capabilities: Aggregations, trend analysis, statistical computations, automatic chart generation

πŸ“„ Research Assistant Agent

  • Purpose: Handles unstructured document analysis and research tasks
  • Technology: PyMuPDF for PDF processing, Sentence Transformers for embeddings, FAISS for vector search
  • Capabilities: Document summarization, semantic search, keyword extraction, Q&A

🌐 Unified Interface

  • Frontend: Streamlit-based web application with chat interface
  • Backend: FastAPI REST API with automatic OpenAPI documentation
  • Communication: RESTful API endpoints with JSON data exchange

πŸš€ Quick Start

Option 1: Local Development

  1. Clone the repository

    git clone https://github.com/your-username/multi-agent-ai-system.git
    cd multi-agent-ai-system
  2. Install dependencies

    pip install -r requirements.txt
  3. Run the system

    python run.py
  4. Access the application

Option 2: Docker Deployment

  1. Build and run with Docker Compose

    docker-compose up --build
  2. Access the services

Option 3: Streamlit Cloud

  1. Deploy to Streamlit Cloud

πŸ“– How to Use

1. Upload Your Data

For Data Analysis:

  • Upload CSV or Excel files containing your business data
  • Supported formats: .csv, .xlsx, .xls
  • Examples: sales data, customer information, financial records

For Research Analysis:

  • Upload PDF research papers or documents
  • The system will automatically extract and process the text
  • Creates searchable embeddings for intelligent Q&A

2. Ask Natural Language Questions

Data Analysis Examples:

"What was the total revenue in Q2?"
"Show me the top 5 customers by sales"
"Plot monthly revenue trends"
"Which product category performs best?"
"Create a bar chart of sales by region"

Research Analysis Examples:

"Summarize this research paper"
"What methodology was used in the study?"
"Extract the key findings"
"What are the main challenges discussed?"
"Find information about machine learning approaches"

3. Get Intelligent Responses

The system automatically:

  • Routes your query to the appropriate agent
  • Processes the request using specialized algorithms
  • Generates visualizations, summaries, or answers
  • Presents results in an easy-to-understand format

πŸ“Š Sample Data

The repository includes sample datasets for testing:

  • sales_data.csv: 40 sales transactions with product, revenue, and regional data
  • customer_data.csv: 30 customer profiles with demographics and purchasing behavior
  • sample_research_paper.txt: Research paper on computer vision and deep learning

πŸ› οΈ Technology Stack

Backend

  • FastAPI: Modern, fast web framework for building APIs
  • Python 3.9+: Core programming language
  • Pandas: Data manipulation and analysis
  • SQLite: Lightweight database for data storage
  • Uvicorn: ASGI server for FastAPI

AI & Machine Learning

  • Sentence Transformers: Text embeddings for semantic search
  • FAISS: Vector similarity search for document retrieval
  • NLTK: Natural language processing toolkit
  • PyMuPDF: PDF text extraction and processing

Visualization

  • Plotly: Interactive charts and graphs
  • Matplotlib: Statistical plotting library
  • Seaborn: Statistical data visualization

Frontend

  • Streamlit: Interactive web application framework
  • HTML/CSS: Custom styling and responsive design

Deployment

  • Docker: Containerization for consistent deployment
  • Docker Compose: Multi-container orchestration

πŸ“ Project Structure

multi-agent-ai-system/
β”œβ”€β”€ backend/                 # FastAPI backend application
β”‚   β”œβ”€β”€ agents/             # AI agent implementations
β”‚   β”‚   β”œβ”€β”€ data_intelligence_agent.py
β”‚   β”‚   β”œβ”€β”€ research_assistant_agent.py
β”‚   β”‚   └── orchestrator_agent.py
β”‚   └── main.py            # FastAPI application entry point
β”‚
β”œβ”€β”€ frontend/              # Streamlit frontend application
β”‚   β”œβ”€β”€ app.py            # Full-featured app (with backend)
β”‚   └── app_standalone.py # Standalone app (for cloud deployment)
β”‚
β”œβ”€β”€ docker/               # Docker configuration
β”‚   β”œβ”€β”€ Dockerfile.backend
β”‚   └── Dockerfile.frontend
β”‚
β”œβ”€β”€ sample_data/         # Sample datasets for testing
β”‚   β”œβ”€β”€ sales_data.csv
β”‚   β”œβ”€β”€ customer_data.csv
β”‚   └── sample_research_paper.txt
β”‚
β”œβ”€β”€ .streamlit/          # Streamlit configuration
β”‚   └── config.toml
β”‚
β”œβ”€β”€ requirements.txt     # Python dependencies
β”œβ”€β”€ streamlit_requirements.txt  # Streamlit Cloud dependencies
β”œβ”€β”€ docker-compose.yml   # Container orchestration
β”œβ”€β”€ streamlit_app.py    # Cloud deployment entry point
└── run.py              # Local development launcher

πŸ”§ Configuration

Environment Variables (Optional)

Create a .env file for custom configuration:

# API Configuration
API_HOST=0.0.0.0
API_PORT=8000
STREAMLIT_PORT=8501

# Development
DEBUG=False
LOG_LEVEL=INFO

Customization

  • Agent Behavior: Modify agent parameters in respective Python files
  • UI Styling: Update CSS in the Streamlit app files
  • Data Processing: Extend the data intelligence agent for custom analysis
  • Document Processing: Enhance the research assistant for specific document types

🀝 Contributing

We welcome contributions! Here's how to get started:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • FastAPI: For the excellent modern web framework
  • Streamlit: For making web app development incredibly simple
  • Sentence Transformers: For powerful text embeddings
  • Plotly: For beautiful interactive visualizations
  • The Open Source Community: For the amazing tools and libraries

πŸ“ž Support

If you encounter any issues or have questions:

  1. Check the existing Issues
  2. Create a new issue with detailed information
  3. Include steps to reproduce any problems

Built with ❀️ for intelligent data analysis and research assistance

Transform your data analysis workflow with the power of AI agents working together seamlessly.

About

Multi-agent AI system for automated business intelligence - processes CSV/Excel data and PDF research documents with smart query orchestration

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages