For the complete documentation index, see llms.txt. This page is also available as Markdown.

The Six-Layer Stack

Brain is a layered protocol. Information flows up; control flows down.

Raw → Ledger → Wiki → Policy → Agent → Audit

Each tenant has its own logical instance of every layer, with hard isolation at the database, KMS, and policy boundaries. Off-chain state lives in Postgres with pgvector and Azure Blob-backed raw artifacts. On-chain commitments and smart-account execution live on Base L2.

The Six Layers at a Glance

1️⃣ Raw

Lossless ingestion of evidence from any authorized source.

2️⃣ Ledger

Deterministic structuring into immutable records with provenance.

3️⃣ Wiki

Continuously updated memory graph per tenant.

4️⃣ Policy

Plain-English rules compiled to deterministic guards.

5️⃣ Agent

Internal and external agents executing within policy.

6️⃣ Audit

Per-tenant Merkle tree anchored on Base L2.

Why Six Layers, in This Order

The stack is not a stylistic choice. Each layer enforces a property the layer above it requires.

Layer
What It Enforces
Why It Matters

Raw

Lossless, replayable storage

Higher layers can be rebuilt deterministically if extraction logic changes

Ledger

Deterministic structure with provenance

Reasoning never reinterprets raw documents on the fly

Wiki

Continuously refreshed memory linked to Ledger

Answers compound over time; citations are always traceable

Policy

Tenant-signed deterministic rules

No agent action runs unchecked

Agent

Scoped, attestable execution

Internal and external agents share one verified substrate

Audit

Hash-chained, Merkle-anchored events

History cannot be silently rewritten

Information Flow

Information flows up. Each layer enriches the one below.

Control Flow

Control flows down. Higher layers gate lower ones.

Layer Above
Gates
Layer Below

Audit

requires hash links from

every other layer

Agent

requires verdict from

Policy

Policy

reads from

Ledger only (never Wiki)

Wiki

rebuilds from

Ledger

Ledger

replays from

Raw

Raw

sources from

the tenant's connected systems

Off-Chain and on-Chain Split

Most logic is off-chain by design. On-chain contracts exist to anchor state, register identity, enforce session-key scope/limits, and route agent execution.

Tier
What Lives Here

Off-chain

Raw artifacts (Azure Blob), Ledger records (Postgres), Wiki graph (Postgres + pgvector), Policy compiler, Agent runtime

On-chain (Base L2)

BrainAuditAnchor, BrainPolicyRegistry, BrainSmartAccount, BrainMCPAgentRegistry

What's Next

📥 Raw and Ledger

How evidence becomes deterministic structure.

🧠 The Wiki

The memory graph per tenant.

📋 Policy and Permissioning

Plain-English rules to deterministic guards.

Last updated