How microsoft/multi-agent-custom-automation-engine-solution-accelerator works
Project type and purpose
• This is a full-stack, AI-driven orchestration system (“Multi-Agent Custom Automation Engine”) that uses multiple specialized agents to automate business tasks.
• Frontend: React/TypeScript app served via a Python server.
• Backend: Python service using Semantic Kernel, providing REST APIs, agent orchestration, memory persistence, and telemetry.
• Infra: Azure resources (Container Apps, OpenAI Service, Cosmos DB, Container Registry) provisioned via Bicep.
File structure
• Top level directories:
• infra: Bicep templates & scripts for Azure infra deployment.
• src/backend: Python service (app_kernel, handlers, auth, context, agents, tools, middleware).
• src/frontend: React/TS app (Vite), served by frontend_server.py.
• tests/e2e-test: Selenium-like E2E tests for the running application.
• CI/CD & DevOps: .github/workflows & .azdo/pipelines define build, test, container-build, deploy, WAF deployment.
• Dockerfiles: in src/backend & src/frontend for containerization.
• Configuration files: pyproject.toml, requirements.txt, .env.sample, azure.yaml.
README for additional insights
User → Frontend (Container App) → Backend (Container App) → Azure OpenAI + Cosmos DB.
• Agent flow: how tasks move through Planner, Executor, Validator agents.
a. Main components
• User: browser or client.
• Frontend: React app + Python server (API gateway).
• Backend: Python service with layers:
– API Handlers (entrypoints)
– Auth module
– Kernel Orchestrator (app_kernel.py, config_kernel.py)
– Context/Memory (cosmos_memory_kernel.py)
– Kernel Agents (planner, hr, marketing, procurement, product, tech_support, human)
– Kernel Tools (tool wrappers per domain)
– Event utilities & OTLP tracing
• Database: Azure Cosmos DB (persist memory, metadata).
• AI Service: Azure OpenAI Service (LLMs).
• Container Registry: stores container images.
• CI/CD pipelines & Infra: Azure DevOps/GitHub Actions + Bicep templates.
b. Relationships and interactions
• User sends tasks via frontend UI → Frontend Server exposes REST or WebSocket → Backend API Handler receives request → Auth middleware validates → Kernel Orchestrator breaks down task → Kernel Agents (via agent_factory) coordinate planning/execution → Agents call Tools (which wrap external APIs or DB) → Context module persists interim results to Cosmos DB → Orchestrator aggregates results → Handler returns response to frontend → Frontend updates UI.
• Backend logs/telemetry via OTLP to Azure Monitor.
c. Architectural patterns
• Layered architecture (API layer, orchestration layer, persistence layer).
• Plugin-like agent modules (each agent implements a common interface via agent_base).
• Factory pattern (agent_factory selects & instantiates agents).
• Dependency injection/config kernel for environment & service wiring.
• Infra-as-Code (Bicep) defining cloud resources.
d. Key technologies/frameworks
• Python, Semantic Kernel SDK, FastAPI or equivalent (see Dockerfile & app_kernel imports).
• React + Vite + TypeScript in frontend.
• Azure Container Apps, Azure OpenAI, Azure Cosmos DB, Azure Container Registry.
• Bicep for infra.
• GitHub Actions & Azure DevOps for CI/CD.
Backend structure (per your request)
• Entrypoint: app_kernel.py loads config, wires up auth, telemetry, and kernel.
• config_kernel.py sets up connections (Cosmos DB, OpenAI client).
• Handlers folder: individual modules (runtime_interrupt_kernel, health_check) expose API endpoints.
• auth module: auth_utils & sample_user demonstrate token/credential verification.
• context module: cosmos_memory_kernel implements IKernalMemory storing messages & state.
• kernel_agents: one class per business domain; all implement agent_base and use agent_utils.
• kernel_tools: low-level wrappers around domain APIs or logic, invoked by agents.
• utils_date, utils_kernel, event_utils provide shared tooling.
• Testing: unit tests under src/backend/tests validate each layer; integration tests exercise agent flows.