Zero Human ERP — autonomous AI agent management system that operates an ERP with minimal human intervention.
A FastAPI gateway accepts tasks, a LangGraph "Manager" graph decomposes them into subtasks, and per-agent "Worker" subgraphs execute tools with guardrails (Budget → ACL → HITL). State is checkpointed to Postgres so human-in-the-loop interrupts can be resumed.
Hexagonal / Ports & Adapters. Import direction is one-way: adapters → application → domain.
src/
domain/ # pure business: models, value_objects, services, ports
application/ # use cases, DTOs, LangGraph graphs/nodes, guardrail chain
adapters/ # concrete infra: api (FastAPI), persistence, llm, tools, tracing
config/ # Settings (pydantic-settings) + structlog config
bootstrap.py # composition root — wires all concretes together
- Manager graph —
classify_intent → decompose_task → assign_agents → dispatch_worker → … → aggregate_results → finalize - Worker subgraph —
plan → execute (GuardedToolNode) → review → fix_loop → report_back - Guardrails — Chain of Responsibility:
Budget → ACL → HITL
- Docker & Docker Compose
- Python 3.11+
uvpackage manager
# Install dependencies
make install
# Copy and fill in environment variables
cp .env.example .env
# Start Postgres and API
make up
# Run migrations
make migrate
# Seed agents and tools
make seedmake up # Start API + Postgres (Docker)
make down # Stop containers
make logs # Tail API logs
make migrate # Run alembic upgrade head (in container)
make migrate-local # Run alembic upgrade head (local venv)
make migration MSG='describe change' # Autogenerate new revision
make seed # Seed tools + agents
make seed-agents # Seed agents only
make test # Full pytest run
make test-unit # Unit tests only
make test-integration # Integration tests (needs Postgres)
make test-e2e # E2E tests
make lint # ruff check
make fmt # ruff format + autofixCopy .env.example to .env and configure:
| Variable | Description |
|---|---|
OPENAI_API_KEY |
OpenAI API key |
POSTGRES_URL |
Postgres connection string |
API_KEY |
API key for authenticating requests |
LANGSMITH_API_KEY |
LangSmith tracing (optional) |
All mutating endpoints require the X-API-Key header matching API_KEY in settings. The /health endpoint is open.
- Create
src/adapters/tools/<domain>/<name>.pywith a@tool-decorated async function - Add entry to
seeds/tools_seed.yamlwithhandler_ref = "adapters.tools.<domain>.<name>:<func>" - Grant permissions in
seeds/agents_seed.yaml - Run
make seed
To create an API key in Odoo:
Settings → Enable Two-Factor / API Key → Administrator → Security → API Key
MIT