Source layout
Where each part of the platform lives. The platform is its own cargo workspace under
agents/backoffice-agents/; the repository root workspace excludes agents/.
app/ the Loco app
src/definitions/ YAML structs, loader (with get_env rendering), cross-validation, conditions
src/kinds/ task kinds: document.parse, llm.extract, rules.validate, records.match,
human.approval, connector.invoke, flow.end
src/engine/ YAML → graph compiler, retry/audit wrappers, checkpoints, run driver, adapters
src/stores/ PostgreSQL stores (pg.rs) and in-memory fakes (memory.rs)
src/controllers/ /agui/{workflow}, /api/agents, /api/documents, /api/runs/{thread}
src/workers/ ingest (parse, embed, start a run), drive_workflow
src/tasks.rs config_validate, schema_export, retention_purge, approval_expiry
migration/ schema: tenants, users, vendors, documents, runs, sessions, approvals,
hash-chained audit log, idempotency keys, pgvector embeddings, row-level security
crates/ core (ports), agui (AG-UI 1.0 wire types), llm, documents, integrations, telemetry
config/ Loco environment files + config/agents/** definitions
schemas/ JSON Schemas for the definition files (generated; a test keeps them current)
web/ Next.js + CopilotKit (Bun)
deploy/ docker-compose, Dockerfiles, OpenTelemetry Collector config, .env.example
The library crates
The Loco application (app/) is the only crate that depends on loco-rs. Everything it
talks to sits behind a trait in crates/core, so a store, a model provider or a connector
can be swapped without touching the engine, and the tests run against in-memory fakes.
| Crate | Holds |
|---|---|
crates/agui (bo-agui) | AG-UI 1.0 wire types and the SSE encoder. |
crates/core (bo-core) | Domain types, errors and ports. Framework-free: nothing here depends on Loco, graph-flow or any client library, so every adapter can be replaced behind its trait. |
crates/documents (bo-documents) | docling-serve behind DocumentParser. |
crates/integrations (bo-integrations) | Connector adapters behind IntegrationConnector. Each connector YAML's kind selects one of these (engine::adapters in the app). |
crates/llm (bo-llm) | An OpenAI-compatible model endpoint (vLLM) behind LlmProvider. |
crates/telemetry (bo-telemetry) | OTLP trace export, installed from Loco's init_logger hook (Loco has no OpenTelemetry code). |