N brains, one default
brain_knowledge_bases is keyed (company_id, name) with a partial unique index on
is_default = true. naive brain list and naive brain create --name --default drive
it, and the DSL declares the same shape.
One brain:
brains({ default, declared }); the record key is the name:
brain and brains are the same declaration at two arities; writing both is a
define-time error (company_brain_and_brains), and everything downstream reads one
resolved shape.
Connecting a brain to an agent
view() and partition() are the only ways to obtain a binding, and both are methods
on the value that declares the brain — no expression can name a brain it was not handed.
On the wire a binding carries
brainName; it is absent for a one-brain company, meaning
the company default. An empty ability list (can: []) is how an agent gets nothing.
Define-time refusals
Most misuse does not compile: a two-brain set with nodefault, a misspelled brain name,
a partition bound to the wrong brain, a brain at any level but company, or
can: ["promote"] / ["forget"] are all type errors. Because a config can also arrive
as JSON, the same rules are re-checked at define time:
Scope and levels
scope mirrors brain_knowledge_bases.scope: "project" (the column default) is a
brain of one project; "org" is the shared company trunk — at most one, enforced by a
partial unique index. Default recall unions the caller’s project brain with the org
brain.
Inside one brain: brain (the trunk; every belief lives here) → partition (a
team’s named slice) → lane (an agent’s private working set; off unless
lanes.enabled).
Visibility
view({ can: [...] }) picks from recall, attach, think, remember, learn,
propose, reaffirm, pressure. A brain may declare visibility: { can: [...] } —
the ceiling for every view of it; a view may only narrow it. promote and forget are
not abilities and cannot be added: they are the human acceptance and erasure of
model-authored text, which writes: { mode: "review" } exists to keep human.
Retention
retention.beliefs is required; a partition or lane may only narrow a value (widening
throws at define time), and everything is bounded by a 365-day ceiling. Platform
defaults are exported as brainDefaults:
What governs a brain write
brain is an opt-in primitive (it engages a subprocessor): a gated brain call with
no kit entry is denied. Four brain actions are human-gated by default
(AccountKits):
brain.kb.deleteandbrain.document.delete— both, so the KB-delete gate cannot be bypassed document by document.brain.forget— company-scope forget is effectively a right-to-be-forgotten wipe.brain.proposal.accept— canonizing a claim is a review act.
501 not_configured — see
Environments enforcement.
The read surface
GET /v1/brain/beliefs answers from brain_claims, keyset-paged. Every row carries
recallable and the filters that produced it, so “why did recall not return this?” is
answerable from the row:
lane_unavailable_because, expires_at_unavailable_because, …). Schema facts worth
knowing: there is no agent level on any brain_* table (level: "agent" is
unreachable), valid_to is temporal validity rather than retention, and there is no
lane column yet.
What refuses today
These answer501 not_configured with details.missing naming the absent dependency:
GET /v1/brain/levels, the belief reads, and the knowledge-base, ingestion, recall,
proposal and writeback surfaces under /v1/brain/* are real.
Related
- AccountKits — enabling the primitive and the approval defaults
- Approvals — how a gated brain action is frozen and replayed
- The durable runtime — where a team binds its partition
naive brain— listing, creating and selecting a brain from the CLI- Brain API — the wire surface