Chao Context Model
Chao is Chainabit's execution assistant. It can use authorized workspace data to answer questions and help complete work, while preserving the account, workspace, and resource boundaries of the caller.
Use this page to understand the contract clients can rely on. The internal prompt construction, ranking, model routing, and context-budget strategy are implementation details and may change without notice.
Context modes
| Mode | When to use it | Public behavior |
|---|---|---|
| General | No chainyId is supplied | Uses account and active-work context available to the caller. |
| Chainy | A chainyId is supplied | Prioritizes the selected Chainy's goals, work, memories, and run history. |
When you create a Chao session with Chainy context, the service resolves the authorized context for each interaction. Clients do not need to fetch the context snapshot and send it back with every message.
Context sources
Depending on the request and the caller's access, Chao may use:
- session messages and explicit attachments;
- Chainy- or account-scoped memories;
- Chains, Bits, run history, and produced artifacts;
- workspace settings and tool policies;
- live data returned by an authorized tool call.
The exact amount and ordering of context are not part of the public contract. Do not build clients that depend on a particular item count, ranking score, prompt position, or provider-specific format.
Scope and privacy guarantees
- The authenticated caller must be able to access every resource included in a response.
- A Chainy-scoped memory is not returned as context for an unrelated Chainy.
- Workspace data remains within the selected workspace boundary.
- Cross-tenant resource identifiers return a public authorization or not-found response; they do not reveal the other tenant's data.
- Tool calls apply the same authorization and policy checks as direct API calls.
- Internal prompts, provider instructions, and private evidence are not public response fields.
Direct context inspection
GET /ai/chao/context returns the public resolved snapshot for the current caller. This is useful for previewing the context available to a client or diagnosing a scope selection.
The response is a snapshot, not a promise that every field will be included verbatim in a later model request. Treat documented response fields as API data and treat prompt construction as opaque.
Live tool use
Chao may retrieve fresh data during a turn instead of relying only on the initial snapshot. Clients observe this through the documented SSE tool events and approval flow. They do not call Chao's internal tools directly.
See How Chao Uses Tools for client behavior and SSE Streaming for reconnection and event handling.