Skip to content

hoomanesteki/omniagent-multi-agent-analytics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

35 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

๐Ÿค– OmniAgent: Multi-Agent Data Analysis Assistant

Python Streamlit License Tests Docker

Imagine being able to talk to your data like a teammate. OmniAgent is an AI-powered, multi-agent assistant that lets you ask questions in plain English and instantly get meaningful insights, visualizations, and predictions. No coding, no wrestling with dashboards, just clear answers when you need them.

Most people spend too much time cleaning data, figuring out tools, and trying to extract insights manually. OmniAgent removes that friction by understanding your intent and automatically using the right specialized agents to do the work for you, turning complex data analysis into a simple, conversational experience.


๐Ÿ“‘ Table of Contents


โœจ Features

Feature Description
๐Ÿ—ฃ๏ธ Natural Language Ask questions in plain English
๐ŸŽค Voice Input Speak your questions using browser microphone
๐Ÿค– 7 Specialized Agents Stats, Viz, Aggregate, Predict, SQL, Dynamic, Voice
๐Ÿ”ฎ AI Code Generation Dynamic Agent creates custom analysis on-the-fly
๐Ÿ“Š Interactive Charts Beautiful Plotly visualizations
๐Ÿง  Smart Routing Automatically finds the right agent for your query
๐Ÿ”’ Secure Execution Sandboxed code execution with 40+ security checks
๐ŸŽฏ ML Models Build predictive models with one command
๐Ÿณ Docker Ready One-command deployment with Docker

๐Ÿ—๏ธ System Architecture

High-Level Overview

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                              USER INTERFACE                                  โ”‚
โ”‚                          (Streamlit Web App)                                 โ”‚
โ”‚                                                                              โ”‚
โ”‚    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                  โ”‚
โ”‚    โ”‚  Text Input  โ”‚    โ”‚ Voice Input  โ”‚    โ”‚  Suggestions โ”‚                  โ”‚
โ”‚    โ”‚   (Chat)     โ”‚    โ”‚ (Microphone) โ”‚    โ”‚  (Buttons)   โ”‚                  โ”‚
โ”‚    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                  โ”‚
โ”‚           โ”‚                   โ”‚                   โ”‚                          โ”‚
โ”‚           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                          โ”‚
โ”‚                               โ–ผ                                              โ”‚
โ”‚    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚    โ”‚                      ๐Ÿง  MASTER AGENT                                โ”‚   โ”‚
โ”‚    โ”‚                                                                     โ”‚   โ”‚
โ”‚    โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚   โ”‚
โ”‚    โ”‚  โ”‚   Intent    โ”‚โ”€โ”€โ–ถโ”‚   Router    โ”‚โ”€โ”€โ–ถโ”‚  MCP Message Bus        โ”‚    โ”‚   โ”‚
โ”‚    โ”‚  โ”‚  Detection  โ”‚   โ”‚   Logic     โ”‚   โ”‚  (Agent Communication)  โ”‚    โ”‚   โ”‚
โ”‚    โ”‚  โ”‚ (200+ rules)โ”‚   โ”‚             โ”‚   โ”‚                         โ”‚    โ”‚   โ”‚
โ”‚    โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚   โ”‚
โ”‚    โ”‚                                                   โ”‚                 โ”‚   โ”‚
โ”‚    โ”‚           Check: Is Dynamic Agent pending? โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”ค                 โ”‚   โ”‚
โ”‚    โ”‚                         โ”‚                         โ”‚                 โ”‚   โ”‚
โ”‚    โ”‚                    YES  โ”‚  NO                     โ”‚                 โ”‚   โ”‚
โ”‚    โ”‚                         โ–ผ                         โ–ผ                 โ”‚   โ”‚
โ”‚    โ”‚              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”           โ”‚   โ”‚
โ”‚    โ”‚              โ”‚ Route to Dynamicโ”‚      โ”‚ Route by Intent โ”‚           โ”‚   โ”‚
โ”‚    โ”‚              โ”‚  (Confirmation) โ”‚      โ”‚ (stats/viz/etc) โ”‚           โ”‚   โ”‚
โ”‚    โ”‚              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜           โ”‚   โ”‚
โ”‚    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚                                    โ”‚                                         โ”‚
โ”‚    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚    โ”‚                               โ–ผ                                     โ”‚   โ”‚
โ”‚    โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚   โ”‚
โ”‚    โ”‚  โ”‚   ๐Ÿ“Š   โ”‚ โ”‚   ๐Ÿ“ˆ    โ”‚ โ”‚   ๐Ÿ“ฆ   โ”‚ โ”‚   ๐Ÿค–   โ”‚ โ”‚   ๐Ÿ”    โ”‚ โ”‚   ๐Ÿ”ฎ   โ”‚  โ”‚   โ”‚
โ”‚    โ”‚  โ”‚ Stats  โ”‚ โ”‚  Viz   โ”‚ โ”‚  Agg   โ”‚ โ”‚ Predictโ”‚ โ”‚  SQL   โ”‚ โ”‚Dynamic โ”‚  โ”‚   โ”‚
โ”‚    โ”‚  โ”‚ Agent  โ”‚ โ”‚ Agent  โ”‚ โ”‚ Agent  โ”‚ โ”‚ Agent  โ”‚ โ”‚ Agent  โ”‚ โ”‚ Agent  โ”‚  โ”‚   โ”‚
โ”‚    โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚   โ”‚
โ”‚    โ”‚                                                                     โ”‚   โ”‚
โ”‚    โ”‚                          SPECIALIZED AGENTS                         โ”‚   โ”‚
โ”‚    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚                                    โ”‚                                         โ”‚
โ”‚                                    โ–ผ                                         โ”‚
โ”‚    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚    โ”‚                        RESPONSE BUILDER                             โ”‚   โ”‚
โ”‚    โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚   โ”‚
โ”‚    โ”‚   โ”‚   Content   โ”‚  โ”‚   Insights  โ”‚  โ”‚ Suggestions โ”‚  โ”‚  Figures  โ”‚  โ”‚   โ”‚
โ”‚    โ”‚   โ”‚  (Markdown) โ”‚  โ”‚   (Tips)    โ”‚  โ”‚  (Buttons)  โ”‚  โ”‚  (Plotly) โ”‚  โ”‚   โ”‚
โ”‚    โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚   โ”‚
โ”‚    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Message Communication Protocol (MCP)

Agents communicate using standardized MCP messages:

MCPMessage(
    id: str,           # Unique message identifier
    type: MessageType, # QUERY, RESPONSE, ERROR, EVENT
    source: str,       # Sending agent name
    target: str,       # Receiving agent name
    content: str,      # Message content
    data: dict,        # Additional payload
    metadata: dict     # Timestamps, context
)

Data Flow

User Query โ†’ Master Agent โ†’ Intent Detection โ†’ Route to Agent โ†’ Process โ†’ Response
     โ”‚                                              โ”‚
     โ”‚                                              โ–ผ
     โ”‚                                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
     โ”‚                                    โ”‚ If Dynamic:     โ”‚
     โ”‚                                    โ”‚ 1. Offer        โ”‚
     โ”‚                                    โ”‚ 2. Plan (LLM)   โ”‚
     โ”‚                                    โ”‚ 3. Execute      โ”‚
     โ”‚                                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
     โ”‚                                              โ”‚
     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ—„โ”€โ”˜

๐Ÿ“ฆ Installation

Prerequisites

  • Python 3.8 or higher
  • pip (Python package manager)
  • Modern web browser (Chrome/Edge recommended for voice features)

Option 1: pip Install

# Clone the repository
git clone https://github.com/hoomanesteki/omniagent.git
cd omniagent

# Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Run the application
streamlit run app.py

Option 2: Conda Install

# Clone the repository
git clone https://github.com/hoomanesteki/omniagent.git
cd omniagent

# Create conda environment
conda env create -f environment.yml

# Activate environment
conda activate omniagent

# Run the application
streamlit run app.py

Option 3: Using Make

make install      # Install dependencies
make run          # Run the application
make test         # Run all tests

๐Ÿณ Docker Deployment

Quick Start with Docker

# Build the image
docker build -t omniagent .

# Run the container
docker run -p 8501:8501 omniagent

# With API key for AI features
docker run -p 8501:8501 -e GROQ_API_KEY=your_key omniagent

Using Docker Compose (Recommended)

# Create .env file with your API key (optional)
echo "GROQ_API_KEY=your_key_here" > .env

# Start the service
docker-compose up -d

# View logs
docker-compose logs -f

# Stop the service
docker-compose down

Docker Commands Reference

Command Description
docker-compose up -d Start in background
docker-compose up -d --build Rebuild and start
docker-compose down Stop and remove containers
docker-compose logs -f Follow logs
docker-compose restart Restart the service

Persistent Data

Mount a volume to persist uploaded data:

docker run -p 8501:8501 -v $(pwd)/data:/app/data omniagent

๐Ÿš€ Quick Start

  1. Load Data: Upload a CSV file or select a sample dataset from the sidebar
  2. Ask Questions: Type naturally like "What's the average age?" or "Show histogram of price"
  3. Get Insights: View visualizations, statistics, and AI-powered analysis

Example Queries

Query Agent Result
"Show statistics" ๐Ÿ“Š Stats Descriptive statistics
"Histogram of age" ๐Ÿ“ˆ Viz Interactive histogram
"Count by gender" ๐Ÿ“ฆ Aggregate Grouped counts
"Predict salary" ๐Ÿค– Predict ML model
"Show first 10 rows" ๐Ÿ” SQL Data preview
"Calculate rolling average" ๐Ÿ”ฎ Dynamic Custom analysis
"Calculate z-scores" ๐Ÿ”ฎ Dynamic Z-score normalization

๐Ÿค– Agents

Agent Overview

Agent Emoji Purpose Example Commands
Master ๐Ÿง  Query routing & orchestration (Internal)
Stats ๐Ÿ“Š Statistical analysis "mean of price", "check missing"
Viz ๐Ÿ“ˆ Visualizations "histogram", "scatter plot", "heatmap"
Aggregate ๐Ÿ“ฆ GroupBy operations "count by", "sum by", "average by"
Predict ๐Ÿค– Machine learning "predict", "build model"
SQL ๐Ÿ” Data exploration "show rows", "columns", "sample"
Dynamic ๐Ÿ”ฎ AI code generation "rolling average", "find outliers", "z-scores"
Voice ๐ŸŽค Speech recognition (Microphone input)

๐Ÿ”ฎ Dynamic Agent (AI-Powered)

The Dynamic Agent handles requests beyond built-in capabilities by generating and executing custom Python code.

Three-Step Confirmation Flow

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                         DYNAMIC AGENT FLOW                              โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                         โ”‚
โ”‚  STEP 1: OFFER (No LLM call - saves resources)                          โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚ User: "Calculate rolling average of sales"                      โ”‚    โ”‚
โ”‚  โ”‚                                                                 โ”‚    โ”‚
โ”‚  โ”‚ Agent: "I can create a Rolling/Moving Average analysis.         โ”‚    โ”‚
โ”‚  โ”‚         This requires AI. Type 'yes' to proceed or 'no'."       โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                              โ”‚                                          โ”‚
โ”‚                     User types "yes"                                    โ”‚
โ”‚                              โ–ผ                                          โ”‚
โ”‚  STEP 2: PLAN (LLM generates code)                                      โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚ Agent: "Here's my plan:                                         โ”‚    โ”‚
โ”‚  โ”‚                                                                 โ”‚    โ”‚
โ”‚  โ”‚ ```python                                                       โ”‚    โ”‚
โ”‚  โ”‚ result = df['sales'].rolling(window=7).mean()                   โ”‚    โ”‚
โ”‚  โ”‚ ```                                                             โ”‚    โ”‚
โ”‚  โ”‚                                                                 โ”‚    โ”‚
โ”‚  โ”‚ Type 'yes' to execute or 'no' to cancel."                       โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                              โ”‚                                          โ”‚
โ”‚                     User types "yes"                                    โ”‚
โ”‚                              โ–ผ                                          โ”‚
โ”‚  STEP 3: EXECUTE (Sandboxed execution)                                  โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚ Agent: "โœ… Analysis Complete!                                   โ”‚    โ”‚
โ”‚  โ”‚         [Shows results and visualization]"                      โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                                                                         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Supported Analysis Types

Type Keywords Example
Rolling/Moving Average "rolling", "moving average", "window" "7-day rolling average"
Outlier Detection "outlier", "anomaly", "IQR" "Find outliers using IQR"
Z-Score/Standardization "z-score", "normalize", "standardize" "Calculate z-scores"
Regression Analysis "regression", "trendline" "Scatter with regression line"
Data Binning "bin", "categorize", "bucket" "Bin age into groups"
Ranking "top", "bottom", "rank" "Top 10 by sales"
Custom Any other request "Cumulative sum by date"

Enabling Dynamic Agent

  1. Enable AI Mode in the sidebar
  2. Enter your Groq API Key (free at console.groq.com)
  3. Click Validate & Save
  4. Ask any complex question!

๐ŸŽค Voice Assistant

OmniAgent supports voice input through your browser's built-in speech recognition.

โš ๏ธ Note: Voice is speech-to-text only (you speak, agent responds with text).

Requirements

Requirement Details
Browser Chrome, Edge, or Safari (Firefox limited)
Microphone Built-in or external
Permission Must allow browser microphone access
HTTPS Required (localhost works for development)

How to Enable Voice

  1. Toggle Enable Voice in the sidebar
  2. Click "๐ŸŽค Start Speaking" button
  3. Allow microphone access when browser prompts
  4. Speak your question clearly
  5. Query is automatically submitted

Browser Microphone Setup

Chrome:

  1. Click ๐Ÿ”’ lock icon in address bar
  2. Find "Microphone" โ†’ Select "Allow"

Edge:

  1. Click ๐Ÿ”’ lock icon in address bar
  2. Click "Permissions for this site"
  3. Set Microphone to "Allow"

Safari:

  1. Safari โ†’ Preferences โ†’ Websites โ†’ Microphone
  2. Allow for the OmniAgent site

Troubleshooting Voice

Issue Solution
Microphone not working Check browser permissions
No transcription Speak clearly, reduce background noise
"Permission denied" Reset site permissions and allow again

๐Ÿ“ Project Structure

omniagent/
โ”‚
โ”œโ”€โ”€ ๐Ÿ“„ app.py                    # Main Streamlit entry point
โ”œโ”€โ”€ ๐Ÿ“„ requirements.txt          # Python dependencies
โ”œโ”€โ”€ ๐Ÿ“„ requirements-dev.txt      # Development dependencies
โ”œโ”€โ”€ ๐Ÿ“„ environment.yml           # Conda environment
โ”œโ”€โ”€ ๐Ÿ“„ Makefile                  # Build automation (40+ commands)
โ”œโ”€โ”€ ๐Ÿ“„ Dockerfile                # Docker image
โ”œโ”€โ”€ ๐Ÿ“„ docker-compose.yml        # Docker Compose config
โ”œโ”€โ”€ ๐Ÿ“„ pytest.ini                # Test configuration
โ”œโ”€โ”€ ๐Ÿ“„ README.md                 # This file
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ core/                     # Core utilities
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ config.py                # Configuration & settings
โ”‚   โ”œโ”€โ”€ analyzer.py              # DataAnalyzer class
โ”‚   โ””โ”€โ”€ llm.py                   # LLM client (Groq API)
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ agents/                   # Specialized agents
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ base.py                  # BaseAgent abstract class
โ”‚   โ”œโ”€โ”€ master_agent.py          # ๐Ÿง  Orchestrator
โ”‚   โ”œโ”€โ”€ stats_agent.py           # ๐Ÿ“Š Statistics
โ”‚   โ”œโ”€โ”€ viz_agent.py             # ๐Ÿ“ˆ Visualization
โ”‚   โ”œโ”€โ”€ aggregate_agent.py       # ๐Ÿ“ฆ GroupBy
โ”‚   โ”œโ”€โ”€ predict_agent.py         # ๐Ÿค– ML prediction
โ”‚   โ”œโ”€โ”€ sql_agent.py             # ๐Ÿ” Data exploration
โ”‚   โ”œโ”€โ”€ dynamic_agent.py         # ๐Ÿ”ฎ AI code generation
โ”‚   โ””โ”€โ”€ voice_agent.py           # ๐ŸŽค Voice input
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ mcp/                      # Message Communication Protocol
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ””โ”€โ”€ protocol.py              # MCPMessage, MCPBus
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ ui/                       # User interface
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ components.py            # Session, messages
โ”‚   โ”œโ”€โ”€ sidebar.py               # Sidebar UI
โ”‚   โ””โ”€โ”€ chat.py                  # Chat interface
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ tests/                    # Test suite (195 tests)
โ”‚   โ”œโ”€โ”€ conftest.py              # Shared fixtures
โ”‚   โ”œโ”€โ”€ unit/                    # Unit tests
โ”‚   โ””โ”€โ”€ integration/             # Integration tests
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ data/                     # Data files
โ”‚   โ”œโ”€โ”€ samples/                 # Sample datasets
โ”‚   โ””โ”€โ”€ uploads/                 # User uploads
โ”‚
โ””โ”€โ”€ ๐Ÿ“‚ docs/                     # Documentation
    โ”œโ”€โ”€ A_API_REFERENCE.md
    โ”œโ”€โ”€ B_MCP_PROTOCOL.md
    โ”œโ”€โ”€ C_TESTING.md
    โ”œโ”€โ”€ D_SECURITY.md
    โ””โ”€โ”€ E_DEPLOYMENT.md

๐Ÿงช Testing

Running Tests

# Run all tests
make test

# Run specific test suites
make test-unit          # Unit tests only
make test-integration   # Integration tests
make test-security      # Security tests

# Run with coverage
make coverage

# Run specific test file
pytest tests/unit/test_agents.py -v

Test Coverage

Module Tests Coverage
Core 20+ Config, DataAnalyzer, LLMClient
Agents 50+ All 7 agents, routing
MCP Protocol 25+ Messages, bus
Security 40+ Code safety, patterns
UI 30+ Help, about, messages
Integration 20+ End-to-end flows

๐Ÿ”’ Security

Dynamic Agent Security

The Dynamic Agent executes AI-generated code in a sandboxed environment with 40+ blocked patterns:

Category Blocked Patterns
System Access import os, import sys, subprocess
Code Injection eval(), exec(), compile()
File Operations open(), .read(), .write()
Network requests., urllib, socket
Reflection globals(), locals(), getattr()
Dangerous Dunders __builtins__, __class__

Security Flow

Generated Code โ†’ Length Check โ†’ Pattern Check โ†’ Sandboxed Execution
                     โ†“              โ†“
                 Too long?      Dangerous?
                     โ†“              โ†“
                  REJECT         REJECT

โš™๏ธ Configuration

Environment Variables

Create a .env file:

# Groq API (for Dynamic Agent)
GROQ_API_KEY=your_api_key_here

# LLM Settings (optional)
LLM_MODEL=llama-3.3-70b-versatile

Configuration Options

Setting Default Description
PAGE_TITLE "๐Ÿค– OmniAgent" Browser tab title
LLM_MODEL "llama-3.3-70b-versatile" Groq model
LLM_MAX_TOKENS 2000 Max response tokens
MAX_SUGGESTIONS 12 Suggestion buttons

๐Ÿ”ง Troubleshooting

Common Issues

Issue Solution
"No module named 'streamlit'" Run pip install -r requirements.txt
Port 8501 in use Use streamlit run app.py --server.port=8502
Voice not working Use Chrome/Edge, allow microphone
Dynamic Agent fails Check Groq API key is valid
Docker build fails Ensure Docker daemon is running

Getting Help

  • Check the docs/ folder for detailed documentation
  • Open an issue on GitHub
  • Type "help" in OmniAgent chat

๐Ÿ“„ License

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


๐Ÿ‘จโ€๐Ÿ’ป Author

Hooman Esteki


๐Ÿ™ Acknowledgments


Made with โค๏ธ by Hooman Esteki

About

OmniAgent is an AI-powered conversational data assistant with a multi-agent architecture. It automatically routes your questions to the right agent to generate insights, visualizations, aggregations, predictions, and SQL-style exploration, making data analysis fast, intuitive, and interactive.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors