omo-memory 0.1.11 → 0.1.12
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 +83 -3
- package/dist/cli.js +113 -3
- package/dist/conceptExtraction.js +188 -0
- package/dist/globalMemory.js +162 -0
- package/dist/globalMemoryCanonical.js +32 -0
- package/dist/globalMemoryImport.js +194 -0
- package/dist/graphTui.js +239 -0
- package/dist/mcp.js +26 -3
- package/dist/mcpOntologyTools.js +117 -0
- package/dist/memory.js +66 -29
- package/dist/memoryDb.js +145 -1
- package/dist/memoryRecall.js +56 -0
- package/dist/memoryReport.js +33 -0
- package/dist/ontologyCore.js +142 -0
- package/dist/ontologyGraph.js +173 -0
- package/dist/ontologyQueries.js +30 -0
- package/dist/ontologySupersede.js +49 -0
- package/dist/retentionPolicy.js +76 -0
- package/dist/retentionRecompute.js +175 -0
- package/docs/adapter-integration.md +113 -3
- package/docs/epic-omo-memory.md +63 -7
- package/package.json +3 -1
package/docs/epic-omo-memory.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
# Epic: OMO Memory — shared local
|
|
1
|
+
# Epic: OMO Memory — shared local second-brain DB for OMO adapters
|
|
2
2
|
|
|
3
3
|
## Goal
|
|
4
4
|
|
|
5
|
-
Build a host-neutral local memory layer for OMO so lazycodex, omo-on-opencode, lfg, and future adapters can share task context across coding-tool sessions.
|
|
5
|
+
Build a host-neutral local memory layer for OMO so lazycodex, omo-on-opencode, lfg, and future adapters can share task context, durable decisions, and ontology-backed project knowledge across coding-tool sessions.
|
|
6
6
|
|
|
7
7
|
The product ships as both:
|
|
8
8
|
|
|
9
|
-
- CLI: install, inspect, search, export, purge, and handoff operations.
|
|
10
|
-
- MCP server: standard stdio tools for agents and coding tools to read/write OMO memory.
|
|
9
|
+
- CLI: install, inspect, global migration, ontology lifecycle, graph, search, export, purge, and handoff operations.
|
|
10
|
+
- MCP server: standard stdio tools for agents and coding tools to explicitly read/write OMO memory.
|
|
11
11
|
|
|
12
12
|
## Problem
|
|
13
13
|
|
|
@@ -18,32 +18,64 @@ Codegraph solves code intelligence, not work/session memory. OMO needs a separat
|
|
|
18
18
|
## Product direction
|
|
19
19
|
|
|
20
20
|
- Project-local DB: `<project-root>/.omo/memory/state.sqlite`
|
|
21
|
+
- Optional global DB: user-selected SQLite path such as `~/.omo/memory/global.sqlite`, populated by copy/import from local project ledgers
|
|
21
22
|
- Project namespace: derive from git remote + repo root hash, with branch/head metadata
|
|
22
23
|
- Local-first privacy: no cloud sync and no secret storage by default
|
|
23
24
|
- Adapter-neutral schema: `host` and `adapter` are metadata, not separate products
|
|
24
25
|
- Shared API: CLI and MCP use the same core DB layer
|
|
26
|
+
- Second-brain lifecycle: candidate extraction, deterministic retention scoring, promotion, demotion, supersession, explicit recall, and OpenTUI graph inspection
|
|
25
27
|
|
|
26
28
|
## In scope
|
|
27
29
|
|
|
28
30
|
- SQLite schema and migrations
|
|
29
31
|
- CLI commands:
|
|
30
32
|
- `init`
|
|
33
|
+
- `global scan`
|
|
34
|
+
- `global migrate`
|
|
31
35
|
- `session start`
|
|
36
|
+
- `session bootstrap`
|
|
32
37
|
- `event record`
|
|
33
38
|
- `recent`
|
|
39
|
+
- `recall`
|
|
34
40
|
- `handoff write`
|
|
35
41
|
- `doctor`
|
|
42
|
+
- `ontology candidates`
|
|
43
|
+
- `ontology score`
|
|
44
|
+
- `ontology promote`
|
|
45
|
+
- `ontology demote`
|
|
46
|
+
- `ontology supersede`
|
|
47
|
+
- `ontology recall`
|
|
48
|
+
- `graph tui`
|
|
36
49
|
- MCP stdio server with tools:
|
|
37
50
|
- `memory_init`
|
|
38
51
|
- `memory_project_context`
|
|
52
|
+
- `memory_bootstrap_session`
|
|
53
|
+
- `memory_start_session`
|
|
39
54
|
- `memory_record_event`
|
|
40
55
|
- `memory_recent_events`
|
|
56
|
+
- `memory_recall_events`
|
|
41
57
|
- `memory_write_handoff`
|
|
58
|
+
- `memory_global_scan`
|
|
59
|
+
- `memory_global_migrate`
|
|
60
|
+
- `memory_global_list`
|
|
61
|
+
- `memory_ontology_candidates`
|
|
62
|
+
- `memory_ontology_extract`
|
|
63
|
+
- `memory_ontology_score`
|
|
64
|
+
- `memory_ontology_promote`
|
|
65
|
+
- `memory_ontology_demote`
|
|
66
|
+
- `memory_ontology_supersede`
|
|
67
|
+
- `memory_ontology_recall`
|
|
42
68
|
- Privacy guardrails:
|
|
43
69
|
- local-only default
|
|
44
70
|
- no API key/token/env capture
|
|
45
71
|
- explicit purge/export commands
|
|
46
72
|
- Adapter integration notes for lazycodex, omo-on-opencode, and lfg
|
|
73
|
+
- Retention classes:
|
|
74
|
+
- `forget`: safe to drop after low score or decay
|
|
75
|
+
- `temporary`: short-term task context
|
|
76
|
+
- `working`: active project memory
|
|
77
|
+
- `durable`: cross-session knowledge
|
|
78
|
+
- `permanent`: manual-pin or high-score knowledge; only explicit demote/supersede/purge changes it
|
|
47
79
|
|
|
48
80
|
## Out of scope
|
|
49
81
|
|
|
@@ -51,6 +83,8 @@ Codegraph solves code intelligence, not work/session memory. OMO needs a separat
|
|
|
51
83
|
- Team sharing by default
|
|
52
84
|
- Full transcript capture by default
|
|
53
85
|
- Vector/embedding search in MVP
|
|
86
|
+
- Browser-only graph UI
|
|
87
|
+
- Automatic prompt injection from the last session
|
|
54
88
|
- Replacing codegraph
|
|
55
89
|
- Host-specific private APIs as required dependencies
|
|
56
90
|
|
|
@@ -59,33 +93,51 @@ Codegraph solves code intelligence, not work/session memory. OMO needs a separat
|
|
|
59
93
|
### CLI
|
|
60
94
|
|
|
61
95
|
- `omo-memory init` creates or migrates `<project-root>/.omo/memory/state.sqlite`.
|
|
96
|
+
- `omo-memory global scan --root <path>` discovers project-local OMO DBs and reports schema versions.
|
|
97
|
+
- `omo-memory global migrate --root <path> --global-db <path>` copies source DB data into one global SQLite file without mutating source DBs.
|
|
62
98
|
- `omo-memory session start --host grok --adapter lfg` records a session for the current project.
|
|
99
|
+
- `omo-memory session bootstrap --host codex --adapter lazycodex` returns a session id and project metadata without injecting recent events.
|
|
63
100
|
- `omo-memory event record --type decision --summary "..."` appends a project/session event.
|
|
64
101
|
- `omo-memory recent` lists recent project events.
|
|
102
|
+
- `omo-memory recall --query "..."` performs explicit query-gated event recall.
|
|
65
103
|
- `omo-memory handoff write --summary-file path.md` stores a handoff summary.
|
|
104
|
+
- `omo-memory ontology candidates` extracts vocabulary candidates from concise summaries.
|
|
105
|
+
- `omo-memory ontology score` recomputes deterministic retention classes.
|
|
106
|
+
- `omo-memory ontology promote/demote/supersede/recall` supports curated durable memory lifecycle.
|
|
107
|
+
- `omo-memory graph tui --db <path> --query <term>` opens an OpenTUI graph with `q` quit, arrow/tab selection, retention class, score, provenance, and detail pane. It requires `bun` on `PATH`; other CLI and MCP commands run on Node.
|
|
66
108
|
|
|
67
109
|
### MCP
|
|
68
110
|
|
|
69
111
|
- `omo-memory mcp` starts a stdio MCP server.
|
|
70
|
-
- MCP tools can initialize the DB, read project context, record events, list
|
|
112
|
+
- MCP tools can initialize the DB, read project context, record events, list/retrieve explicit memory, write handoffs, migrate global memory, and manage ontology lifecycle.
|
|
71
113
|
- MCP tool responses are structured JSON text.
|
|
114
|
+
- `memory_bootstrap_session` remains write-only/session-only and does not return `recentEvents`.
|
|
72
115
|
|
|
73
116
|
### Privacy and safety
|
|
74
117
|
|
|
75
118
|
- No secrets are read from `.env`, auth files, or host config by default.
|
|
76
119
|
- DB path can be overridden only by explicit `OMO_MEMORY_DB`.
|
|
77
120
|
- `doctor` reports DB path, schema version, and project identity without leaking sensitive values.
|
|
121
|
+
- Global migration is copy/import only; source project DB mtimes and row counts must remain unchanged.
|
|
122
|
+
- Graph and recall are local-first and explicit; no cloud sync, browser server, raw transcript capture, or embeddings are required.
|
|
78
123
|
|
|
79
124
|
### QA evidence
|
|
80
125
|
|
|
81
126
|
- `npm run typecheck`
|
|
82
127
|
- `npm run build`
|
|
128
|
+
- `npm run check`
|
|
83
129
|
- CLI smoke:
|
|
84
130
|
- `node dist/cli.js init`
|
|
131
|
+
- `node dist/cli.js global scan --root <tmp-workspace>`
|
|
132
|
+
- `node dist/cli.js global migrate --root <tmp-workspace> --global-db <tmp-global.sqlite>`
|
|
85
133
|
- `node dist/cli.js session start --host grok --adapter lfg`
|
|
86
134
|
- `node dist/cli.js event record --type decision --summary "smoke"`
|
|
135
|
+
- `node dist/cli.js ontology candidates`
|
|
136
|
+
- `node dist/cli.js ontology score`
|
|
137
|
+
- `bun dist/cli.js graph tui --db <tmp-db> --query smoke`
|
|
87
138
|
- `node dist/cli.js recent`
|
|
88
139
|
- MCP smoke: start `node dist/cli.js mcp` and verify `tools/list` includes memory tools.
|
|
140
|
+
- Backfill verifier: synthetic Linaforge/omo-memory/lfg/omo-phone DB replicas plus read-only scan of real local DB paths.
|
|
89
141
|
|
|
90
142
|
## Follow-up issue breakdown
|
|
91
143
|
|
|
@@ -94,5 +146,9 @@ Codegraph solves code intelligence, not work/session memory. OMO needs a separat
|
|
|
94
146
|
3. MCP stdio server
|
|
95
147
|
4. Project identity and git metadata
|
|
96
148
|
5. Privacy/redaction/purge/export
|
|
97
|
-
6.
|
|
98
|
-
7.
|
|
149
|
+
6. Global SQLite migration and source provenance
|
|
150
|
+
7. Deterministic ontology extraction and retention scoring
|
|
151
|
+
8. Durable memory promote/demote/supersede lifecycle
|
|
152
|
+
9. OpenTUI graph visualization
|
|
153
|
+
10. Adapter integration docs for lazycodex, omo-on-opencode, and lfg
|
|
154
|
+
11. QA harness for CLI, MCP, global backfill, and TUI smoke tests
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omo-memory",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "Host-neutral local SQLite memory and session ledger for OMO adapters, exposed through CLI and MCP.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "tsc -p tsconfig.json",
|
|
27
|
+
"postbuild": "chmod 755 dist/cli.js",
|
|
27
28
|
"typecheck": "tsc --noEmit",
|
|
28
29
|
"lint": "biome check .",
|
|
29
30
|
"format": "biome format --write .",
|
|
@@ -39,6 +40,7 @@
|
|
|
39
40
|
},
|
|
40
41
|
"dependencies": {
|
|
41
42
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
43
|
+
"@opentui/core": "0.4.2",
|
|
42
44
|
"better-sqlite3": "^12.11.1",
|
|
43
45
|
"zod": "^4.4.3"
|
|
44
46
|
},
|