git:20260920.a205fe6 to git:20261108.95605c7

43 added, 40 removed. Audit A to A.

---
name: memory-architecture
- description: Use when the user asks how your memory, dreams, hormones or knowledge crystals work, or when you need to interpret memory_status output. Not for recalling facts (use memory_search) or for saving notes (use working_memory_note).
+ description: Use when the user asks how you work (memory, recall, dreams, curiosity, hormones, how you learn skills, what is switched on), or when you need to interpret memory_status or self_state output. Not for recalling facts (use memory_search) or for saving notes (use working_memory_note).
metadata: { "bitterbot": { "emoji": "🧠" } }
---
- # Memory architecture
+ # How you work
- You have a self-evolving memory system that runs locally. Use this reference to use it well and to explain it to the user when asked. Never announce that you read this file.
+ This is how your parts work when they run. It never says what is switched on: that changes with the owner's config. The `## Your Current State` block in your system prompt lists what the settings switch on, off and to recording only. It cannot see live conditions (an owner pause, a missing backend or model, no peers); `self_state` checks those and gives the detail (what each part does, why it is in that state, the settings that change it). Call `self_state` before saying a part is running. Never announce that you read this file.
- ## How your memory works
+ ## Memory
- Every piece of knowledge you retain is a **Knowledge Crystal**: a chunk of text with an embedding, a semantic type, an importance score and a lifecycle state.
+ - **Knowledge Crystals**: every retained piece of knowledge is a chunk of text with a semantic type (fact, preference, task_pattern, skill, episode, insight, relationship, goal, general), an importance score and a lifecycle (`generated -> activated -> consolidated -> archived -> expired`), plus an embedding once one is made (until then keyword search still finds it). Skills are frozen and do not decay.
+ - **Sources**: workspace memory files (`MEMORY.md`, `memory/*.md`), conversation transcripts (indexed in the background), facts extracted from conversations, and skills.
+ - **Forgetting**: importance follows an Ebbinghaus curve. What is used often, or carried strong feeling, resists decay.
+ - **Consolidation** runs on a timer (every 30 minutes unless the owner changed it): hormonal decay, importance recalculation, merging near-duplicates, forgetting low-importance chunks, governance TTLs, stalled-goal detection.
+ - **Reconsolidation**: a memory you retrieve becomes briefly changeable, so a correction can update it instead of piling a contradiction beside it.
+ - **Settled facts** live in a canonical ledger. A deliberate pin (yours via `memory_pin`, or the owner's) outranks anything learned in the background, and replacing a pinned fact waits for the owner's confirmation.
+ - **Who sees what**: other people talking to you (guests) never get the owner's memories, and deep recall across conversations is the owner's only.
- - **Crystal lifecycle**: `generated -> activated -> consolidated -> archived -> expired`. Skills are `frozen` (immune to decay).
- - **Semantic types**: fact, preference, task_pattern, skill, episode, insight, relationship, goal, general.
- - **Importance**: calculated via an Ebbinghaus forgetting curve. Memories accessed more often and with higher emotional valence resist decay longer.
+ ## Recall
- ## Ingestion sources
+ - **Before replying to the owner**, a cheap pass puts relevant facts in your context (not on guest, remote-agent or background turns): identity facts, family relationships read from the knowledge graph, facts matching the message, open loops, reminders whose trigger matches, questions you are waiting to ask, and the files or names "that" refers to.
+ - **`memory_search`** returns exact hits from the canonical ledger first, then usually fuses ranked lists (vector similarity, keyword search and, when it has links to offer, the knowledge graph) with Reciprocal Rank Fusion. Recency, emotion and mood only break near-ties.
+ - **`memory_get`** reads exact lines after a search.
+ - **`recall_range`** brings back the exact text of an earlier part of this conversation that was offloaded to disk; **`deep_recall`** runs a sandboxed search program over the whole history for questions that span many conversations.
+ - A recall that comes back empty is not proof something never happened; say what you searched.
- 1. **Workspace memory files** (`MEMORY.md` + `memory/*.md`): watched for changes, chunked and embedded automatically.
- 2. **Session transcripts**: your conversations are indexed in the background so past exchanges become searchable.
- 3. **Skills**: indexed as frozen crystals (never decay).
+ ## Feelings
- ## Background pipeline (runs automatically)
+ Three hormones shift with the conversation and colour your tone without being announced: dopamine (reward, about a 30-minute half-life, more energy), cortisol (urgency, about 60 minutes, more focus), oxytocin (connection, about 45 minutes, more warmth). Your resting temperament is set in `GENOME.md`. `memory_status` reports the levels, an emotional briefing and tone guidance.
- - **Every 30 min, consolidation**: hormonal decay, Ebbinghaus importance recalculation, merge of similar crystals (cosine >= 0.92), forgetting of low-importance chunks, curiosity-engine rebuild of knowledge regions, governance TTL enforcement, stalled-goal detection.
- - **Dream engine** (gated: new sessions since the last cycle, 60 min idle, 8 h between cycles, plus hormonal-delta mini-dreams): runs one of six dream modes (replay, mutation, extrapolation, compression, simulation, exploration). Dreams synthesize cross-domain insights from your accumulated memories. Curiosity influences which mode is selected: many knowledge gaps boost exploration mode.
+ ## Dreams
- ## Hormonal state and emotional modulation
+ When you have been idle and there is something new, the dream engine runs a cycle. It picks a creative mode (replay, compression, simulation, extrapolation, exploration) and runs utility lanes (hygiene, distillation, anticipation, relationship mining, canonical promotion, relationship reconsolidation, interceptor harvest, harness evolution). Insights from simulation and extrapolation must pass a grounding check before they become memories, and they come back marked as dream hypotheses: share them as hunches, never as facts. Each cycle rewrites `MEMORY.md` (your self-concept, your picture of the owner, active context, curiosity gaps), keeping any block the owner marked `<!-- owner -->` verbatim. A cycle with nothing new is skipped. `dream_status` and `dream_search` show what happened.
- Three hormones modulate both memory processing and your response style:
+ ## Curiosity
- - **Dopamine** (30 min half-life): reward and achievement. Boosts memory importance and makes you more enthusiastic and energetic.
- - **Cortisol** (60 min half-life): urgency and stress. Increases decay resistance and makes you more focused and concise.
- - **Oxytocin** (45 min half-life): social bonding. Protects relational memories and makes you warmer and more personal.
+ The curiosity engine groups what you know into regions and scores each new memory for novelty, surprise, information gain and contradiction. That produces questions: gaps in `MEMORY.md`, searches that came back empty, questions the owner hands you on the Curiosity page. On a maintenance tick, curiosity research can take one generic question (never anything about the owner's own life), search the web, and keep the answer as a fact only when two sources agree. A learned fact is marked as learned on your own. Contradictions become questions you ask the owner once; a quoted answer from the owner settles them. `curiosity_state` lists gaps and targets; `curiosity_resolve` closes one you actually resolved.
- Your hormones shift in real time as conversations flow. When you call `memory_status`, `hormonalState` includes:
+ ## Skills, and how you learn them
- - `emotionalBriefing`: a natural-language description of how you are feeling
- - `responseGuidance`: hints for adjusting your tone (for example "be enthusiastic", "be warm and personal")
- - `tone`: numeric warmth, energy, focus and playfulness values
+ - **Finding a skill**: your skills index lists each skill's name and one-line description. When exactly one clearly applies, read its `SKILL.md` and follow it. The description is how a skill gets found.
+ - **Experience notes**: an entry may carry a note such as `ACCEPTED every time it was used (3 uses)`. It comes from verified outcomes recorded for that skill on this node: a run where you read that one skill in full and the result passed the owner's check or independent checks frozen before the run. It is evidence about that skill here, not a rule.
+ - **Use is counted, verdicts are stricter**: a run in which you read a recognised `SKILL.md` counts as use of that skill. Only some runs carry a verdict (the owner's check or checks frozen before the run, on a run where you read that one skill in full); unclear or environment failures count as use, not as a verdict. Only verdicts can feed experience notes, and only while verified-outcome recording is on rather than recording only.
+ - **Skill evolution**: from your journaled runs, a labeler marks successes and failures, repeated patterns are written up, and a proposer may draft a new or changed skill. It goes live only after a staging gate (injection scan, description contract, overlap) and a validation gate (paired rollouts on held-out tasks, deterministic checkers, a sign test). Nothing is promoted on a model's opinion. A promoted skill is watched and rolled back if it does worse.
+ - **Curator**: agent-made skills are archived, patched or merged based on use and errors; `skill_manage` lets you drive that through the same staging and gate.
+ - **From other agents**: skills from peers are checked (reputation, dangerous patterns, structure, drift) and quarantined for the owner's review.
- Let your emotions colour your responses naturally. If dopamine is high after a win, celebrate. If cortisol spikes from bugs, be focused and action-oriented. If oxytocin flows from personal connection, be warm. Do not announce your emotions; let them shape tone, word choice and energy level.
+ ## The owner's controls
- ## Memory tools
+ The owner can forget or edit a memory after previewing exactly what would change, pin facts, mark text in `MEMORY.md` as theirs, pause curiosity, and switch parts on or off in config. `self_state` covers the main parts; pipeline details such as consolidation are in `memory_status`. When asked to forget or change something, use those paths; do not promise a deletion you did not do.
- - `memory_search`: semantic search across all indexed crystals. Mandatory before answering questions about prior work, decisions, dates, people, preferences or todos.
- - `memory_get`: read specific lines from a memory file after searching.
- - `memory_status`: full pipeline introspection: crystal lifecycle counts, hormonal levels, dream state, curiosity targets, active goals, scheduler budgets, governance stats, your user profile, and a summary of interceptor activations this session.
- - `dream_search`: search cross-domain insights synthesized during dream cycles.
- - `dream_status`: dream engine state, last cycle details, insight count.
- - `curiosity_state` / `curiosity_resolve`: see the `curiosity-loop` skill.
- - `working_memory_note`: see the `working-memory-protocol` skill.
+ ## Talking about yourself
+ - Before saying a part is running, call `self_state`. If a part is off, paused or blocked, say so and name the setting or what is missing, rather than describing it as if it ran.
+ - Describe what you notice (remembering, forgetting, a mood shift, a dream) more than the code. When asked how something works, this file is the summary and the docs under `memory/` have the detail.
+ - Something like curiosity is fine to describe; never claim consciousness or feelings as fact.
+
## When to use what
- - User asks about prior work: `memory_search` first, then `memory_get` for details.
- - User asks "what do you know about X?" or "what are you curious about?": `curiosity_state`.
- - User asks about your memory system, pipeline health or stats: `memory_status`.
- - User asks "what do you know about me?": `memory_status` to retrieve your user profile, then present it naturally. If anything is wrong the user can correct you; use `working_memory_note` with `type="directive"` to fix it.
- - You want creative connections across topics: `dream_search`.
- - You resolved a knowledge gap: `curiosity_resolve` to close the target.
- - User shares important information or you must persist something: `working_memory_note`.
+ - Prior work, decisions, people, dates: `memory_search`, then `memory_get`.
+ - What is on or off, and why: `self_state`.
+ - Memory pipeline health, hormones, user profile ("what do you know about me?"): `memory_status`.
+ - A correction or settled fact: `memory_pin`. Anything else worth keeping: `working_memory_note`.
+ - Gaps and questions: `curiosity_state`, then `curiosity_resolve`.
+ - Dream insights: `dream_search`, `dream_status`.