---
source_hash: e9a915724a4835dddffd7d2cba61227e8f35adafdecb048e92343ba798f13d34
post: /posts/ari-os/brain
shape: doctrinal
---

# Context Pack: Get the most from the Cortex brain

Reference for the rewritten guide. Behaviour corrections come from source inspection at PUSHINGSQUARES/ARI-OS commit 85bba5fccf42549b0507bc852ac8aaf47844b812, not a runtime test. Only the quoted excerpts are verbatim.

## Verbatim excerpts

> Local storage is still part of the design, but processing depends on the configured endpoints and backends.

> Explicit call values such as `k=12` and `token_budget=4000` override the corresponding preset values.

> Files own the truth. The brain owns the connections.

## Capture and source identity

The ari-os-cortex MCP server exposes reads and writes. File-based remember writes a Markdown note at $ARI_OS_HOME/memories/<context>/<UTC-timestamp>.md, then ingests it through python3 -m ari_os.tools.cortex ingest --path <file>. Keep the note as the canonical readable record.

MCP brain.remember(text, layer='semantic', source) directly indexes text, without creating that file. When source is omitted, the wrapper trims text and derives the source ID from the first 16 SHA-256 hex characters. An explicit source can identify a replaceable entry. Do not claim unconditional text deduplication or a source file for every memory.

## Retrieval boundaries

MCP brain.recall(query, mode='default', k=12, token_budget=4000) passes k as vector-candidate count. The packer estimates words times 1.3 and can admit an oversized first chunk; 4000 is not a hard token cap.

The retained CLI command is python3 -m ari_os.tools.cortex retrieve -q "<query>" --cwd "$PWD" --mode <mode>. The directory is retrieval context, not access control. The inspected matcher recognises workspaces/<name>; other paths can yield no workspace filter, automatic posture can choose global, and adjacency can include other workspaces. This MCP recall signature has no cwd argument.

The inspected path calls the Ollama embedding client before full-text search and may fail there. It does not use the separate embedding API's advertised off/lexical branch. No working no-Ollama keyword fallback was established. The control-panel embedding preference does not prove these direct client paths honour it.

## Ten mode presets

- default: baseline balanced regional weights.
- focus: narrower preset candidates/adjacency and procedural/workspace emphasis.
- wide: broader legacy preset, distinct from creative.
- synthesis: cross-region weighting/expansion preference subject to call settings and gates.
- deep: larger preset candidates with procedural/episodic emphasis.
- creative: identity, visual and higher-tier emphasis.
- visual: occipital weighting.
- recall: episodic/language weighting, not proven faster lookup.
- adhd and dyslexic: default retrieval sizes/weights plus council settings, not verified short-output or reading-ease transformations.

python3 -m ari_os.tools.arios cortex mode <name> saves a global control-panel preference. The Cortex CLI offers mode list/get/set/auto and uses a separate per-workspace store. Direct recall/retrieve defaults to explicit default mode. Its 12/4000 arguments can override preset candidate/budget values. Do not claim these configuration paths are equivalent.

The teaching widget has five simplified buttons. The inspected retrieval schema has seven keys: vmpfc, frontoparietal, hippocampus, wernicke, broca, occipital, parietal. Widget data is not the runtime authority or evidence of biological cognition.

## Consolidation and lineage

Retained commands: python3 -m ari_os.tools.cortex dream and python3 -m ari_os.tools.cortex distill --tier session|daily|weekly. The vertical bars mean choose one tier; do not paste them as a shell pipeline.

Session/daily/weekly distillation requires an enabled LLM; disabled passes return zero. Inspected transitions are 0→1, 1→2 and 2→3. Summaries add rows, parent IDs and edges while retaining parents during that operation; artefacts go under $ARI_OS_HOME/consolidation. This does not prove lossless storage compression.

Re-ingesting a source replaces its old chunks, potentially including summaries, and lineage can have missing parents. Source IDs need not point to existing files. Dream decay reduces importance by 3% for previously retrieved chunks whose last retrieval is over seven days old; no identity-region exemption appears in that pass.

The widget's Raw 22M, Session 8M, Daily 3.2M, Weekly 1.4M and Fact 600K figures are design illustrations, not storage measurements or a proved fifth automatic pass. Its copy now explicitly qualifies permanence and source availability.

## Configured local defaults

The preserved pulls are ollama pull nomic-embed-text and ollama pull gemma3:4b. The embedding dimension is configured as 768. OLLAMA_URL defaults to http://127.0.0.1:11434; URL, model and LLM/backend settings can change processing destinations. Local storage alone does not establish local processing.

## References and retained surfaces

The body links pinned remember/SKILL.md, index.py, retrieve.py, mode definitions, arios.py, distill.py, dream.py and embed.py. Use those source links to verify implementation rather than the older pack's guarantees.

- Source: content/posts/ari-os/brain.mdx; six original Code blocks retained.
- /posts/ari-os/brain-flow.png; two AsciiDoodle instances local-first and memory-leak.
- CortexRegionMap, ConsolidationCompressor, EvidenceDigFidget, LeakyBucket, SurfaceList and Pullquote under apps/web/components/blocks.
- [Advanced](/documents/ari-os/advanced), [Using it](/documents/ari-os/using-it), [Overview](/documents/ari-os/overview).
