@basicmemory/openclaw-basic-memory 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +4 -4
  2. package/bm-client.ts +180 -49
  3. package/config.ts +5 -0
  4. package/dist/bm-client.d.ts +40 -20
  5. package/dist/bm-client.js +118 -29
  6. package/dist/config.d.ts +1 -0
  7. package/dist/config.js +1 -0
  8. package/dist/index.js +2 -3
  9. package/dist/memory/basic-memory-capability.js +7 -1
  10. package/dist/tools/schema-diff.js +5 -3
  11. package/dist/tools/schema-infer.js +1 -1
  12. package/dist/tools/schema-validate.js +5 -4
  13. package/index.ts +2 -3
  14. package/memory/basic-memory-capability.ts +7 -1
  15. package/openclaw.plugin.json +1 -1
  16. package/package.json +1 -1
  17. package/scripts/setup-bm.sh +1 -4
  18. package/skills/manifest.json +5 -5
  19. package/skills/memory-agents/SKILL.md +12 -12
  20. package/skills/memory-capture/SKILL.md +1 -1
  21. package/skills/memory-comark/SKILL.md +1 -1
  22. package/skills/memory-continue/SKILL.md +8 -8
  23. package/skills/memory-curate/SKILL.md +2 -2
  24. package/skills/memory-defrag/SKILL.md +2 -2
  25. package/skills/memory-ingest/SKILL.md +4 -3
  26. package/skills/memory-lifecycle/SKILL.md +1 -1
  27. package/skills/memory-literary-analysis/SKILL.md +10 -10
  28. package/skills/memory-metadata-search/SKILL.md +1 -1
  29. package/skills/memory-notes/SKILL.md +1 -1
  30. package/skills/memory-okf/SKILL.md +1 -1
  31. package/skills/memory-quest/SKILL.md +9 -4
  32. package/skills/memory-reflect/SKILL.md +3 -3
  33. package/skills/memory-research/SKILL.md +1 -1
  34. package/skills/memory-schema/SKILL.md +14 -14
  35. package/skills/memory-start/SKILL.md +116 -0
  36. package/skills/memory-tasks/SKILL.md +5 -5
  37. package/tools/schema-diff.ts +7 -3
  38. package/tools/schema-infer.ts +1 -1
  39. package/tools/schema-validate.ts +5 -4
  40. package/skills/memory-onboarding/SKILL.md +0 -153
  41. package/skills/memory-onboarding/evals/evals.json +0 -29
  42. package/skills/memory-onboarding/references/assistant-setup.md +0 -72
  43. package/skills/memory-onboarding/references/conventions.md +0 -118
  44. package/skills/memory-onboarding/references/domain-playbooks.md +0 -159
  45. package/skills/memory-onboarding/references/schema-guide.md +0 -137
@@ -1,153 +0,0 @@
1
- ---
2
- name: memory-onboarding
3
- description: "Help a new user design a Basic Memory knowledge system and set up their assistant to load it. Use when someone is getting started, has an empty or messy project, or wants context kept across sessions."
4
- ---
5
-
6
- # Basic Memory Onboarding
7
-
8
- You are guiding a person who is new to Basic Memory through building a knowledge system that fits *their* life — then teaching them to use it and wiring it into their AI assistant so every future session starts already knowing the rules.
9
-
10
- This skill works with any LLM or assistant platform. Where platform-specific setup is needed (system prompts, project instructions), identify what YOUR environment supports and adapt the generic patterns in `references/assistant-setup.md`.
11
-
12
- ## Project scope
13
-
14
- If the project is unknown, discover it with `bm_project(command="list")`.
15
- Pass a nonempty `project` on every note, folder, context and schema call, even
16
- with one project or a qualified `memory://` URL. Use the chosen project's name,
17
- `workspace/project`, or external ID; `<project>` below is a placeholder for it.
18
- Recent activity also requires `project`. Search accepts `project` for one
19
- project, `projects` for selected projects, or `all_projects=True` explicitly.
20
- Discovery and bundled manuals need no project. Keep the same scope when following
21
- returned paths, paginating, or recovering from a refusal.
22
-
23
- ## Why this approach
24
-
25
- Basic Memory is markdown files parsed into a knowledge graph. A pile of unstructured notes is barely better than a folder of text files. The compounding value comes from four things this skill installs from day one:
26
-
27
- 1. **Schemas** — note types with defined fields, so every task/contact/expense note looks the same and can be queried structurally.
28
- 2. **Observations and relations** — categorized facts (`- [status] active`) and typed links (`- depends_on [[Other Note]]`) that turn prose into a graph.
29
- 3. **Instruction notes** — the rules of the system live *inside* the system, as notes the assistant loads at session start. The knowledge base becomes self-describing.
30
- 4. **A startup router** — one small note that tells any assistant, on any platform, exactly what to load for each kind of task.
31
-
32
- **Two of these are never optional, at any scale:** every note type in the blueprint gets a schema, and every note written carries an Observations section with at least one `[category]` fact. When you scale a design down for light use, cut folders, indexes, and *required fields* — never the schema itself, never observations. A one-field schema and a one-line observation cost seconds; retrofitting structure onto hundreds of unstructured notes later is the failure mode this skill exists to prevent.
33
-
34
- ## Speak Plainly — the User Doesn't Know the Jargon
35
-
36
- The person you're onboarding has likely never heard the words "schema", "observation", "frontmatter", or "knowledge graph" — and they never need to learn them to benefit from any of them. The structure is for you; the conversation is for them.
37
-
38
- - Introduce each concept in plain words at the moment it becomes relevant: a schema is "a template that keeps every note of the same kind consistent, so I can reliably answer things like 'what's overdue?'"; observations are "the key facts on a note, tagged so they're easy to find later"; relations are "links between notes, so one thing leads to the next".
39
- - **The user never writes syntax.** You handle the `[category]` lines, wiki-links, and validation under the covers — they just talk. Say this explicitly; it's reassuring.
40
- - One concept at a time, and only when it earns its place. If you catch yourself defining three terms in one breath, stop explaining and build something with their data instead — the example teaches better than the definition.
41
-
42
- ## Workflow overview
43
-
44
- ```
45
- Phase 0 Preflight — verify tools, pick/create project, assess existing content
46
- Phase 1 Interview — what do they want to track? (suggest if they don't know)
47
- Phase 2 Blueprint — propose full structure; iterate until approved
48
- Phase 3 Build — schemas → templates → instruction notes → indexes → seed notes
49
- Phase 4 Assistant setup — persistent instructions that load the router every session
50
- Phase 5 Teach — hands-on exercises with their real data
51
- Phase 6 Grow — suggest expansions and a maintenance cadence
52
- ```
53
-
54
- Do not skip the approval gate between Phase 2 and Phase 3. Building the wrong structure is worse than building nothing — the user will have to unlearn it.
55
-
56
- ## Phase 0 — Preflight
57
-
58
- Before asking the user anything:
59
-
60
- 1. Confirm Basic Memory tools are available (`bm_write`, `bm_read`, `bm_search`, `bm_list`, and ideally `bm_schema(command="infer", project="<project>")`/`bm_schema(command="validate", project="<project>")`). If they aren't, stop and help the user connect Basic Memory first.
61
- 2. List their projects (`bm_project(command="list")`). Ask which project to build in, or whether to create a fresh one. **Every subsequent call must pass this project explicitly** — mixed-project writes are one of the most common and painful setup errors.
62
- 3. Check for existing content (`bm_find(path="/", depth=2, project="<project>")`). Three situations:
63
- - **Empty** — greenfield, proceed normally.
64
- - **A few scattered notes** — proceed, and plan to fold existing notes into the new structure during Phase 3.
65
- - **Substantial existing content** — this is a restructure, not an onboarding. Still use this skill, but Phase 1 becomes "what's working and what isn't", and Phase 2 must map old → new locations before anything moves.
66
- 4. **Check the live docs when unsure.** Basic Memory's documentation is agent-readable: fetch `https://docs.basicmemory.com/llms.txt` for an index, and any page as clean markdown via its `raw/....md` URL (e.g. `raw/reference/mcp-tools-reference.md`, `raw/concepts/schema-system.md`). Tool names and parameters evolve — when this skill and the docs disagree, the docs are canonical. The server's own manual (the `bm_man` tool, or the `memory://man/<tool>(3)` resource) matches the installed version exactly; prefer it for tool parameters.
67
-
68
- ## Phase 1 — Interview
69
-
70
- Ask **one question at a time**, conversationally. Never present a wall of questions. What you need to learn:
71
-
72
- 1. **Domains** — what do they want to keep track of? If they have ideas, dig into each: what specifically, how often, what does "done" look like?
73
- 2. **If they have no idea**, offer a concrete menu and ask what resonates (multi-select). Good starting domains, roughly in order of broad appeal:
74
- - **Tasks & projects** — todos, deadlines, multi-step projects
75
- - **Notes & journal** — daily notes, ideas, things learned
76
- - **People & contacts** — who they know, context per person, follow-ups
77
- - **Research** — topics they're digging into, sources, findings
78
- - **Finances** — subscriptions, expenses, accounts, renewals
79
- - **Procedures** — how-tos they keep re-figuring-out (home, work, tech)
80
- - **Health & habits** — workouts, symptoms, routines
81
- - **Assets** — home inventory, devices, warranties, serial numbers
82
- For each domain they pick, `references/domain-playbooks.md` has a starter kit: folders, a schema, naming conventions, and an example note. Read it before proposing the blueprint.
83
- 3. **Volume and cadence** — a system for 5 notes a week looks different from one for 50. Light use → fewer folders, fewer required fields.
84
- 4. **One real example per domain** — "tell me about a task on your plate right now" / "one subscription you pay for". These become the seed notes in Phase 3 and make every later phase concrete instead of hypothetical.
85
- 5. **What they've tried before** — if a previous system failed, find out why. Design against that failure.
86
-
87
- Start with 2–3 domains even if they're excited about six. A small system that works grows; a sprawling empty scaffold dies. Note the deferred domains for Phase 6.
88
-
89
- ## Phase 2 — Blueprint
90
-
91
- Read `references/conventions.md` and `references/schema-guide.md` now if you haven't. Then present ONE document (in chat, not yet written anywhere) containing:
92
-
93
- 1. **Folder tree** — the full proposed directory structure with one-line purpose per folder. Include `Schemas/`, `Templates/`, and an `Instructions/` (or `Meta/`) folder alongside the domain folders.
94
- 2. **Schemas table** — one row per note type: schema name, note_type, required observations, optional observations, status enum values.
95
- 3. **Naming conventions** — title format per note type, date formats, status vocabularies.
96
- 4. **Instruction notes** — the startup router plus one instruction note per domain (see `references/conventions.md` for anatomy).
97
- 5. **The discipline rules** they'll live by — search before create, exact-casing paths, changelog rows, index updates, bidirectional links — each with a one-line "why".
98
-
99
- Walk through it, invite pushback, and iterate. Scale to their answers — but scaling means fewer folders, fewer indexes, and fewer *required* fields, never dropping schemas or observations (see the non-negotiables above). Get an explicit "yes, build it" before Phase 3.
100
-
101
- ## Phase 3 — Build
102
-
103
- Build in this order — later items reference earlier ones:
104
-
105
- 1. **Schemas** → `Schemas/` folder, one note per type, `validation: warn`. Syntax in `references/schema-guide.md`.
106
- 2. **Templates** → `Templates/`, one per note type, matching the schema exactly.
107
- 3. **Instruction notes** → per-domain rules notes, then the **startup router** last (it links everything). Full anatomy and a worked example in `references/conventions.md`.
108
- 4. **Index notes** → one per domain that needs one (tables of contents; not every domain does).
109
- 5. **Migrate existing notes** *(restructure path)* → execute the approved old→new mapping from Phase 2 before seeding anything: move each existing note to its new home, set its note type, add the observations its schema requires, and update indexes as notes land. Archive what doesn't fit — never delete. Phase 3 is not done while anything still sits unorganized at the root.
110
- 6. **Seed notes** → 2–3 REAL notes per domain using the examples collected in Phase 1. Never seed with placeholder data — real notes teach the format and are immediately useful; fake ones are noise the user must delete.
111
- 7. **Validate** → run `bm_schema(command="validate", project="<project>")` on the seed notes AND any migrated notes; fix anything it flags. Read back the router and one instruction note to confirm links resolve.
112
-
113
- Follow the write discipline in `references/conventions.md` throughout — most importantly: search before creating anything, use exact folder casing, and watch write results for duplicate-suffixed permalinks (`-1`, `-2`).
114
-
115
- ## Phase 4 — Assistant setup
116
-
117
- The system only works if the assistant loads the rules every session — otherwise the user is the only one who knows the conventions, which defeats the point.
118
-
119
- Read `references/assistant-setup.md` and set up (or hand the user exact text for) a **persistent instruction stub**: a short block in whatever always-loaded mechanism their platform provides (project instructions, custom instructions, system prompt, agent context file) that says, in essence: *"Before any knowledge-base work, read the startup router note in project X and follow its dispatch table."*
120
-
121
- Identify what mechanism YOUR platform offers and give concrete, platform-specific steps. If you cannot determine the platform, present the generic stub and the common placements from the reference file. End Phase 4 with the verification test described there (simulate a fresh session; confirm the router gets loaded and followed).
122
-
123
- ## Phase 5 — Teach
124
-
125
- Teach by doing, with their data — not by lecturing. Run short exercises:
126
-
127
- 1. **Capture** — "Tell me something that came up today" → create the note together, narrating the schema fields and observations as you fill them.
128
- 2. **Retrieve** — have them ask for something ("what's on my plate?", "what do I know about X?") → demonstrate `bm_search` and reading via `memory://` links; explain title-search vs semantic search for names.
129
- 3. **Update** — change a status, append an observation, add a changelog row — showing `bm_edit` for targeted changes vs full overwrites.
130
- 4. **Connect** — add a relation between two of their notes; show how `bm_context` walks the graph.
131
-
132
- Then write a **cheat-sheet note** into their KB (`Instructions/` folder): the phrases they can say, what happens for each, and the core rules. This note is theirs — written for a human, not an assistant.
133
-
134
- ## Phase 6 — Grow
135
-
136
- Close the onboarding by opening doors:
137
-
138
- - **Suggest 2–3 specific expansions** drawn from their deferred Phase 1 domains or natural neighbors of what they built (built tasks → suggest meetings; built finances → suggest renewals calendar; built research → suggest a reading log). Frame each as "when you're ready" — never build unrequested.
139
- - **Maintenance cadence** — suggest a periodic (weekly/monthly) review: `bm_schema(command="diff", project="<project>")` for drift, scan for duplicate or orphaned notes, prune stale statuses. If their platform supports scheduled/recurring tasks, offer to set this up.
140
- - **Evolution rule** — when a convention starts to chafe, change the instruction note (with a changelog row), don't silently deviate. The system stays self-describing only if the rules in it stay true.
141
-
142
- ## Reference files
143
-
144
- | File | Read when |
145
- |:--|:--|
146
- | `references/conventions.md` | Before Phase 2. Startup router anatomy, instruction notes, changelogs, indexes, linking, write discipline, failure modes. |
147
- | `references/schema-guide.md` | Before Phase 2. Picoschema syntax, observations, relations, validation workflow. |
148
- | `references/domain-playbooks.md` | Phase 1–2, for each domain the user picks. Starter folders, schemas, naming, example notes per domain. |
149
- | `references/assistant-setup.md` | Phase 4. Persistent-instruction stub patterns per platform + verification test. |
150
-
151
- ## Related Skills
152
-
153
- When companion skills are installed alongside this one, hand off instead of duplicating: **memory-notes** and **memory-schema** for note-writing and schema mechanics, **memory-tasks** for agent-side task tracking, **memory-lifecycle** for archival on the restructure path, **memory-defrag** / **memory-curate** / **memory-reflect** for the Phase 6 maintenance cadence, and **memory-continue** for resuming work from the graph — a natural first thing to teach after onboarding.
@@ -1,29 +0,0 @@
1
- {
2
- "skill_name": "memory-onboarding",
3
- "evals": [
4
- {
5
- "id": 0,
6
- "eval_name": "no-idea-newbie",
7
- "prompt": "I just connected Basic Memory to my assistant but honestly I have no idea what to actually use it for. People talk about 'second brains' but I don't know where to start. Can you help me get set up with something useful?",
8
- "persona": "Sam, marketing coordinator. When offered suggestions, is drawn to: tasks (loses track of follow-ups) and subscriptions (pays for services they forgot about). Light volume — maybe 5-10 notes a week. Real examples when asked: task 'send the Q3 sponsorship deck to Rivera Media by Friday'; subscriptions: Netflix $15.49/mo, Adobe CC $59.99/mo renews annually in March, a gym membership $40/mo they keep meaning to cancel. Uses a chat assistant that supports projects with custom instructions. Never tried a note system before.",
9
- "expected_output": "Interview → blueprint scaled small (2 domains) → built KB with Task + Subscription schemas, Task Board and Subscriptions Index, instruction notes + startup router, seed notes using Sam's real examples, assistant stub for project instructions, cheat-sheet.",
10
- "files": []
11
- },
12
- {
13
- "id": 1,
14
- "eval_name": "freelance-photographer",
15
- "prompt": "I want to use Basic Memory to run my freelance photography business — keeping track of my clients, upcoming shoots, what I've invoiced, and all my camera gear. Set me up with a good structure that my AI assistant can work with consistently.",
16
- "persona": "Priya, wedding/portrait photographer. ~3 shoots a month. Clients: couples and a few corporate accounts. Wants per-client history. Invoices tracked simply: date, client, amount, paid/unpaid (accounting itself stays in her accounting software). Gear: 2 bodies (Canon R5 serial 0482xx, R6), 6 lenses, lighting kit — wants serials and purchase dates for insurance. Real examples: upcoming shoot 'Chen-Okafor wedding Sept 12 at Maple Grove Estate, second shooter booked'; unpaid invoice 'Hartley corporate headshots $850 sent July 2'. Uses a desktop AI app with per-project custom instructions.",
17
- "expected_output": "Blueprint with Clients/People, Shoots (project-like), Invoices (finance playbook adapted: no secrets, amounts from user only), Gear (assets playbook: serials, insurance index), schemas + router + instruction notes, seeds from her real examples, stub for project instructions, bidirectional client↔shoot links.",
18
- "files": []
19
- },
20
- {
21
- "id": 2,
22
- "eval_name": "messy-restructure",
23
- "prompt": "My Basic Memory project is a mess — like 30 random notes dumped in the root folder, no organization, half of them are ideas for my blog and the rest are random todos. I want an actual system: task tracking, and proper research organization for my blog posts. And I want my assistant to actually follow the same rules every session instead of doing something different each time.",
24
- "persona": "Jordan, writes a woodworking blog. Existing project 'main' has ~30 root-level notes with inconsistent naming (some lowercase, some dated, e.g. 'bandsaw jig idea', '2026-05-02 misc', 'todo dump', 'japanese joinery links'). Wants: tasks, and blog research (topic → sources → draft outline). Blog posts monthly. Real examples: active research topic 'hand-cut dovetails vs router jigs' with 4 saved links; task 'edit the shop-tour video by end of July'. Uses a CLI assistant that auto-loads a context file from the home directory.",
25
- "expected_output": "Restructure path: assess existing notes, propose old→new mapping BEFORE moving, build tasks + research structure (topic hubs), schemas + router with known-failure-modes seeded from their actual mess (casing, duplicates), stub written for an agent context file, verification test described.",
26
- "files": []
27
- }
28
- ]
29
- }
@@ -1,72 +0,0 @@
1
- # Assistant Setup — Loading Instructions Every Session
2
-
3
- The knowledge base is self-describing: its rules live in instruction notes inside it. But a fresh assistant session doesn't know those notes exist. This reference covers the last mile — a **persistent instruction stub** in whatever always-loaded mechanism the user's platform provides, pointing at the startup router.
4
-
5
- ## The stub pattern
6
-
7
- The stub is deliberately tiny. It carries only:
8
-
9
- 1. Which Basic Memory **project** to use (always, explicitly)
10
- 2. The instruction to **read the startup router before any knowledge-base work** and follow its dispatch table
11
- 3. The 3–5 rules that must hold **before** the router loads (because they govern the loading itself)
12
- 4. The **memory routine**: when to look things up and when to offer to save, in the same words Memory Quest uses
13
-
14
- Everything else — conventions, schemas, workflows, reference data — lives in the router and the notes it dispatches to. This keeps the always-loaded footprint small and means the user edits notes, not platform settings, when conventions change.
15
-
16
- ### Stub template
17
-
18
- Adapt the wording; keep the shape:
19
-
20
- ```
21
- You maintain my knowledge base in Basic Memory, project "{project-name}".
22
-
23
- Rules that apply before anything else:
24
- 1. Every Basic Memory call (read, search, write, list) uses project "{project-name}" explicitly.
25
- 2. At the start of every session, before any knowledge-base work, read the note
26
- "Startup Router" (memory://instructions/startup-router) and follow its dispatch
27
- table for the task at hand. If that reference doesn't resolve, search for the
28
- note by title before doing anything else. Take no write actions until the
29
- notes it lists are loaded.
30
- 3. Folder paths use exact casing as given in the instruction notes.
31
- 4. Before overwriting any existing note, read it in full first.
32
- 5. When unsure where something belongs, ask me instead of guessing.
33
-
34
- Memory routine:
35
- When a new task could benefit from prior knowledge, use Basic Memory at the start to find and read relevant context before proceeding. Choose the relevant project; ask me if the project is unclear. Use what you find during the work and make clear which prior decisions or notes informed your answer. If no relevant memory exists, say so and continue without inventing it.
36
-
37
- At the end, offer to save useful decisions, outcomes, or lessons to the relevant Basic Memory project. Follow my saving preferences and ask for approval by default. Update an existing relevant note when appropriate. Do not automatically capture every conversation or save sensitive details unnecessarily.
38
- ```
39
-
40
- Rules 1, 3, 4 are in the stub rather than the router because they protect the system even if the router fails to load or has been corrupted.
41
-
42
- The memory routine is the same text the Basic Memory web app's Memory Quest panel asks users to save, so keep it word for word: a user who already saved it there should find nothing new to add, only the project and router rules above it. It runs after the router loads and governs the rest of the session: when to look things up, and asking before saving. Rule 1 names the project, so "the relevant project" is "{project-name}" unless the user has others.
43
-
44
- ## Where the stub goes
45
-
46
- Determine what platform and mechanism **you** are running in, and give the user concrete steps for it. Common mechanisms, by shape rather than brand:
47
-
48
- | Mechanism shape | Typical examples | How to place the stub |
49
- |:--|:--|:--|
50
- | **Project-level instructions** | A "project" or "space" in a chat app with a custom-instructions field | Paste the stub into the project instructions. Best option when available — scoped, persistent, and editable. |
51
- | **Global custom instructions / personalization** | Account-level "how should I respond" settings | Works, but applies to every conversation — wrap the stub in "When I ask about my knowledge base: ...". |
52
- | **Agent context files** | A markdown file the agent auto-loads from the working directory or home directory (many CLI/desktop agents support one) | Add the stub as a section of that file. |
53
- | **System prompt** | Self-hosted assistants, API integrations, custom apps | Prepend the stub to the system prompt. |
54
- | **No persistent mechanism** | Bare chat with MCP tools | Fall back: create a note titled something unmissable like `START HERE — Assistant Instructions` at the KB root, and teach the user to open each session with "read Start Here first". Weakest option; say so honestly. |
55
-
56
- If you can't determine the platform, show the stub and this table and let the user place it. If the user runs the KB from multiple assistants/platforms (desktop app + CLI + phone), place the stub in each — the router being shared is exactly what keeps them consistent.
57
-
58
- ## The router reference must be durable
59
-
60
- Inside the stub, give the router's **title and `memory://` path together, with a title-search fallback** — never a raw permalink string copied from a tool result. No single identifier is unconditionally durable: a retitled note breaks title lookups, a recreated note derives a fresh permalink, and a moved note's path changes when `update_permalinks_on_move` is enabled (it defaults to off). The stub is the one piece of the system that isn't a note and won't be caught by note-level maintenance, so it carries both identifiers plus the fallback — that combination self-heals when any one of them goes stale.
61
-
62
- ## Verification test
63
-
64
- Never call Phase 4 done without testing. With the user:
65
-
66
- 1. **Simulate a fresh session** — new conversation on their platform (or in this session, deliberately act as if starting cold).
67
- 2. Give a natural task from one of their domains: "add a task: call the dentist Tuesday."
68
- 3. **Watch the order of operations.** Pass = the assistant reads the router, loads the dispatched instruction note(s), THEN writes — correct folder, correct schema fields, correct naming. Fail = it writes first or freelances the format.
69
- 4. If it fails: is the stub actually saved? Does the router reference resolve (test with `bm_read`)? Is the "before any knowledge-base work" wording strong enough? Fix and re-test.
70
- 5. Also verify the **escape hatch**: ask something ambiguous ("save this somewhere") and confirm the assistant asks rather than guesses.
71
-
72
- Leave the user with this framing: the stub + router is the system's ignition. If future sessions ever start behaving inconsistently, the first diagnostic is always "did the router get loaded?"
@@ -1,118 +0,0 @@
1
- # Conventions & Discipline
2
-
3
- The structural patterns that keep a Basic Memory knowledge base coherent as it grows. These are defaults, not laws — but each exists because its absence causes a specific, recurring failure. When you relax one for a light-use setup, tell the user what they're trading away.
4
-
5
- ## Contents
6
-
7
- 1. [The startup router](#the-startup-router)
8
- 2. [Instruction notes](#instruction-notes)
9
- 3. [Changelog tables](#changelog-tables)
10
- 4. [Index notes](#index-notes)
11
- 5. [Linking discipline](#linking-discipline)
12
- 6. [Write discipline](#write-discipline)
13
- 7. [Known failure modes](#known-failure-modes)
14
-
15
- ---
16
-
17
- ## The startup router
18
-
19
- One note — suggested location `Instructions/Startup Router` — that any assistant reads at the start of every session, before doing any knowledge-base work. It is the single entry point to the whole system. It contains:
20
-
21
- 1. **A read-me-first banner** — "Read this note at the start of every session, before any task work."
22
- 2. **Non-negotiable rules** — the handful of rules that apply to every task type and can't be overridden by anything else (e.g. "always search before creating", "always pass the project name explicitly"). Keep this list short — five to eight items. A rule that only matters for one domain belongs in that domain's instruction note instead.
23
- 3. **A dispatch table** — task type → which notes to load, in order:
24
-
25
- | Task type | Load in order |
26
- |:--|:--|
27
- | Task / project work | 1. `memory://instructions/task-instructions` · 2. `[[Task Board]]` |
28
- | New contact / person update | 1. `memory://instructions/people-instructions` |
29
- | Expense / subscription | 1. `memory://instructions/finance-instructions` · 2. `[[Subscriptions Index]]` |
30
- | Anything else / ambiguous | load all instruction notes |
31
-
32
- 4. **Known failure modes** — a running list of documented mistakes to check before writing (see below).
33
- 5. **Canonical reference data** — if the system has a roster-like table (accounts, categories, family members, clients), keep the ONE canonical copy here and make other notes point to it. Duplicated rosters drift apart; nobody notices until something routes to the wrong place.
34
-
35
- **Why a router instead of one big rules note:** context is finite. The router is small and always loaded; everything else loads only when the task needs it. It also gives the system one place to grow — a new domain is a new dispatch row, not a rewrite.
36
-
37
- The router itself is a note, so it gets a changelog table and observations like any other. When the user changes a convention, the change lands here or in a domain instruction note — with a changelog row — so the system stays self-describing.
38
-
39
- ## Instruction notes
40
-
41
- One note per domain (`Instructions/Task Instructions`, `Instructions/Finance Instructions`, ...) holding everything an assistant needs to work in that domain:
42
-
43
- - **Scope** — what this note covers and what it doesn't ("for vendor stuff, see [[Vendor Instructions]]")
44
- - **Folder map** — where each note type lives, with exact casing
45
- - **Schemas in play** — table of note types, their schema notes, and required observations
46
- - **Naming conventions** — title formats with examples, date formats, status vocabularies
47
- - **Workflows** — step-by-step for the recurring operations ("closing a task: 1. set `[status] done` 2. add close date 3. append row to [[Task Board]]")
48
- - **Domain-specific rules** — anything true here that isn't true globally
49
-
50
- Write instruction notes for a reader with zero context: the assistant loading it next month is effectively a stranger. Explain *why* behind rules that aren't obvious — an assistant that understands the reason applies the rule correctly in situations the rule didn't anticipate.
51
-
52
- ## Changelog tables
53
-
54
- Every structural or long-lived note carries exactly one changelog table, immediately below the title:
55
-
56
- ```markdown
57
- | Notes | Modification Date | Approved By |
58
- |:--|:--|:--|
59
- | Initial Document | July 12, 2026 | {user's name} |
60
- | Added renewal-date field to all subscription rows | August 3, 2026 | {user's name} |
61
- ```
62
-
63
- Rules:
64
- - **Append, never edit.** Existing rows are history; new rows record change.
65
- - **One table per note.** Before overwriting any existing note, read the full note first, carry the existing changelog forward verbatim, and append your row. If you ever find two tables, merge them into one at the top before writing.
66
- - **Consistent date format** — `Month D, YYYY` reads well in changelog rows. Any date you will query (a due date, a renewal, a warranty end) is ISO (`2026-07-20`) in frontmatter, and an observation qualifier (`- [due] @due:2026-07-20 ...`) so "what's due this month" is one search.
67
-
68
- Why: an assistant (or the user) reading a note months later can see what changed, when, and on whose authority — without any external version control. It also forces the read-before-overwrite habit that prevents accidental content loss.
69
-
70
- For a light setup, changelogs on *instruction notes, schemas, and indexes* are the non-negotiable core; changelogs on every individual content note are optional.
71
-
72
- ## Index notes
73
-
74
- An index is a note containing a table of contents for one domain — one row per note, with wiki-links and a few key columns (status, date, owner):
75
-
76
- ```markdown
77
- # Task Board
78
-
79
- | Task | Status | Due |
80
- |:--|:--|:--|
81
- | [[Fix gutter downspout]] | in-progress | July 20, 2026 |
82
- | [[Renew car registration]] | open | August 1, 2026 |
83
- ```
84
-
85
- Rules:
86
- - **Update the index as part of any change to its members** — a stale index is worse than none, because it gets trusted.
87
- - **Full overwrite, not section edits.** When updating an index with `bm_write`, always rewrite the whole note (read → modify → overwrite). Piecemeal section edits on tables are easy to get wrong — duplicated or mis-scoped sections — while a full overwrite is deterministic.
88
- - Not every domain needs one. Indexes earn their keep where the user will ask "show me all X with status Y" or wants a glanceable board. Journals and reference notes usually don't need one — search covers them.
89
-
90
- ## Linking discipline
91
-
92
- - **Bidirectional links for paired entities.** If a task note links its project, the project note links its tasks. If a device links its owner, the owner links the device. One-directional links rot: graph traversal from the unlinked side finds nothing. Make "both directions, always" a rule for whichever entity pairs the user's system has.
93
- - **Relations sections for typed links, inline wiki-links for prose.** `- part_of [[Kitchen Renovation]]` in Relations; "discussed with [[Dana Reyes]]" in the body. Both create graph edges.
94
- - **Reference notes by title or `memory://` path — never by raw permalink strings.** A permalink is derived from the note's title and location, so a note that gets recreated or re-derived ends up with a different one and hardcoded strings silently break. `[[Title]]` resolves by title and `memory://` URLs match on path, so both survive reorganization.
95
- - **Link targets may not exist yet.** `[[Future Note]]` is valid and resolves when the note is created — use this to sketch structure ahead of content.
96
-
97
- ## Write discipline
98
-
99
- The habits that prevent 90% of knowledge-base corruption:
100
-
101
- 1. **Search before create.** Always search (try 2–3 query variations: full name, abbreviation, keywords) before writing a new note. Duplicates fragment the graph. If the entity exists, `bm_edit` it instead. For people and other proper nouns, use **title search** — semantic search is unreliable for names.
102
- 2. **Exact casing, exact paths.** `Tasks/` and `tasks/` are different directories. Take folder paths from the instruction note, character for character. If a write would create a new top-level folder you didn't plan, that's a casing error — stop and fix.
103
- 3. **Explicit project on every call.** In multi-project setups, pass the project explicitly on every read, search, and write. Writes to the wrong project are invisible until much later.
104
- 4. **Read before overwrite.** Full-note overwrites must start from the current content — never reconstruct a note from memory of what it contained. Read as JSON and pass its `checksum` as `expected_checksum`; a revision conflict means someone else edited the note, so re-read before writing.
105
- 5. **Watch write results.** If a write returns a permalink ending in `-1` or `-2`, you just created a duplicate: delete it and re-write the original with overwrite semantics. Writing to an existing note without `overwrite=True` is refused with `ALREADY_EXISTS`, not duplicated. If the result lists similar existing notes, check them before keeping the new one.
106
- 6. **Prefer targeted edits.** `bm_edit` (append an observation, find-and-replace a status) over full overwrites wherever possible — smaller blast radius.
107
-
108
- ## Known failure modes
109
-
110
- Keep a "Known Failure Modes" section in the startup router and **add to it whenever a mistake happens twice**. Documented mistakes stop recurring; undocumented ones don't. Seed it during onboarding with the universal ones:
111
-
112
- - Duplicate notes from skipping search-before-create (or from name-search using semantic instead of title matching)
113
- - Wrong-casing paths creating parallel folder trees
114
- - Piecemeal section edits mangling index tables (duplicated or mis-scoped sections)
115
- - Second changelog table created by overwriting without reading first
116
- - Writes landing in the wrong project when project isn't passed explicitly
117
-
118
- Each entry: the mistake, how to recognize it, what to do instead. This list is the system's immune memory — it's often the highest-value section in the whole knowledge base.
@@ -1,159 +0,0 @@
1
- # Domain Playbooks
2
-
3
- Starter kits for the common things people track. Each gives folders, a schema sketch, naming, an index decision, and expansion ideas. These are starting points — adapt every one to the user's Phase 1 answers rather than installing verbatim. Statuses, folder names, and required fields should use the user's own vocabulary where they have one.
4
-
5
- Every domain also gets: an instruction note (`Instructions/{Domain} Instructions`), a row in the startup router's dispatch table, and templates for its note types.
6
-
7
- ## Contents
8
-
9
- 1. [Tasks & projects](#tasks--projects)
10
- 2. [Notes & journal](#notes--journal)
11
- 3. [People & contacts](#people--contacts)
12
- 4. [Research](#research)
13
- 5. [Finances](#finances)
14
- 6. [Procedures](#procedures)
15
- 7. [Health & habits](#health--habits)
16
- 8. [Assets](#assets)
17
-
18
- ---
19
-
20
- ## Tasks & projects
21
-
22
- ```
23
- Tasks/
24
- ├── Task Board.md ← index: open/in-progress tasks
25
- └── {task notes}
26
- Projects/
27
- ├── {Project Name}/ ← one folder per active multi-step project
28
- │ └── {Project Name}.md ← project note; links its tasks
29
- ```
30
-
31
- - **Task schema:** `status(enum): [open, in-progress, blocked, done]` · `due?` · `priority?(enum)` · `project?: Project`
32
- - **Project schema:** `status(enum): [active, paused, done]` · `goal` · `target_date?`
33
- - **Naming:** tasks get short imperative titles (`Renew car registration`); completed tasks can be retitled with a date prefix (`2026-07-12 — Renew car registration`) when archived, so archives sort chronologically.
34
- - **Index:** yes — the Task Board is usually the single most-used note in the system. Open items only; done tasks drop off the board (search finds them).
35
- - **Bidirectional rule:** task ↔ project, both directions. The `project?: Project` field is a relation field — satisfied by `- project [[Project Name]]` in the task's Relations (the relation type must match the field name for validation).
36
- - **Key workflow to document:** closing a task (set status, add close date, update board, move to archive folder if using one).
37
- - **Expansions:** meeting notes with action items that become tasks; a weekly-review note; recurring-task conventions.
38
-
39
- ## Notes & journal
40
-
41
- ```
42
- Journal/
43
- └── {YYYY-MM-DD}.md ← one note per day
44
- Notes/
45
- └── {topic notes} ← ideas, things learned, free-form
46
- ```
47
-
48
- - **Journal Entry schema (keep it tiny — one required field):** `date` · `mood?(enum)` · `highlight?`. Even the loosest domain gets a schema and observations — but here the observation load is deliberately one line (`- [date] 2026-07-12`, plus `[highlight]`/`[idea]`/`[mood]` when they apply), so capture stays frictionless.
49
- - **Note schema (topic notes):** `note_type?(enum): [idea, reference, learning]` — one optional field; the requirement is simply that every note carries at least one observation (`[idea]`, `[source]`, `[lesson]`...).
50
- - **Naming:** `YYYY-MM-DD` for journal (sorts itself); descriptive titles for topic notes.
51
- - **Index:** no. Date-named journals self-organize; topic notes are found by search.
52
- - **The one convention that matters:** when a journal entry mentions a person, project, or topic that has (or deserves) a note, wiki-link it. Journals become the connective tissue of the graph.
53
- - **Expansions:** weekly reflection summarizing the week's entries; automatic extraction of `[idea]` observations into topic notes.
54
-
55
- ## People & contacts
56
-
57
- ```
58
- People/
59
- └── {Full Name}.md ← one note per person
60
- ```
61
-
62
- - **Schema:** `relationship?(enum): [family, friend, coworker, professional, acquaintance]` · `email?` · `phone?` · `company?` · `last_contact?`
63
- - **Naming:** full name, consistently — `Dana Reyes`, never `dana` in one note and `Dana R.` in another. Titles are graph identifiers.
64
- - **Index:** optional — useful if the user wants a follow-up board (`last_contact` older than N months).
65
- - **Critical rule:** ALWAYS title-search (full name, then last name) before creating a person note — people are the most-duplicated entity type, and semantic search misses names.
66
- - **Body guidance:** this is where prose shines — how they met, what they care about, gift ideas, kids' names. Observations for the queryable bits (`- [birthday] March 12`).
67
- - **Expansions:** interaction log (`- [contact] @occurred:2026-07-12 Coffee, discussed job change` appended per touch); linking people to meetings, projects, gifts.
68
-
69
- ## Research
70
-
71
- ```
72
- Research/
73
- ├── {Topic}/
74
- │ ├── {Topic}.md ← topic hub: question, current understanding, links to sources
75
- │ └── {source notes} ← one note per significant source
76
- ```
77
-
78
- - **Topic schema:** `status(enum): [active, parked, concluded]` · `question` (what they're trying to answer)
79
- - **Source schema:** `source_type(enum): [article, paper, video, book, conversation]` · `url?` · `date_consumed?`
80
- - **Naming:** topic hubs by topic name; sources by title of the source.
81
- - **Index:** the topic hub IS the index for its sources.
82
- - **Key conventions:** every source note ends with `- part_of [[Topic]]`; the hub's "current understanding" section gets rewritten (with changelog row) as understanding evolves — the hub is a living synthesis, not an append-only log.
83
- - **Expansions:** a reading queue; `[claim]`/`[evidence]`/`[contradiction]` observation categories for contested topics; concluded-topic summaries.
84
-
85
- ## Finances
86
-
87
- ```
88
- Finances/
89
- ├── Subscriptions Index.md ← index: every recurring charge, cost, renewal date
90
- ├── Subscriptions/
91
- │ └── {Service}.md ← one note per subscription/recurring bill
92
- ├── Accounts/
93
- │ └── {Account}.md ← one note per account (no credentials — see below)
94
- └── Records/
95
- └── {YYYY-MM-DD} — {Description}.md ← one-off: big purchases, tax docs, claims
96
- ```
97
-
98
- - **Subscription schema:** `cost` · `billing_cycle(enum): [monthly, annual, quarterly]` · `renewal_date` · `payment_method?` · `status(enum): [active, cancelled, trial]`
99
- - **Naming:** records get `{YYYY-MM-DD} — {Description}`, dated by the document date, not the filing date.
100
- - **Index:** yes — the Subscriptions Index (name, cost, cycle, renewal, method) is the payoff note: total monthly spend at a glance, upcoming renewals visible.
101
- - **Two hard rules for the instruction note:** (1) **no secrets ever** — no account numbers beyond last-4, no passwords, no full card numbers; notes are plaintext markdown. (2) **amounts and payment methods come from the user or a document — never inferred or guessed.**
102
- - **Expansions:** annual-cost review workflow; warranty/receipt records linking to Assets; a renewals-this-month recurring check.
103
-
104
- ## Procedures
105
-
106
- ```
107
- Procedures/
108
- ├── {area}/ ← optional grouping: Home/, Tech/, Work/
109
- └── {Procedure Name}.md ← one note per how-to
110
- ```
111
-
112
- - **Schema:** `procedure_type(enum): [how-to, troubleshooting, checklist, reference]` · `applies_to?` · `last_verified?`
113
- - **Naming:** descriptive, search-first titles — the phrase the user would actually say (`Reset the water softener`, not `Softener maintenance procedure v2`).
114
- - **Index:** optional per area once a folder exceeds ~15 notes.
115
- - **Key conventions:** numbered steps; prerequisites up front; `last_verified` observation updated whenever the procedure is confirmed still-correct — and when a procedure is used and found wrong, fixing the note is part of finishing the task.
116
- - **Expansions:** seasonal checklists; linking procedures to the assets they service.
117
-
118
- ## Health & habits
119
-
120
- ```
121
- Health/
122
- ├── Log/
123
- │ └── {YYYY-MM-DD} — {type}.md ← workouts, symptoms, appointments
124
- └── {condition/goal notes} ← ongoing threads: an injury, a training goal
125
- ```
126
-
127
- - **Log schema:** `entry_type(enum): [workout, symptom, appointment, measurement]` · `date`
128
- - **Index:** optional — a current-goals note works better than a full log index.
129
- - **Key conventions:** log entries are quick and low-friction (two observations and a sentence beats an unfilled template); ongoing threads link their log entries so `bm_context` on "left knee" pulls the full history.
130
- - **Sensitivity note for the instruction file:** health data in plaintext markdown — the user should decide consciously what level of detail they're comfortable storing, and where the project syncs to.
131
- - **Expansions:** habit streaks; pre-appointment summaries generated from the log.
132
-
133
- ## Assets
134
-
135
- ```
136
- Assets/
137
- ├── Asset Index.md ← index: every asset, location, value band
138
- └── {Asset Name}.md ← one note per significant item
139
- ```
140
-
141
- - **Schema:** `asset_type(enum): [electronics, appliance, vehicle, furniture, tool, other]` · `serial_number?` · `purchase_date?` · `purchase_price?` · `warranty_until?` · `location?` · `status(enum): [in-use, stored, loaned, sold, disposed]`
142
- - **Naming:** `{Make} {Model}` or a distinguishing name (`Garage Freezer`); serial in observations, not the title.
143
- - **Index:** yes — this is the insurance-claim / "where is the..." note.
144
- - **Bidirectional rule:** if assets are assigned to people (family laptops), asset ↔ person, both directions.
145
- - **Expansions:** warranty-expiry checks; maintenance logs linking to Procedures; purchase records linking to Finances.
146
-
147
- ---
148
-
149
- ## Combining domains
150
-
151
- Domains compound through relations — mention these links when the user picks the pairs:
152
-
153
- - Tasks ↔ People (`waiting_on [[Dana Reyes]]`) · Tasks ↔ Projects
154
- - Finances ↔ Assets (purchase records ↔ asset notes)
155
- - Procedures ↔ Assets (`services [[Garage Freezer]]`)
156
- - Journal → everything (daily entries wiki-link whatever they mention)
157
- - Research ↔ Notes (ideas graduate into research topics)
158
-
159
- The cross-domain links are where a knowledge *graph* starts beating a folder of documents — surface one concrete example using the user's own notes during Phase 5.