Skip to Content

Architecture

Every run goes to one agent loop: the model the user chose reads the question, calls tools, and writes the answer. The harness supplies the tools, the context and the controls around them.

Request Flow

  1. Context — the harness resolves the tenant, the user’s permission settings and the conversation so far.
  2. Loop — the model calls tools as it needs them and sees each result before deciding the next step.
  3. Answer — the answer is returned and stored with the tool calls behind it, so a follow-up question can refer to them.

Tools

  • Data tools — one typed tool per curated data function, plus composable primitives (describe, select, explain) for free-form questions.
  • Skills — playbooks the model loads when a question matches one. A skill can also bring the tools of an MCP server.
  • Advisor — the model can ask a stronger model for a second opinion.
  • Delegation — the model can hand a sub-task to a lighter model with its own tool budget.

Data Tools

The model never writes free-form SQL against the database. At startup the harness introspects the connected database and builds one typed tool per curated data function. Every tool:

  • runs inside a read-only transaction,
  • is locked to a single tenant, and
  • is registered in a central tool registry.

The composable primitives run inside a safety gate that rejects mutations and refuses queries whose estimated cost is too high.

Control and Safety

  • Tenant lock — data tools are pinned to one tenant. Other tenants can still ask questions, but the data tools refuse for them.
  • Approvals — tools that change data ask the user before they run.
  • Fail-closed boot — if the data integration cannot verify access control or data freshness at startup, it disables itself rather than serving unverified answers.

Observability

Every run can emit tracing spans tagged with the tenant and the model. When telemetry is enabled, those spans flow to an observability backend with per-tenant cost and latency.

Last updated on