How dheiver2/mangaba_ai works
Project type and purpose
• Mangaba.AI is a Python framework (an open-source tool) for creating and orchestrating teams of autonomous AI agents.
• It provides core services (agent management, inter-agent communication, context persistence), model adapters (OpenAI, Anthropic, Gemini), and integration plugins (Slack, GitHub, Jira, Discord).
File structure
• Top-level “mangaba_ai/” – core library
• config (assistant setup, environment loading)
• core (Agent base classes, MCP context manager, model interfaces, communication protocols)
• schemas (JSON/schema definitions for configs, messages, analysis results)
• cases (prebuilt workflows like Slack analysis)
• utils (logging, validation, exceptions)
• main.py (CLI entry-point)
• “src/integrations/” – plugin directory for platform connectors (slack, github, jira, discord)
• “examples/” – usage demos showing how to wire agents, integrations, and run tasks
• “docs/” – Markdown and Sphinx docs including architecture.md, workflow.md, agents.md
• Tests, CI scripts, and environment setup files
Extract insights from the README
• Core features: Autonomous agents, A2A communication, MCP (shared context), multi-model support, integration plugins
• Usage flow: configure API keys → define agents & tasks → execute examples (basic_usage.py) → view collaborative output
• Extensions: drop-in new agent roles, add new integration under src/integrations
a. Main Components
• Client / CLI (main.py or user code)
• Configuration Loader (environment & API keys)
• Agent Manager & MCP Context Controller
• Agent Instances (Researcher, Analyst, Writer, custom roles)
• Communication Bus / Protocol Layer (core.protocols)
• Model Adapters (OpenAI, Anthropic, Gemini)
• Memory / Context Store (in-memory or external DB)
• Integration Plugins (Slack, GitHub, Jira, Discord)
• Utilities (Logging, Validation)
• External Services (AI API endpoints, Slack/GitHub APIs)
b. Relationships & Data Flow
• User invokes main → config loader populates settings
• Agent Manager creates agent objects → places them on MCP context bus
• Agents send/receive messages via protocols → MCP orchestrates sequence
• Agents call Model Adapters → external AI APIs return responses → fed back into MCP
• Integration plugin handlers subscribe to MCP events and push/pull data from external platforms
• Logs and errors flow to utility modules
c. Architectural Patterns & Principles
• Modular, plugin-based architecture (separate core vs. integrations)
• Actor-style agents communicating via message protocols
• Pipeline/workflow pattern controlled by MCP (shared context manager)
• Dependency Injection for model adapters and configs
• Schema-driven validation
d. Key Technologies & Frameworks
• Python 3.8+ with dependency injection via config
• Third-party AI SDKs (google-generativeai, openai, anthropic)
• Sphinx for docs (docs/*.md, conf.py)
• pytest for tests (tests/, src/integrations/*/tests)
Detail without over-fragmenting
• Layer: Entry → Configuration → Core orchestration → Agents → Adapters → External services
• Don’t omit utility/support modules (logging, validation) but group them logically
• Schema definitions as the contract between components