OuterBrain is the provider-neutral semantic-runtime gateway above Citadel.
It owns durable semantic-session truth, tool-manifest snapshots, prompt and strategy shaping, semantic quality checkpoints, live session fencing, provider-neutral semantic failure carriers, and restart-safe reply publication. It does not own provider memory, RAG engines, or model-specific cognition as platform truth.
- raw input normalization
- durable semantic state and journaling
- context assembly
- prompt and strategy shaping
- provider-neutral semantic failure normalization
- normalized semantic activity contracts with bounded routing facts
- semantic context provenance, duplicate suppression, and redaction evidence
- structured action-request synthesis
- provisional and final reply publication
- restart-safe downstream follow-up
Active workspace buildout. The repo uses a non-umbrella workspace layout with core packages, a dedicated raw-Ecto persistence layer, bridges, a host surface, and proving examples.
OuterBrain is the semantic layer above deterministic authority and below host or product presentation. It should be the place where ambiguous language-facing work becomes structured semantic facts, while Citadel remains the policy kernel, Jido Integration remains the lower execution owner, and Mezzanine owns durable operational truth once a product workflow is admitted.
The runtime loop is intentionally explicit:
- capture a raw turn or inbound event in the semantic journal
- acquire the semantic-session fence for the current epoch
- build a bounded context pack from memory, prompt fabric, and caller input
- validate the selected route/tool/action against a stored manifest snapshot
- compile a provider-neutral action request or semantic failure carrier
- publish provisional or final user-facing state with idempotent keys
- record provenance, redaction, duplicate-suppression, and quality evidence
- recover from durable journal/publication evidence after restart
That shape keeps semantic facts replayable without requiring lower workflow history to contain raw prompts, raw context packs, provider-native payloads, or private reasoning.
The workspace currently contains these active families:
outer_brain_contracts,outer_brain_core,outer_brain_journal,outer_brain_persistence,outer_brain_runtime,outer_brain_restart_authority, andouter_brain_qualityfor the core semantic runtime.outer_brain_prompting,prompt_fabric,context_budget,memory_contracts,memory_engine,guardrail_contracts,guardrail_engine,eval_runner, andtoken_meterfor prompt/context, memory, guardrail, eval, and cost-sensitive semantic support.outer_brain_authority_evidence,ai_artifact_contracts, andoptimization_artifact_storefor ref-only evidence and adaptive artifact lineage.- bridge packages for Citadel, typed domain routes, publication, review, and GroundPlane-shaped projections.
apps/host_surfaceand examples for console chat and direct Citadel action proof.
OuterBrain has durable semantic-session and restart-safety proof coverage in StackLab. The important current claim is not "complete agent intelligence"; the claim is that semantic runtime state can be captured, bounded, recovered, and published without leaking raw prompt/provider material or pretending that trace/projection data is policy authority.
Recent work added memory/context packages, prompt fabric and guardrails, token metering, eval-runner support, adaptive artifact identity, optimization artifact graph history, semantic persistence posture, authority evidence projection, and cleanup of env/regex/atom hazards.
OuterBrain may normalize semantic failures such as stale context, route ambiguity, adapter unavailability, provider refusal, semantic loops, and budget exhaustion. It should not make governance decisions, mutate provider state directly, select connector credentials, or decide product-specific review workflow. Those effects cross into Citadel, Jido Integration, Mezzanine, or AppKit-owned surfaces.
flowchart TD
Input["Raw turn<br/>or event"] --> Journal["Semantic<br/>journal"]
Journal --> Fence["Session<br/>fence"]
Fence --> Context["Bounded<br/>context"]
Context --> Manifest["Route<br/>manifest"]
Manifest --> Action["Action<br/>or failure"]
Action --> Publication["Reply<br/>publication"]
Publication --> Evidence["Quality<br/>evidence"]
Evidence --> Restart["Restart<br/>replay"]
Restart --> Context
flowchart LR
Memory["Memory<br/>contracts"] --> ContextBudget["Context<br/>budget"]
Prompt["Prompt<br/>fabric"] --> ContextBudget
Guard["Guardrail<br/>engine"] --> Action["Semantic<br/>action"]
Eval["Eval<br/>runner"] --> Quality["Quality<br/>evidence"]
Token["Token<br/>meter"] --> Quality
Artifact["Artifact<br/>refs"] --> Quality
flowchart TD
Journal["Journal<br/>entry"] --> Lease["Session<br/>lease"]
Lease --> Store["Persistence<br/>store"]
Store --> Publication["Reply<br/>record"]
Store --> Restart["Restart<br/>scan"]
Restart --> Reconcile["Reconcile<br/>state"]
Reconcile --> Dedupe["Dedupe<br/>key"]
Dedupe --> Publication
flowchart LR
Recall["Memory<br/>recall"] --> Budget["Context<br/>budget"]
Budget --> Pack["Prompt<br/>pack"]
Pack --> Gate["Tool<br/>gate"]
Gate --> Guard["Guardrail<br/>engine"]
Guard --> Tokens["Token<br/>meter"]
Tokens --> Eval["Eval<br/>runner"]
Eval --> Checkpoint["Quality<br/>checkpoint"]
Adaptive layer additions:
core/ai_artifact_contracts: ref-only artifact identity for prompt, role, skill, GEPA, eval, replay, router, provider, endpoint, promotion, and rollback refs.core/optimization_artifact_store: ref-only artifact graph history for candidate lineage, eval evidence, promotion, and rollback decisions.
Phase 7 persistence posture is carried through semantic sessions, prompt/ context provenance, journals, duplicate suppression, publication state, authority evidence, and projection/publication bridges. The default profile is memory/ref-only; durable refs are explicit, redacted evidence, and debug sidecar failure cannot mutate semantic-session, prompt provenance, suppression, publication, projection, or failure-journal state.
The project targets Elixir ~> 1.19 and Erlang/OTP 28. The pinned toolchain
lives in .tool-versions.
mix deps.get
mix ciThe welded outer_brain_contracts artifact is tracked through the prepared
bundle flow:
mix release.prepare
mix release.track
mix release.archivemix release.track updates the orphan-backed
projection/outer_brain_contracts branch so downstream repos can pin a real
generated-source ref before any formal release boundary exists.
docs/overview.mddocs/layout.mddocs/runtime_model.mddocs/integration_surface.mdCHANGELOG.md
This project is licensed under the MIT License.
(c) 2026 nshkrdotcom. See LICENSE.
Temporal runtime development is managed from /home/home/p/g/n/mezzanine
through the repo-owned just workflow. Do not start ad hoc Temporal processes
or rely on the temporal CLI as the implementation runbook.
Temporal runtime development is managed from /home/home/p/g/n/mezzanine through the repo-owned just workflow, not by manually starting ad hoc Temporal processes.
Use:
cd /home/home/p/g/n/mezzanine
just dev-up
just dev-status
just dev-logs
just temporal-uiExpected local contract: 127.0.0.1:7233, UI http://127.0.0.1:8233, namespace default, native service mezzanine-temporal-dev.service, persistent state ~/.local/share/temporal/dev-server.db.
See docs/persistence.md for tiers, defaults, adapters, unsupported selections, config examples, restart claims, durability claims, debug sidecar behavior, redaction guarantees, migration or preflight behavior, and no-bypass scope when applicable.