@basicmemory/openclaw-basic-memory 0.1.3 → 0.1.4
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 +1 -0
- package/commands/skills.ts +25 -25
- package/commands/slash.ts +32 -0
- package/openclaw.plugin.json +7 -4
- package/package.json +4 -1
- package/scripts/fetch-skills.ts +133 -0
- package/skills/manifest.json +47 -0
- package/skills/memory-defrag/SKILL.md +0 -1
- package/skills/memory-ingest/SKILL.md +309 -0
- package/skills/memory-lifecycle/SKILL.md +182 -0
- package/skills/memory-metadata-search/SKILL.md +37 -63
- package/skills/memory-notes/SKILL.md +111 -35
- package/skills/memory-reflect/SKILL.md +14 -4
- package/skills/memory-research/SKILL.md +235 -0
- package/skills/memory-schema/SKILL.md +35 -35
- package/skills/memory-tasks/SKILL.md +31 -27
package/README.md
CHANGED
|
@@ -152,6 +152,7 @@ All tools accept an optional `project` parameter for cross-project operations.
|
|
|
152
152
|
|
|
153
153
|
| Command | Description |
|
|
154
154
|
|---------|-------------|
|
|
155
|
+
| `/bm-setup` | Install or update the Basic Memory CLI |
|
|
155
156
|
| `/remember <text>` | Save a quick note |
|
|
156
157
|
| `/recall <query>` | Search the knowledge graph |
|
|
157
158
|
| `/tasks [args]` | Create, track, resume structured tasks |
|
package/commands/skills.ts
CHANGED
|
@@ -5,39 +5,39 @@ import type { OpenClawPluginApi } from "openclaw/plugin-sdk"
|
|
|
5
5
|
|
|
6
6
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
7
7
|
const SKILLS_DIR = resolve(__dirname, "..", "skills")
|
|
8
|
+
const MANIFEST_PATH = resolve(SKILLS_DIR, "manifest.json")
|
|
9
|
+
|
|
10
|
+
interface ManifestEntry {
|
|
11
|
+
dir: string
|
|
12
|
+
name: string
|
|
13
|
+
description: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function loadManifest(): ManifestEntry[] {
|
|
17
|
+
try {
|
|
18
|
+
const raw = readFileSync(MANIFEST_PATH, "utf-8")
|
|
19
|
+
return JSON.parse(raw) as ManifestEntry[]
|
|
20
|
+
} catch {
|
|
21
|
+
throw new Error(
|
|
22
|
+
"skills/manifest.json not found. Run `bun scripts/fetch-skills.ts` first.",
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
8
26
|
|
|
9
27
|
function loadSkill(dir: string): string {
|
|
10
28
|
return readFileSync(resolve(SKILLS_DIR, dir, "SKILL.md"), "utf-8")
|
|
11
29
|
}
|
|
12
30
|
|
|
13
|
-
const SKILLS = [
|
|
14
|
-
{ name: "tasks", dir: "memory-tasks", desc: "Task management workflow" },
|
|
15
|
-
{
|
|
16
|
-
name: "reflect",
|
|
17
|
-
dir: "memory-reflect",
|
|
18
|
-
desc: "Memory reflection workflow",
|
|
19
|
-
},
|
|
20
|
-
{ name: "defrag", dir: "memory-defrag", desc: "Memory defrag workflow" },
|
|
21
|
-
{ name: "schema", dir: "memory-schema", desc: "Schema management workflow" },
|
|
22
|
-
{
|
|
23
|
-
name: "notes",
|
|
24
|
-
dir: "memory-notes",
|
|
25
|
-
desc: "How to write well-structured notes",
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
name: "metadata-search",
|
|
29
|
-
dir: "memory-metadata-search",
|
|
30
|
-
desc: "Structured metadata search workflow",
|
|
31
|
-
},
|
|
32
|
-
] as const
|
|
33
|
-
|
|
34
31
|
export function registerSkillCommands(api: OpenClawPluginApi): void {
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
const manifest = loadManifest()
|
|
33
|
+
|
|
34
|
+
for (const entry of manifest) {
|
|
35
|
+
const commandName = entry.dir.replace(/^memory-/, "")
|
|
36
|
+
const content = loadSkill(entry.dir)
|
|
37
37
|
|
|
38
38
|
api.registerCommand({
|
|
39
|
-
name:
|
|
40
|
-
description:
|
|
39
|
+
name: commandName,
|
|
40
|
+
description: entry.description,
|
|
41
41
|
acceptsArgs: true,
|
|
42
42
|
requireAuth: true,
|
|
43
43
|
handler: async (ctx: { args?: string }) => {
|
package/commands/slash.ts
CHANGED
|
@@ -1,11 +1,43 @@
|
|
|
1
|
+
import { execSync } from "node:child_process"
|
|
2
|
+
import { dirname, resolve } from "node:path"
|
|
3
|
+
import { fileURLToPath } from "node:url"
|
|
1
4
|
import type { OpenClawPluginApi } from "openclaw/plugin-sdk"
|
|
2
5
|
import type { BmClient } from "../bm-client.ts"
|
|
3
6
|
import { log } from "../logger.ts"
|
|
4
7
|
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
9
|
+
|
|
5
10
|
export function registerCommands(
|
|
6
11
|
api: OpenClawPluginApi,
|
|
7
12
|
client: BmClient,
|
|
8
13
|
): void {
|
|
14
|
+
api.registerCommand({
|
|
15
|
+
name: "bm-setup",
|
|
16
|
+
description: "Install or update the Basic Memory CLI (requires uv)",
|
|
17
|
+
requireAuth: true,
|
|
18
|
+
handler: async () => {
|
|
19
|
+
const scriptPath = resolve(__dirname, "..", "scripts", "setup-bm.sh")
|
|
20
|
+
log.info(`/bm-setup: running ${scriptPath}`)
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
const output = execSync(`bash "${scriptPath}"`, {
|
|
24
|
+
encoding: "utf-8",
|
|
25
|
+
timeout: 180_000,
|
|
26
|
+
stdio: "pipe",
|
|
27
|
+
env: { ...process.env },
|
|
28
|
+
})
|
|
29
|
+
return { text: output.trim() }
|
|
30
|
+
} catch (err: unknown) {
|
|
31
|
+
const execErr = err as { stderr?: string; stdout?: string }
|
|
32
|
+
const detail = execErr.stderr || execErr.stdout || String(err)
|
|
33
|
+
log.error("/bm-setup failed", err)
|
|
34
|
+
return {
|
|
35
|
+
text: `Setup failed:\n${detail.trim()}`,
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
})
|
|
40
|
+
|
|
9
41
|
api.registerCommand({
|
|
10
42
|
name: "remember",
|
|
11
43
|
description: "Save something to the Basic Memory knowledge graph",
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
"id": "openclaw-basic-memory",
|
|
3
3
|
"kind": "memory",
|
|
4
4
|
"skills": [
|
|
5
|
-
"skills/memory-tasks",
|
|
6
|
-
"skills/memory-reflect",
|
|
7
5
|
"skills/memory-defrag",
|
|
8
|
-
"skills/memory-
|
|
6
|
+
"skills/memory-ingest",
|
|
7
|
+
"skills/memory-lifecycle",
|
|
9
8
|
"skills/memory-metadata-search",
|
|
10
|
-
"skills/memory-notes"
|
|
9
|
+
"skills/memory-notes",
|
|
10
|
+
"skills/memory-reflect",
|
|
11
|
+
"skills/memory-research",
|
|
12
|
+
"skills/memory-schema",
|
|
13
|
+
"skills/memory-tasks"
|
|
11
14
|
],
|
|
12
15
|
"uiHints": {
|
|
13
16
|
"project": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@basicmemory/openclaw-basic-memory",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Basic Memory plugin for OpenClaw — local-first knowledge graph for agent memory",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"schema/task-schema.ts",
|
|
36
36
|
"schema/conversation-schema.ts",
|
|
37
37
|
"skills/",
|
|
38
|
+
"scripts/fetch-skills.ts",
|
|
38
39
|
"scripts/setup-bm.sh",
|
|
39
40
|
"openclaw.plugin.json",
|
|
40
41
|
"README.md",
|
|
@@ -55,6 +56,8 @@
|
|
|
55
56
|
"check-types": "tsc --noEmit",
|
|
56
57
|
"lint": "bunx @biomejs/biome ci .",
|
|
57
58
|
"lint:fix": "bunx @biomejs/biome check --write .",
|
|
59
|
+
"fetch-skills": "bun scripts/fetch-skills.ts",
|
|
60
|
+
"prepack": "bun scripts/fetch-skills.ts",
|
|
58
61
|
"test": "bun test",
|
|
59
62
|
"test:int": "BM_INTEGRATION=1 BM_BIN=${BM_BIN:-./scripts/bm-local.sh} bun test integration --timeout 120000",
|
|
60
63
|
"test:coverage": "bun test --coverage",
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fetch all memory-* skills from basicmachines-co/basic-memory-skills.
|
|
3
|
+
*
|
|
4
|
+
* Auto-discovers skill directories via GitHub Contents API, downloads each
|
|
5
|
+
* SKILL.md, writes to skills/<dir>/SKILL.md, and generates skills/manifest.json.
|
|
6
|
+
*
|
|
7
|
+
* Env vars:
|
|
8
|
+
* GITHUB_TOKEN — optional, avoids 60 req/hr unauthenticated rate limit
|
|
9
|
+
* SKILLS_BRANCH — branch to fetch from (default: "main")
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { mkdirSync, writeFileSync } from "node:fs"
|
|
13
|
+
import { dirname, resolve } from "node:path"
|
|
14
|
+
import { fileURLToPath } from "node:url"
|
|
15
|
+
|
|
16
|
+
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
17
|
+
const SKILLS_DIR = resolve(__dirname, "..", "skills")
|
|
18
|
+
|
|
19
|
+
const REPO = "basicmachines-co/basic-memory-skills"
|
|
20
|
+
const BRANCH = process.env.SKILLS_BRANCH ?? "main"
|
|
21
|
+
const TOKEN = process.env.GITHUB_TOKEN
|
|
22
|
+
|
|
23
|
+
interface GitHubEntry {
|
|
24
|
+
name: string
|
|
25
|
+
type: "file" | "dir"
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface SkillManifestEntry {
|
|
29
|
+
dir: string
|
|
30
|
+
name: string
|
|
31
|
+
description: string
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function headers(): Record<string, string> {
|
|
35
|
+
const h: Record<string, string> = {
|
|
36
|
+
Accept: "application/vnd.github.v3+json",
|
|
37
|
+
"User-Agent": "openclaw-basic-memory/fetch-skills",
|
|
38
|
+
}
|
|
39
|
+
if (TOKEN) h.Authorization = `Bearer ${TOKEN}`
|
|
40
|
+
return h
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async function fetchJSON<T>(url: string): Promise<T> {
|
|
44
|
+
const res = await fetch(url, { headers: headers() })
|
|
45
|
+
if (!res.ok) {
|
|
46
|
+
throw new Error(`GET ${url} → ${res.status} ${res.statusText}`)
|
|
47
|
+
}
|
|
48
|
+
return res.json() as Promise<T>
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async function fetchText(url: string): Promise<string> {
|
|
52
|
+
const res = await fetch(url, { headers: headers() })
|
|
53
|
+
if (!res.ok) {
|
|
54
|
+
throw new Error(`GET ${url} → ${res.status} ${res.statusText}`)
|
|
55
|
+
}
|
|
56
|
+
return res.text()
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function parseFrontmatter(md: string): { name: string; description: string } {
|
|
60
|
+
const match = md.match(/^---\r?\n([\s\S]*?)\r?\n---/)
|
|
61
|
+
if (!match) throw new Error("SKILL.md missing YAML frontmatter")
|
|
62
|
+
|
|
63
|
+
const yaml = match[1]
|
|
64
|
+
const name = yaml
|
|
65
|
+
.match(/^name:\s*(.+)$/m)?.[1]
|
|
66
|
+
?.trim()
|
|
67
|
+
.replace(/^["']|["']$/g, "")
|
|
68
|
+
const description = yaml
|
|
69
|
+
.match(/^description:\s*(.+)$/m)?.[1]
|
|
70
|
+
?.trim()
|
|
71
|
+
.replace(/^["']|["']$/g, "")
|
|
72
|
+
|
|
73
|
+
if (!name) throw new Error("Frontmatter missing 'name'")
|
|
74
|
+
if (!description) throw new Error("Frontmatter missing 'description'")
|
|
75
|
+
|
|
76
|
+
return { name, description }
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async function main() {
|
|
80
|
+
console.log(`Fetching skills from ${REPO}@${BRANCH}`)
|
|
81
|
+
|
|
82
|
+
// 1. Discover all memory-* directories
|
|
83
|
+
const contentsUrl = `https://api.github.com/repos/${REPO}/contents?ref=${BRANCH}`
|
|
84
|
+
const entries = await fetchJSON<GitHubEntry[]>(contentsUrl)
|
|
85
|
+
const skillDirs = entries
|
|
86
|
+
.filter((e) => e.type === "dir" && e.name.startsWith("memory-"))
|
|
87
|
+
.map((e) => e.name)
|
|
88
|
+
.sort()
|
|
89
|
+
|
|
90
|
+
if (skillDirs.length === 0) {
|
|
91
|
+
throw new Error("No memory-* directories found in repo")
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
console.log(`Found ${skillDirs.length} skills: ${skillDirs.join(", ")}`)
|
|
95
|
+
|
|
96
|
+
// 2. Download each SKILL.md and parse frontmatter
|
|
97
|
+
const manifest: SkillManifestEntry[] = []
|
|
98
|
+
|
|
99
|
+
const results = await Promise.all(
|
|
100
|
+
skillDirs.map(async (dir) => {
|
|
101
|
+
const rawUrl = `https://raw.githubusercontent.com/${REPO}/${BRANCH}/${dir}/SKILL.md`
|
|
102
|
+
const content = await fetchText(rawUrl)
|
|
103
|
+
const meta = parseFrontmatter(content)
|
|
104
|
+
return { dir, content, meta }
|
|
105
|
+
}),
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
// 3. Write files and build manifest
|
|
109
|
+
for (const { dir, content, meta } of results) {
|
|
110
|
+
const outDir = resolve(SKILLS_DIR, dir)
|
|
111
|
+
mkdirSync(outDir, { recursive: true })
|
|
112
|
+
writeFileSync(resolve(outDir, "SKILL.md"), content)
|
|
113
|
+
manifest.push({ dir, name: meta.name, description: meta.description })
|
|
114
|
+
console.log(` ✓ ${dir}`)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Sort manifest by dir name for deterministic output
|
|
118
|
+
manifest.sort((a, b) => a.dir.localeCompare(b.dir))
|
|
119
|
+
|
|
120
|
+
// 4. Write manifest
|
|
121
|
+
mkdirSync(SKILLS_DIR, { recursive: true })
|
|
122
|
+
writeFileSync(
|
|
123
|
+
resolve(SKILLS_DIR, "manifest.json"),
|
|
124
|
+
`${JSON.stringify(manifest, null, 2)}\n`,
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
console.log(`\nWrote ${manifest.length} skills + manifest.json to skills/`)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
main().catch((err) => {
|
|
131
|
+
console.error("Fatal:", err.message)
|
|
132
|
+
process.exit(1)
|
|
133
|
+
})
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"dir": "memory-defrag",
|
|
4
|
+
"name": "memory-defrag",
|
|
5
|
+
"description": "Defragment and reorganize agent memory files: split bloated files, merge duplicates, remove stale information, and restructure the memory hierarchy. Use when memory files have grown unwieldy, contain redundancies, or need reorganization. Run periodically (weekly) or on demand."
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"dir": "memory-ingest",
|
|
9
|
+
"name": "memory-ingest",
|
|
10
|
+
"description": "Process unstructured external input (meeting transcripts, conversation logs, pasted documents) into structured Basic Memory entities. Extracts entities, searches for existing matches, proposes new entities with approval, creates notes with observations and relations, and captures action items."
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"dir": "memory-lifecycle",
|
|
14
|
+
"name": "memory-lifecycle",
|
|
15
|
+
"description": "Manage entity status transitions in Basic Memory: archive completed work, move notes between status folders, update frontmatter, and handle edge cases. Use when marking items complete, archiving old entities, or managing any folder-based status workflow."
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"dir": "memory-metadata-search",
|
|
19
|
+
"name": "memory-metadata-search",
|
|
20
|
+
"description": "Structured metadata search for Basic Memory: query notes by custom frontmatter fields using equality, range, array, and nested filters. Use when finding notes by status, priority, confidence, or any custom YAML field rather than free-text content."
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"dir": "memory-notes",
|
|
24
|
+
"name": "memory-notes",
|
|
25
|
+
"description": "How to write well-structured Basic Memory notes: frontmatter, observations with semantic categories, relations with wiki-links, and best practices for building a rich knowledge graph. Use when creating or improving notes."
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"dir": "memory-reflect",
|
|
29
|
+
"name": "memory-reflect",
|
|
30
|
+
"description": "Sleep-time memory reflection: review recent conversations and daily notes, extract insights, and consolidate into long-term memory. Use when triggered by cron, heartbeat, or explicit request to reflect on recent activity. Runs as background processing to improve memory quality over time."
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"dir": "memory-research",
|
|
34
|
+
"name": "memory-research",
|
|
35
|
+
"description": "Research an external subject using web search, synthesize findings into a structured Basic Memory entity. Use when asked to research a company, person, technology, or topic — or when a bare name or URL is provided that implies a research request."
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"dir": "memory-schema",
|
|
39
|
+
"name": "memory-schema",
|
|
40
|
+
"description": "Schema lifecycle management for Basic Memory: discover unschemaed notes, infer schemas, create and edit schema definitions, validate notes, and detect drift. Use when working with structured note types (Task, Person, Meeting, etc.) to maintain consistency across the knowledge graph."
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"dir": "memory-tasks",
|
|
44
|
+
"name": "memory-tasks",
|
|
45
|
+
"description": "Task management via Basic Memory schemas: create, track, and resume structured tasks that survive context compaction. Uses BM's schema system for uniform notes queryable through the knowledge graph."
|
|
46
|
+
}
|
|
47
|
+
]
|
|
@@ -78,7 +78,6 @@ After changes:
|
|
|
78
78
|
|
|
79
79
|
## Guidelines
|
|
80
80
|
|
|
81
|
-
- **Back up first.** If git is available, commit before defragging. If not, note the pre-defrag state.
|
|
82
81
|
- **Preserve raw daily notes.** Don't delete or modify `memory/YYYY-MM-DD.md` files — they're the audit trail.
|
|
83
82
|
- **Target 15-25 focused files.** Too few means bloated files; too many means fragmentation. Aim for the sweet spot.
|
|
84
83
|
- **File names should be scannable.** Use descriptive names: `people.md`, `project-status.md`, `competitive-landscape.md` — not `notes-2.md`.
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: memory-ingest
|
|
3
|
+
description: "Process unstructured external input (meeting transcripts, conversation logs, pasted documents) into structured Basic Memory entities. Extracts entities, searches for existing matches, proposes new entities with approval, creates notes with observations and relations, and captures action items."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Memory Ingest
|
|
7
|
+
|
|
8
|
+
Turn raw, unstructured input into structured Basic Memory entities. Meeting transcripts, conversation logs, pasted documents, email threads — anything with information worth preserving gets parsed, cross-referenced against existing knowledge, and written as proper notes.
|
|
9
|
+
|
|
10
|
+
## When to Use
|
|
11
|
+
|
|
12
|
+
- User pastes a meeting transcript or conversation log
|
|
13
|
+
- User says "process these notes" or "add this to Basic Memory"
|
|
14
|
+
- User pastes a document, article, or email for knowledge extraction
|
|
15
|
+
- Any time raw external text needs to become structured knowledge
|
|
16
|
+
|
|
17
|
+
## Workflow Overview
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
1. Parse raw input → identify structure, extract key info
|
|
21
|
+
2. Extract entities → people, orgs, topics, action items
|
|
22
|
+
3. Search existing entities → multi-variation queries
|
|
23
|
+
4. Research new entities → optional web research (see memory-research)
|
|
24
|
+
5. Present entity proposal → get approval before creating
|
|
25
|
+
6. Create source note → verbatim content + observations + relations
|
|
26
|
+
7. Create approved entities → structured notes for each new entity
|
|
27
|
+
8. Extract action items → follow-ups and commitments
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Step 1: Parse Raw Input
|
|
31
|
+
|
|
32
|
+
Read the pasted content and identify its structure:
|
|
33
|
+
|
|
34
|
+
- **Format**: Meeting transcript, email thread, conversation log, article, freeform notes
|
|
35
|
+
- **Date**: When this happened (extract from content or ask)
|
|
36
|
+
- **Participants**: Who was involved (names, roles, organizations)
|
|
37
|
+
- **Sections**: Any existing structure (headings, speaker labels, timestamps)
|
|
38
|
+
|
|
39
|
+
Don't rewrite or summarize the source content. Preserve it verbatim in the note — you'll add structured observations alongside it.
|
|
40
|
+
|
|
41
|
+
## Step 2: Extract Entities
|
|
42
|
+
|
|
43
|
+
Scan the content for entities worth tracking in the knowledge graph:
|
|
44
|
+
|
|
45
|
+
| Entity Type | Signals |
|
|
46
|
+
|-------------|---------|
|
|
47
|
+
| **Person** | Names with roles, titles, or affiliations mentioned |
|
|
48
|
+
| **Organization** | Company names, agencies, institutions |
|
|
49
|
+
| **Topic/Concept** | Technical domains, methodologies, standards discussed substantively |
|
|
50
|
+
| **Action Item** | Commitments, deadlines, "I'll do X by Y" statements |
|
|
51
|
+
|
|
52
|
+
**Infer type from context.** If someone is introduced as "CTO of Acme Corp", that's both a Person and an Organization entity. If a technology is discussed in depth, it might warrant a Concept entity.
|
|
53
|
+
|
|
54
|
+
**Exclude noise.** Not every name mentioned is worth an entity. Filter for:
|
|
55
|
+
- People with substantive roles or interactions (not passing mentions)
|
|
56
|
+
- Organizations discussed in business/technical context
|
|
57
|
+
- Topics with enough detail to warrant their own note
|
|
58
|
+
|
|
59
|
+
## Step 3: Search Existing Entities
|
|
60
|
+
|
|
61
|
+
For each extracted entity, search Basic Memory with multiple query variations:
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
# Person — try full name, last name
|
|
65
|
+
search_notes(query="Sarah Chen")
|
|
66
|
+
search_notes(query="Chen")
|
|
67
|
+
|
|
68
|
+
# Organization — try full name, abbreviation, acronym
|
|
69
|
+
search_notes(query="National Renewable Energy Laboratory")
|
|
70
|
+
search_notes(query="NREL")
|
|
71
|
+
|
|
72
|
+
# Topic — try the full term and keywords
|
|
73
|
+
search_notes(query="edge computing")
|
|
74
|
+
search_notes(query="edge inference")
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Classify each entity as:
|
|
78
|
+
- **Existing** — found in Basic Memory. Will link to it with `[[wiki-link]]`.
|
|
79
|
+
- **Proposed** — not found. Will propose creation pending approval.
|
|
80
|
+
|
|
81
|
+
## Step 4: Research New Entities (Optional)
|
|
82
|
+
|
|
83
|
+
For proposed entities where more context would be valuable, do a brief web search (2-3 queries max per entity):
|
|
84
|
+
|
|
85
|
+
- **Organizations**: What they do, size, public/private, key products
|
|
86
|
+
- **People**: Current role, background, expertise
|
|
87
|
+
- **Topics**: Brief definition, relevance
|
|
88
|
+
|
|
89
|
+
Use hedging language ("appears to be", "estimated", "based on public information"). Never fabricate details.
|
|
90
|
+
|
|
91
|
+
This step is optional — skip it if the source material provides enough context, or if the user is in a hurry. See the **memory-research** skill for deeper research workflows.
|
|
92
|
+
|
|
93
|
+
## Step 5: Present Entity Proposal
|
|
94
|
+
|
|
95
|
+
Before creating anything, present what you found and what you'd like to create:
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
Entities found in Basic Memory:
|
|
99
|
+
- [[Sarah Chen]] (Person — existing)
|
|
100
|
+
- [[Acme Corp]] (Organization — existing)
|
|
101
|
+
|
|
102
|
+
Proposed new entities:
|
|
103
|
+
- Jordan Rivera (Person — VP Engineering at NovaTech, mentioned as project lead)
|
|
104
|
+
- NovaTech (Organization — SaaS platform, Series B, discussed as integration partner)
|
|
105
|
+
- Federated Learning (Concept — core technical topic of the discussion)
|
|
106
|
+
|
|
107
|
+
Approve all / select individually / skip entity creation?
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Include enough context with each proposed entity for the user to make a quick decision.
|
|
111
|
+
|
|
112
|
+
## Step 6: Create the Source Note
|
|
113
|
+
|
|
114
|
+
Create the primary note for the ingested content. This is the "record of what happened" — it preserves the raw material and adds structured metadata.
|
|
115
|
+
|
|
116
|
+
### Meeting / Conversation Note
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
write_note(
|
|
120
|
+
title="NovaTech Meeting - Jordan Rivera - Feb 22, 2026",
|
|
121
|
+
directory="meetings/2026",
|
|
122
|
+
note_type="meeting",
|
|
123
|
+
tags=["meeting", "novatech", "federated-learning"],
|
|
124
|
+
metadata={"date": "2026-02-22"},
|
|
125
|
+
content="""
|
|
126
|
+
# NovaTech Meeting - Jordan Rivera - Feb 22, 2026
|
|
127
|
+
|
|
128
|
+
Brief one-sentence summary of what this meeting was about.
|
|
129
|
+
|
|
130
|
+
## Transcript
|
|
131
|
+
[Preserve all source content verbatim — do not summarize or rewrite]
|
|
132
|
+
|
|
133
|
+
## Observations
|
|
134
|
+
- [opportunity] NovaTech interested in integration partnership
|
|
135
|
+
- [insight] Their platform handles 10K concurrent sessions, relevant to our scale needs
|
|
136
|
+
- [next_step] Send technical spec document by Friday
|
|
137
|
+
- [sentiment] Strong enthusiasm from their engineering team
|
|
138
|
+
- [decision] Agreed to start with a proof-of-concept integration
|
|
139
|
+
|
|
140
|
+
## Relations
|
|
141
|
+
- attended [[Jordan Rivera]]
|
|
142
|
+
- with [[NovaTech]]
|
|
143
|
+
- discussed [[Federated Learning]]
|
|
144
|
+
- follow_up [[Send NovaTech Technical Spec]]
|
|
145
|
+
"""
|
|
146
|
+
)
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Document / Article Note
|
|
150
|
+
|
|
151
|
+
```python
|
|
152
|
+
write_note(
|
|
153
|
+
title="Edge Computing Architecture Whitepaper",
|
|
154
|
+
directory="references",
|
|
155
|
+
note_type="reference",
|
|
156
|
+
tags=["edge-computing", "architecture", "reference"],
|
|
157
|
+
metadata={"source": "https://example.com/whitepaper.pdf", "date_ingested": "2026-02-22"},
|
|
158
|
+
content="""
|
|
159
|
+
# Edge Computing Architecture Whitepaper
|
|
160
|
+
|
|
161
|
+
## Source Content
|
|
162
|
+
[Preserve relevant content — for long documents, include key sections rather than the entire text]
|
|
163
|
+
|
|
164
|
+
## Observations
|
|
165
|
+
- [key_finding] Latency drops 40% with edge inference vs cloud-only
|
|
166
|
+
- [technique] Model sharding across heterogeneous edge nodes
|
|
167
|
+
- [limitation] Requires minimum 8GB RAM per edge node
|
|
168
|
+
|
|
169
|
+
## Relations
|
|
170
|
+
- relates_to [[Edge Computing]]
|
|
171
|
+
- relates_to [[Model Optimization]]
|
|
172
|
+
"""
|
|
173
|
+
)
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Observation Categories
|
|
177
|
+
|
|
178
|
+
Use categories that capture the nature of the information. Common categories for ingested content:
|
|
179
|
+
|
|
180
|
+
| Category | Use For |
|
|
181
|
+
|----------|---------|
|
|
182
|
+
| `opportunity` | Business or collaboration opportunities identified |
|
|
183
|
+
| `decision` | Decisions made or agreed upon |
|
|
184
|
+
| `insight` | Non-obvious understanding gained |
|
|
185
|
+
| `next_step` | Concrete action items or follow-ups |
|
|
186
|
+
| `sentiment` | Enthusiasm, concerns, hesitations expressed |
|
|
187
|
+
| `risk` | Risks or concerns identified |
|
|
188
|
+
| `requirement` | Requirements or constraints discovered |
|
|
189
|
+
| `key_finding` | Important facts from reference material |
|
|
190
|
+
| `technique` | Methods, approaches, or patterns described |
|
|
191
|
+
| `context` | Background information that may be useful later |
|
|
192
|
+
|
|
193
|
+
Invent categories as needed — these are suggestions, not a fixed list.
|
|
194
|
+
|
|
195
|
+
## Step 7: Create Approved Entities
|
|
196
|
+
|
|
197
|
+
For each entity the user approved, create a structured note. Match the entity type to an appropriate template.
|
|
198
|
+
|
|
199
|
+
### Person
|
|
200
|
+
|
|
201
|
+
```python
|
|
202
|
+
write_note(
|
|
203
|
+
title="Jordan Rivera",
|
|
204
|
+
directory="people",
|
|
205
|
+
note_type="person",
|
|
206
|
+
tags=["person", "novatech", "engineering"],
|
|
207
|
+
content="""
|
|
208
|
+
# Jordan Rivera
|
|
209
|
+
|
|
210
|
+
## Overview
|
|
211
|
+
VP of Engineering at NovaTech. Met during integration partnership discussion.
|
|
212
|
+
|
|
213
|
+
## Background
|
|
214
|
+
[Role, expertise, context from meeting + any web research]
|
|
215
|
+
|
|
216
|
+
## Observations
|
|
217
|
+
- [role] VP Engineering at NovaTech
|
|
218
|
+
- [expertise] Distributed systems, federated learning
|
|
219
|
+
- [met] 2026-02-22 during integration discussion
|
|
220
|
+
|
|
221
|
+
## Relations
|
|
222
|
+
- works_at [[NovaTech]]
|
|
223
|
+
- discussed_in [[NovaTech Meeting - Jordan Rivera - Feb 22, 2026]]
|
|
224
|
+
"""
|
|
225
|
+
)
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Organization
|
|
229
|
+
|
|
230
|
+
```python
|
|
231
|
+
write_note(
|
|
232
|
+
title="NovaTech",
|
|
233
|
+
directory="organizations",
|
|
234
|
+
note_type="organization",
|
|
235
|
+
tags=["organization", "saas", "integration-partner"],
|
|
236
|
+
content="""
|
|
237
|
+
# NovaTech
|
|
238
|
+
|
|
239
|
+
## Overview
|
|
240
|
+
SaaS platform company. Series B stage.
|
|
241
|
+
[Additional context from meeting + web research]
|
|
242
|
+
|
|
243
|
+
## Products & Services
|
|
244
|
+
[What they offer, if discussed or researched]
|
|
245
|
+
|
|
246
|
+
## Observations
|
|
247
|
+
- [stage] Series B, ~200 employees
|
|
248
|
+
- [relevance] Potential integration partner for our platform
|
|
249
|
+
- [first_contact] 2026-02-22
|
|
250
|
+
|
|
251
|
+
## Relations
|
|
252
|
+
- employs [[Jordan Rivera]]
|
|
253
|
+
- discussed_in [[NovaTech Meeting - Jordan Rivera - Feb 22, 2026]]
|
|
254
|
+
"""
|
|
255
|
+
)
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Concept / Topic
|
|
259
|
+
|
|
260
|
+
```python
|
|
261
|
+
write_note(
|
|
262
|
+
title="Federated Learning",
|
|
263
|
+
directory="concepts",
|
|
264
|
+
note_type="concept",
|
|
265
|
+
tags=["concept", "machine-learning", "distributed-systems"],
|
|
266
|
+
content="""
|
|
267
|
+
# Federated Learning
|
|
268
|
+
|
|
269
|
+
## Overview
|
|
270
|
+
[Brief description of the concept from the discussion context]
|
|
271
|
+
|
|
272
|
+
## Observations
|
|
273
|
+
- [definition] Machine learning approach where models train across decentralized data sources
|
|
274
|
+
- [relevance] Core technique discussed in NovaTech integration
|
|
275
|
+
|
|
276
|
+
## Relations
|
|
277
|
+
- discussed_in [[NovaTech Meeting - Jordan Rivera - Feb 22, 2026]]
|
|
278
|
+
"""
|
|
279
|
+
)
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Adapt templates to your domain. The key elements are: type and tags as parameters, an overview section, observations with categories, and relations linking back to the source.
|
|
283
|
+
|
|
284
|
+
## Step 8: Extract Action Items
|
|
285
|
+
|
|
286
|
+
Review the source content for commitments and follow-ups:
|
|
287
|
+
|
|
288
|
+
```
|
|
289
|
+
Action Items:
|
|
290
|
+
- Send NovaTech technical spec document by Friday (your commitment)
|
|
291
|
+
- Jordan will share their API documentation by next week (their commitment)
|
|
292
|
+
|
|
293
|
+
Follow-Up Reminders:
|
|
294
|
+
- 1 week: Check if Jordan sent API docs
|
|
295
|
+
- 2 weeks: Schedule follow-up call to discuss POC scope
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
If using the **memory-tasks** skill, create Task notes for your action items. Otherwise, capture them as observations in the source note.
|
|
299
|
+
|
|
300
|
+
## Guidelines
|
|
301
|
+
|
|
302
|
+
- **Preserve source content verbatim.** The original text is the ground truth. Structure and observations are your interpretation layered on top.
|
|
303
|
+
- **Search before creating.** Always check if entities already exist (see memory-notes search-before-create pattern). Update existing entities with new information rather than creating duplicates.
|
|
304
|
+
- **Get approval for new entities.** Present proposed entities and let the user decide which to create. Don't silently populate the knowledge graph.
|
|
305
|
+
- **Infer, don't interrogate.** Extract entity types and relationships from context. Only ask the user when genuinely ambiguous.
|
|
306
|
+
- **Be selective about entities.** Not every name mentioned deserves its own note. Focus on entities the user will want to reference again.
|
|
307
|
+
- **Use hedging for researched info.** Web research supplements — don't present it as fact. "Appears to be", "estimated", "based on public information".
|
|
308
|
+
- **Link everything back.** Every created entity should relate back to the source note. The source note should link to all entities discussed.
|
|
309
|
+
- **Prose and observations together.** Notes work best with both narrative context and structured observations. Prose gives meaning and tells the story; observations make individual facts searchable. Use the body for context, then distill key facts into categorized observations.
|