Independent reference implementation of governed agentic AI execution.
eXo-brain explores how to put a server-side control plane around tool-using AI systems: policy gates, deterministic tool execution, provider-neutral runtime adapters, tenant-scoped governance, audit events, and runtime control.
Maturity note: this is a single-maintainer research project, not a production enterprise platform, SaaS product, or supported deployment template. See MAINTAINER_STATUS.md and STATUS.md before using it for serious evaluation.
Build model: AI-assisted implementation, with human-owned architecture, review, and evidence. See
MAINTAINER_STATUS.md§ “How This Project Is Built”.
Pick one path — deeper reading lives in docs/README.md.
| You are… | Start with | Then |
|---|---|---|
| Evaluator (15–90 min, no production claims) | notebooks/EVALUATOR_GUIDE.md | notebooks/README.md → tutorial_08 (proof lab) or tutorial_01 → tutorial_08 |
| Architecture reader (plain language) | docs/architecture/beginner-workflow.md | governed-execution-pipeline.md → ARCHITECTURE.md |
| API / integration (tier-aware contract) | docs/api/customer-api-integration-guide.md | foundation-tier-adoption-checklist.md |
| Contributor / maintainer | AGENTS.md (first reads + gates) | docs/operations/workflow-complete.md |
| Adapter operator (PyPI wheels) | docs/operations/adapter-installation.md | SavinRazvan/eXo_adapters |
This README is enterprise-grade documentation for a reference implementation — not a claim of enterprise product support, SLAs, or certified compliance. See What This Is Not and STATUS.md.
- A control-plane reference implementation for governed agent execution: ingress gates, policy middleware, deterministic tool runtime, audit, tenancy, quotas, and runtime control.
- A provider-neutral orchestration example: provider SDKs stay behind runtime adapter modules, while core orchestration depends on contracts, capabilities, and policy.
- A portfolio and design-partner artifact for teams thinking about safe tool use, adapter boundaries, MCP/tool governance, and audit-ready AI workflows.
- Not a commercial SaaS product.
- Not an enterprise-supported distribution, SLA-backed vendor offering, or certified compliance product.
- Not a complete provider-adapter marketplace. The strongest adapter path today is OpenAI-oriented; broader adapter breadth remains roadmap work.
- Not a production deployment template.
docker-compose.ymlis intentionally a local single-node development stack. - Not a generic chatbot wrapper or raw model-access resale surface.
flowchart TB
customerApp["Customer App or Test Client"]
apiLayer["Control Plane API"]
governanceLayer["Governance Layer"]
runtimeLayer["Session Runtime"]
adapterLayer["Provider Adapter Wall"]
toolLayer["Deterministic Tool Runtime"]
persistenceLayer["SQLite Stores"]
providerApi["External Model Provider"]
customerApp --> apiLayer
apiLayer --> governanceLayer
governanceLayer --> runtimeLayer
runtimeLayer --> adapterLayer
runtimeLayer --> toolLayer
adapterLayer --> providerApi
governanceLayer --> persistenceLayer
toolLayer --> persistenceLayer
Default governed turn flow:
- Authenticate tenant and session.
- Evaluate entitlements and ingress gates.
- Start the governed runtime path.
- Stream through the orchestrator.
- Route high-risk or state-changing tool calls through deterministic execution.
- Apply policy before and after tool execution.
- Persist audit and runtime-control evidence.
The canonical ordering reference is docs/architecture/governed-execution-pipeline.md.
The public repository currently includes:
- FastAPI control plane with REST plus streaming turn surfaces.
- 11 API router modules covering sessions, turns, tools, agents, providers, runtime control, audit, admin keys, Prometheus metrics, and OpenAI-compatible ingress.
- 12 policy modules under
src/policies/for middleware, ingress gates, risk gates, policy templates, signed plugins, classifier support, and BYOC fairness. - Deterministic tool execution through
src/tools/executor.py. - Capability + policy execution-mode selection through
src/runtime/mode_selector.py. - Provider-neutral runtime adapter contracts under
src/runtime/. - Tenant runtime composition through
src/runtime/tenant_runtime.py. - SQLite-backed persistence for local sessions, agents, tools, providers, audit events, run control, and rate limiting.
- BYOC tool-runtime primitives for customer-owned tool execution paths.
- MCP integration baseline for registering MCP tools into the internal tool ecosystem.
- Architecture checks under
scripts/architecture/for layer validation and forbidden provider imports. - Test corpus under
tests/with module-scoped coverage for governance, runtime, tools, persistence, API, and architecture scripts.
See STATUS.md for a public maturity matrix.
The current public posture is intentionally conservative:
- Persistence is SQLite-oriented; there is no packaged Postgres or HA datastore distribution.
- The compose file is local-development only.
- Human approval lifecycle APIs are planned, not complete.
- Standard telemetry hooks exist, but enterprise collector and dashboard certification are not complete.
- Adapter ecosystem breadth is not complete.
- No formal compliance attestation is claimed.
- Python 3.12+
- Docker and Docker Compose, if using the compose stack
- A local virtual environment is recommended
Adapter runtime packages (exo-brain-core-contracts, exo-brain-adapter-sdk,
exo-adapter-echo, exo-adapter-openai) install from PyPI via
requirements.txt — there is no in-tree packages/eXo_adapters mirror.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtAll four adapter wheels come from PyPI only — no sibling repo, git, or editable installs.
See docs/operations/adapter-installation.md for operator notes and provider registration.
python -m pytest -q
python scripts/architecture/validate_layers.py
python scripts/architecture/scan_forbidden_imports.py15 notebooks under notebooks/ complement pytest with narrative plus assertion-backed evidence — committed outputs, explicit PASS lines, and checks on policy decisions, ToolResult envelopes, and orchestrator streams. They are meant for evaluators and design partners who want to see the work, not only read architecture docs.
| Start here | Role |
|---|---|
| notebooks/EVALUATOR_GUIDE.md | 15 min / 90 min paths; what PASS lines mean |
| notebooks/README.md | Full index (15 notebooks), build scripts, per-notebook detail |
tutorial_08 |
Flagship local governed-execution lab (no API key; CI-executed on PRs) |
tutorial_09 |
Optional live OpenAI contrasts (evaluator-local) |
Regenerate content from notebooks/build_tutorials.py and notebooks/build_checks.py — do not hand-edit .ipynb JSON. Cross-read: governed-execution-pipeline.md (Hands-on proof).
Copy .env.template to .env and set at least what you use:
- API + default OpenAI provider:
OPENAI_API_KEY(withEXO_ENV=development, the platform bootstrapsexo_adapter_openaiautomatically). - Another vendor (Groq, Ollama, Azure OpenAI, etc.): use the commented OpenAI-compatible profile in
.env.template(EXO_DEFAULT_PROVIDER_*+ a vendor-specific*_API_KEYenv name), or register providers viaPOST /providers. - Notebooks only:
OPENAI_API_KEYis enough for live tutorial cells; no need to duplicate unused template variables.
The old names APP_ENV, DEFAULT_PROVIDER_ID, FALLBACK_PROVIDER_ID, and OPENAI_COMPATIBLE_* in earlier drafts are not read by this repo — use EXO_* and EXO_DEFAULT_PROVIDER_* instead.
docker compose up --buildThe API listens on http://127.0.0.1:8000 by default.
docker-compose.yml is explicitly marked as not a production or enterprise
template. It sets EXO_ENV=development and uses a local SQLite volume. Do not
use it as a deployment blueprint without a separate hardening pass.
src/api/- FastAPI app, routers, middleware, bootstrap.src/core/- orchestrator, scheduler, run control primitives.src/runtime/- runtime adapter contracts, factory loading, tenant runtime.src/policies/- policy middleware, ingress gates, risk gates, templates.src/tools/- deterministic tool executor, BYOC runtime, sandbox helpers.src/tenancy/- tenant governance and policy overlay support.src/persistence/- in-memory and SQLite persistence adapters.src/mcp/- MCP registry and tool-adapter bridge.tests/- module-aligned regression suites and architecture checks.notebooks/- tutorials, module smoke checks, and edge proofs (README, evaluator guide).docs/strategy/- product boundary, governance posture, monetization and deployment thinking.docs/architecture/- architecture references and governed execution order.docs/README.md- documentation index and recommended reading spine..cursor/and.agents/- maintainer workflow rules and agent skills.
- Provider SDKs stay behind runtime adapters.
- State-changing tool work must be policy-wrapped and deterministic when risk requires it.
- Capability + policy decide execution mode; core should not branch on provider names.
- Tenant-scoped configuration should be API-driven.
- Claims must be backed by code, tests, docs, or explicitly marked as planned.
The roadmap lives in docs/strategy/next-directions.md. Near-term areas that remain especially relevant:
- MCP governance depth.
- Human approval lifecycle APIs.
- Stronger deployment packaging and production-hardening evidence.
- Broader adapter conformance and publish certification.
- Better standard telemetry evidence.
The maintainer is open to paid design-partner or embedded engineering work around governed AI execution, adapter-neutral orchestration, policy-wrapped tool execution, and related architecture reviews.
This repository can be used as a reference implementation or starting point, but production deployment should go through a separate hardening process.