@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.
- package/README.md +4 -4
- package/bm-client.ts +180 -49
- package/config.ts +5 -0
- package/dist/bm-client.d.ts +40 -20
- package/dist/bm-client.js +118 -29
- package/dist/config.d.ts +1 -0
- package/dist/config.js +1 -0
- package/dist/index.js +2 -3
- package/dist/memory/basic-memory-capability.js +7 -1
- package/dist/tools/schema-diff.js +5 -3
- package/dist/tools/schema-infer.js +1 -1
- package/dist/tools/schema-validate.js +5 -4
- package/index.ts +2 -3
- package/memory/basic-memory-capability.ts +7 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/scripts/setup-bm.sh +1 -4
- package/skills/manifest.json +5 -5
- package/skills/memory-agents/SKILL.md +12 -12
- package/skills/memory-capture/SKILL.md +1 -1
- package/skills/memory-comark/SKILL.md +1 -1
- package/skills/memory-continue/SKILL.md +8 -8
- package/skills/memory-curate/SKILL.md +2 -2
- package/skills/memory-defrag/SKILL.md +2 -2
- package/skills/memory-ingest/SKILL.md +4 -3
- package/skills/memory-lifecycle/SKILL.md +1 -1
- package/skills/memory-literary-analysis/SKILL.md +10 -10
- package/skills/memory-metadata-search/SKILL.md +1 -1
- package/skills/memory-notes/SKILL.md +1 -1
- package/skills/memory-okf/SKILL.md +1 -1
- package/skills/memory-quest/SKILL.md +9 -4
- package/skills/memory-reflect/SKILL.md +3 -3
- package/skills/memory-research/SKILL.md +1 -1
- package/skills/memory-schema/SKILL.md +14 -14
- package/skills/memory-start/SKILL.md +116 -0
- package/skills/memory-tasks/SKILL.md +5 -5
- package/tools/schema-diff.ts +7 -3
- package/tools/schema-infer.ts +1 -1
- package/tools/schema-validate.ts +5 -4
- package/skills/memory-onboarding/SKILL.md +0 -153
- package/skills/memory-onboarding/evals/evals.json +0 -29
- package/skills/memory-onboarding/references/assistant-setup.md +0 -72
- package/skills/memory-onboarding/references/conventions.md +0 -118
- package/skills/memory-onboarding/references/domain-playbooks.md +0 -159
- package/skills/memory-onboarding/references/schema-guide.md +0 -137
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
# Schemas, Observations & Relations
|
|
2
|
-
|
|
3
|
-
How to make notes structured enough to query and consistent enough to trust. This is the mechanical core of the system the onboarding builds.
|
|
4
|
-
|
|
5
|
-
## Contents
|
|
6
|
-
|
|
7
|
-
1. [Note anatomy](#note-anatomy)
|
|
8
|
-
2. [Observations](#observations)
|
|
9
|
-
3. [Relations](#relations)
|
|
10
|
-
4. [Picoschema syntax](#picoschema-syntax)
|
|
11
|
-
5. [Creating a schema](#creating-a-schema)
|
|
12
|
-
6. [Validation & drift](#validation--drift)
|
|
13
|
-
7. [Design guidelines](#design-guidelines)
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## Note anatomy
|
|
18
|
-
|
|
19
|
-
Every well-formed note has: frontmatter (title, type, tags — generated by `bm_write` from its parameters), a **body** of substantive prose, an **Observations** section, and a **Relations** section.
|
|
20
|
-
|
|
21
|
-
```markdown
|
|
22
|
-
# Fix Gutter Downspout
|
|
23
|
-
|
|
24
|
-
| Notes | Modification Date | Approved By |
|
|
25
|
-
|:--|:--|:--|
|
|
26
|
-
| Initial Document | July 12, 2026 | Dana Reyes |
|
|
27
|
-
|
|
28
|
-
Back downspout detached during the June storm; water is pooling against the
|
|
29
|
-
foundation on the north side. Needs a bracket and probably a new elbow section.
|
|
30
|
-
Hardware store trip required — measure the downspout diameter first (looks like 3x4).
|
|
31
|
-
|
|
32
|
-
## Observations
|
|
33
|
-
- [status] open
|
|
34
|
-
- [priority] high
|
|
35
|
-
- [due] @due:2026-07-20 Downspout fixed
|
|
36
|
-
- [context] home-maintenance
|
|
37
|
-
|
|
38
|
-
## Relations
|
|
39
|
-
- part_of [[House Projects]]
|
|
40
|
-
- relates_to [[June Storm Damage]]
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
**Write the body generously.** Search retrieves chunks from note bodies, so richer prose makes notes *more* discoverable, not less. Prose carries meaning; observations carry precision. A note that is only bullet-point observations reads like a database row and loses the context that makes it useful a year later.
|
|
44
|
-
|
|
45
|
-
## Observations
|
|
46
|
-
|
|
47
|
-
Categorized, atomic facts: `- [category] content #optional-tag`
|
|
48
|
-
|
|
49
|
-
- Categories are **free-form** — `[decision]`, `[status]`, `[symptom]`, `[cost]`, `[lesson]` — whatever fits. Consistency within a note type is what matters (and is what schemas enforce).
|
|
50
|
-
- **One fact per line.** `- [decision] Use JWT with 15-minute expiry` not a paragraph of three decisions.
|
|
51
|
-
- **Categories are queryable** — searching by category finds every note carrying that kind of fact.
|
|
52
|
-
- Tags add cross-cutting findability: `- [risk] no SLA on the API #vendor #reliability`.
|
|
53
|
-
|
|
54
|
-
In this system, observations do double duty: they're facts, and they're the **fields** schemas validate — for scalar, enum, and array fields. A Task schema requiring `status` means every task note carries `- [status] ...` as an observation. (Entity-reference fields validate against relations instead — see below.)
|
|
55
|
-
|
|
56
|
-
## Relations
|
|
57
|
-
|
|
58
|
-
Typed, directional links: `- relation_type [[Target Note Title]]`
|
|
59
|
-
|
|
60
|
-
- relation_type is a descriptive snake_case verb: `part_of`, `depends_on`, `assigned_to`, `replaces`, `paid_by`. Invent freely.
|
|
61
|
-
- Wiki-links in body prose also create edges (untyped `references`). Use the Relations section for the structural links, prose links for narrative mentions.
|
|
62
|
-
- Targets may not exist yet — forward links resolve on creation.
|
|
63
|
-
- `bm_context` on a `memory://` URL walks these edges to assemble connected context — this is what makes the graph worth building.
|
|
64
|
-
|
|
65
|
-
## Picoschema syntax
|
|
66
|
-
|
|
67
|
-
Schemas are notes (conventionally in a `Schemas/` folder) whose frontmatter metadata defines fields:
|
|
68
|
-
|
|
69
|
-
```yaml
|
|
70
|
-
schema:
|
|
71
|
-
status(enum): "[open, in-progress, blocked, done], current state"
|
|
72
|
-
due?: string, due date if any (YYYY-MM-DD)
|
|
73
|
-
priority?(enum): "[low, medium, high], urgency"
|
|
74
|
-
project?: Project, parent project note
|
|
75
|
-
steps?(array): string, ordered sub-steps
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
- Types: `string`, `integer`, `number`, `boolean`
|
|
79
|
-
- `?` suffix = optional field
|
|
80
|
-
- `(enum)` = fixed value list — use for anything status-like
|
|
81
|
-
- `(array)` = list field
|
|
82
|
-
- A capitalized type name (`Person`, `Project`) makes it a **relation field**, validated against the note's Relations section (the relation type must equal the field name: `- project [[Target Note]]`) — it creates a graph edge, not an observation
|
|
83
|
-
- Every field gets a comma-then-description: it's documentation the next assistant reads
|
|
84
|
-
|
|
85
|
-
## Creating a schema
|
|
86
|
-
|
|
87
|
-
```python
|
|
88
|
-
bm_write(
|
|
89
|
-
title="Task",
|
|
90
|
-
directory="Schemas",
|
|
91
|
-
note_type="schema",
|
|
92
|
-
metadata={
|
|
93
|
-
"entity": "Task",
|
|
94
|
-
"version": 1,
|
|
95
|
-
"schema": {
|
|
96
|
-
"status(enum)": "[open, in-progress, blocked, done], current state",
|
|
97
|
-
"due?": "string, due date (YYYY-MM-DD)",
|
|
98
|
-
"priority?(enum)": "[low, medium, high], urgency",
|
|
99
|
-
"project?": "Project, parent project"
|
|
100
|
-
},
|
|
101
|
-
"settings": {"validation": "warn"}
|
|
102
|
-
},
|
|
103
|
-
content="""# Task
|
|
104
|
-
|
|
105
|
-
Schema for task notes. Tasks live in Tasks/, titled with a short imperative
|
|
106
|
-
description. Status moves open → in-progress → done; blocked is a holding state.
|
|
107
|
-
|
|
108
|
-
## Observations
|
|
109
|
-
- [convention] Every task carries status as an observation
|
|
110
|
-
- [convention] Done tasks get a close-date appended before archiving""",
|
|
111
|
-
project="<project>",
|
|
112
|
-
)
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
Key points:
|
|
116
|
-
|
|
117
|
-
- **`validation: warn`, not `strict`** — the modes are `warn` and `strict`. Warn logs findings without blocking anything; `strict` escalates the same findings to errors. Start every schema on warn — a new user fighting rejected writes will abandon the system. Move a schema to `strict` only if something automated consumes the notes and malformed ones break it.
|
|
118
|
-
- **Content notes declare their type** via `note_type` matching the schema's entity (e.g. `note_type="task"`).
|
|
119
|
-
- **Scalar, enum, and array fields must appear as observations** in the note body (`- [status] open`) to satisfy validation — frontmatter-only values don't count. Putting them in both places gives you metadata search *and* schema validation. **Entity-reference fields are different**: they're satisfied by a relation, not an observation — a line in `## Relations` whose type matches the field name (`project?: Project` is satisfied by `- project [[Kitchen Renovation]]`).
|
|
120
|
-
- **Version in metadata** — bump on breaking changes (new required field, removed field, type change). Additive optional fields don't need a bump.
|
|
121
|
-
|
|
122
|
-
## Validation & drift
|
|
123
|
-
|
|
124
|
-
- `bm_schema(command="validate", note_type="task", project="<project>")` — check all notes of a type, or a single note via `identifier=`. It reports **missing required fields** and **invalid enum values** — that's the whole contract. Fields the schema doesn't declare are only counted as informational "unmatched" metadata (schemas are a subset, not a straitjacket), and scalar values are not type-checked, so a clean validate doesn't guarantee more than required-field presence and enum conformance. Use `bm_schema(command="diff", project="<project>")` to surface undeclared fields.
|
|
125
|
-
- `bm_schema(command="diff", note_type="task", project="<project>")` — finds drift: fields notes use that the schema doesn't define (candidates to add as optional), and schema fields nobody uses (candidates to drop).
|
|
126
|
-
- `bm_schema(command="infer", note_type="task", project="<project>")` — when notes of a type already exist without a schema, infer one from their actual structure instead of designing from scratch.
|
|
127
|
-
|
|
128
|
-
Evolution loop: `bm_schema(command="diff", project="<project>")` → edit the schema note (append changelog row, bump version if breaking) → `bm_schema(command="validate", project="<project>")` → fix outliers. Suggest the user run this monthly-ish once the system has real volume.
|
|
129
|
-
|
|
130
|
-
## Design guidelines
|
|
131
|
-
|
|
132
|
-
- **Every note type gets a schema; every note gets observations.** These two are not scale-dependent. A domain the user wants "loose" gets a one-field schema and a one-observation minimum, not an exemption — unstructured notes can't be queried, validated, or trusted by a future assistant, and retrofitting structure later is far more expensive than carrying one line now.
|
|
133
|
-
- **2–4 required fields, everything else optional.** Required fields are a tax on every note; each one must earn its place. Status almost always earns it. `notes_from_that_one_meeting` does not.
|
|
134
|
-
- **Enums for anything status-like.** Free-text statuses drift (`done`, `Done`, `finished`, `complete ✓`) and become unqueryable. Define the vocabulary in the schema and list it in the domain instruction note.
|
|
135
|
-
- **Schema per entity type, not per folder.** A `Person` schema serves contacts, family, and coworkers even if they live in different folders.
|
|
136
|
-
- **Don't over-constrain.** A schema describes common structure; it is not a straitjacket. If the user fights a field during the first week, make it optional or delete it.
|
|
137
|
-
- **Schemas are documentation.** Even at `warn` with validation never run, the schema note tells the next assistant exactly what a conforming note looks like. Write field descriptions accordingly.
|