How aakriti1318/multi-agent-generator works
Project Type & Purpose
• This is an open-source Python tool that:
• Provides a CLI (multi-agent-generator) and optional Streamlit UI (streamlit_app.py).
• Leverages LiteLLM to remain provider-agnostic (OpenAI, WatsonX, Ollama, Anthropic, etc.).
• Generates multi-agent code or JSON configs for multiple frameworks (CrewAI, CrewAI Flow, LangGraph, ReAct variants).
File Structure
Top-level:
• multi_agent_generator/ – core package
– __main__.py (CLI entry point)
– generator.py (orchestrates code generation)
– model_inference.py (wraps LiteLLM calls)
– frameworks/ (one module per supported framework)
• streamlit_app.py – optional UI front-end
• docs/, mkdocs.yml – documentation site
• setup.py, pyproject.toml, requirements.txt – packaging & dependencies
Key Components
A. User Interfaces
1. CLI Interface (__main__.py)
2. GUI Interface (Streamlit in streamlit_app.py)
B. Core Orchestrator
– generator.py: parses instruction, chosen framework & output format
C. Inference Layer
– model_inference.py: abstracted LiteLLM client
– External LLM Providers (OpenAI, WatsonX, Ollama, Anthropic)
D. Framework Plugins
– frameworks/crewai_generator.py
– frameworks/crewai_flow_generator.py
– frameworks/langgraph_generator.py
– frameworks/react_generator.py
– frameworks/react_lcel_generator.py
E. Output Handlers
– Python code emitter
– JSON config emitter
F. Documentation Site
– MkDocs (docs/ + mkdocs.yml)
Relationships & Data Flow
• Users invoke either CLI or Streamlit UI → passes instructions + flags (framework, provider, output) to the Core Orchestrator.
• Core Orchestrator → calls Inference Layer → dispatches prompt to LiteLLM → LiteLLM forwards to chosen external LLM → responses returned.
• Core Orchestrator → selects appropriate Framework Plugin → plugin ingests LLM output → generates code or JSON.
• Output Handler formats and writes to stdout, file, or downloads via UI.
• Documentation is maintained separately (MkDocs) and serves static site; not in the runtime flow but part of the ecosystem.
Architectural Patterns & Principles
• Modular Plugin Architecture: each framework generator is a drop-in module under frameworks/.
• Provider-Agnostic Abstraction: model_inference.py wraps all LLM providers via LiteLLM.
• Separation of Concerns: UI, orchestration, inference, generation, and output each live in their own layer.
Final Checklist
• [ ] All main components labeled
• [ ] Call out external LLM providers separately
• [ ] Note configurable flags/env-vars at UI layer (e.g., --provider, API_KEY)