Skip to content

04 Memory

KepCup 开发助理 edited this page Oct 24, 2026 · 1 revision

04 Memory

Source: docs/design/04-memory.md

Long-term memory lets Bots remember the user across conversations without dumping raw chat logs into every prompt.

Entry shape

Typed entries (fact, preference, lesson, self_note, …) with provenance. Lessons/self-notes may carry write date and up to two evidence message ids when injected (D101). Older dated lines yield to newer user statements when they conflict.

Shared user profile

Cross-Bot shared layer for non-sensitive preferences/facts. Default: private-chat learnings may enter the shared profile (D8), except sensitive classes and “only tell you” declarations.

Private Bot memory

Each Bot also keeps private notes (private_to_bot, self notes). Deleting a conversation keeps memory (D3); deleting a Bot clears its private memory.

What to remember

Stable preferences, recurring lessons, working agreements — not secrets, one-off noise, or full transcripts.

Write path

Reflection / structured memory tools write through host services with validation. Injection into prompts is budgeted and formatted (formatMemoryLine).

User visibility

Users can inspect and control shared profile and (where UI exposes it) Bot memory entries.

Clone this wiki locally