ai-agent-engine is a lightweight orchestration engine for AI agents. Workflows are defined declaratively in YAML and executed through a multi-LLM router that selects the optimal model for each step.
graph TB
Client[Client / API]
API[FastAPI Gateway]
Config[YAML Config Loader]
Router[LLM Router]
Orchestrator[Workflow Orchestrator]
Planner[Planner Agent]
Executor[Executor Agent]
Validator[Validator Agent]
OpenAI[OpenAI API]
Anthropic[Anthropic API]
Local[Local LLM]
Safety[Safety Layer]
Observe[Observability]
Client --> API
API --> Config
Config --> Orchestrator
Orchestrator --> Router
Router --> OpenAI
Router --> Anthropic
Router --> Local
Orchestrator --> Planner
Orchestrator --> Executor
Orchestrator --> Validator
Safety --> Orchestrator
Observe --> Orchestrator
- FastAPI Gateway — HTTP entry point, request validation, routing to orchestrator
- YAML Config Loader — Parses and validates workflow definitions
- Workflow Orchestrator — Resolves step dependencies (DAG), executes steps sequentially or in parallel
- LLM Router — Selects optimal model per task (cost-aware, fallback chains)
- Agent Patterns — Built-in patterns: Router, Planner, Executor, Validator
- Safety Layer — Rate limiting, cost controls, content filtering
- Observability — Structured logging, metrics, trace ID propagation
src/agent_engine/api/— FastAPI routessrc/agent_engine/core/— Orchestrator, Router, Agent patternssrc/agent_engine/config/— YAML loader, validationsrc/agent_engine/llm/— LLM providers (OpenAI, Anthropic, Local)src/agent_engine/safety/— Rate limiting, cost controlssrc/agent_engine/observe/— Logging, metrics, tracingsrc/agent_engine/models/— Pydantic modelssrc/agent_engine/services/— Business logic servicesworkflows/— Example YAML workflow configs