An autonomous AI agent crew that transforms raw database metrics into a comprehensive, multimodal business report—complete with data visualizations, external market research, and executive synthesis—in under 60 seconds.
The system utilizes a sequential multi-agent orchestration pipeline. It is governed by a custom-engineered LLMFailoverRouter that prioritizes extreme execution speed while guaranteeing high availability.
flowchart TD
subgraph DataLayer ["Data Layer"]
DB[("DuckDB\nSales Data")]
end
subgraph FailoverRouter ["LLM Failover Router"]
Router{"API Gateway"}
Groq["Groq Llama 3\nPrimary - Fast"]
Gem["Google Gemini\nFallback - Smart"]
Router -->|"Success"| Groq
Router -->|"Rate Limited / 429"| Gem
end
subgraph CrewAI ["CrewAI Orchestration"]
A1["Data Analyst Agent"]
A2["Market Researcher Agent"]
A3["Reporting Analyst Agent"]
DB -->|"SQL Tools"| A1
A1 -->|"Chart + Summary"| A2
A2 -->|"Web Search Tools"| A3
end
Router -.->|"Powers"| A1
Router -.->|"Powers"| A2
Router -.->|"Powers"| A3
A3 -->|"Compiles"| Output(["Multimodal PDF Report"])
style Router fill:#f9a826,stroke:#333,stroke-width:2px,color:#000
style Output fill:#FF4B4B,stroke:#333,stroke-width:2px,color:#fff
- Robust LLM Failover Strategy: The core of the pipeline's reliability. A custom
LLMFailoverRouterassigns a high-speed Groq model (llama-3.1-8b-instant) to all agents for a sub-60-second runtime. If the Groq API hits a rate limit (HTTP 429), the router automatically and silently fails over to a backup model (gemini-1.5-flash) without crashing the execution state. - Autonomous Agent Crew: Employs specialized AI personas (Data Analyst, Market Researcher, Reporting Analyst) built on CrewAI to collaborate, delegate, and achieve complex analytical goals sequentially.
- Custom Tool Engineering: Agents operate autonomously using a suite of custom-built tools for localized SQL execution (
DuckDB), file I/O operations, programmatic data visualization (Seaborn/Matplotlib), and real-time web crawling (Tavily). - Multimodal Delivery: The final pipeline deliverable is an automated PDF report that programmatically embeds generated data visualization charts (
.png) alongside the synthesized executive text and full agent execution logs.
- Agentic Framework: CrewAI, LangChain
- LLM Providers: Groq (Primary), Google Gemini (Failover)
- Data Backend: DuckDB, Pandas
- Visualization: Matplotlib, Seaborn
- Infrastructure & Tools: Tavily API (Search), FPDF2 (Reporting)
Clone the repository and install the required dependencies (Python 3.10+ recommended):
git clone [https://github.com/AD1007/Multimodal-Agentic-Business-Intelligence-Analyst.git](https://github.com/AD1007/Multimodal-Agentic-Business-Intelligence-Analyst.git)
cd Multimodal-Agentic-Business-Intelligence-Analyst
pip install -r requirements.txtCreate a .env file in the root directory to authenticate the LLM router and search tools:
GROQ_API_KEY="your_groq_key_here"
GOOGLE_API_KEY="your_gemini_key_here"
TAVILY_API_KEY="your_tavily_key_here"Execute the master orchestration script. The system will auto-generate the DuckDB instance, trigger the agent crew, and compile the final artifacts in real-time.
python RunPipeline.pyThe final multimodal report will be saved as ABIA_Report.pdf in your project root.
.
├── demo/
│ ├── ABIA_Report.pdf # Pre-compiled report for live demo
│ └── index.html # GitHub Pages entry point
├── data/
│ └── gadget_grove.db # Auto-generated DuckDB instance
├── outputs/
│ └── monthly_revenue_plot.png # Agent-generated visualization
│
├── agents_and_tasks.py # CrewAI roles and task definitions
├── data_setup.py # Database synthesis and population
├── llm_setup.py # LLM definitions and Failover Router logic
├── tool_development.py # Custom agent tools (SQL, Search, Viz)
├── RunPipeline.py # Main execution and PDF compilation
│
├── .env # API Credentials
├── README.md # System documentation
└── requirements.txt # Dependency constraints
This project is licensed under the MIT License.