mem-os-python 1.6.27__py3-none-any.whl

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 (253) hide show
  1. mem_os_python-1.6.27.dist-info/METADATA +1032 -0
  2. mem_os_python-1.6.27.dist-info/RECORD +253 -0
  3. mem_os_python-1.6.27.dist-info/WHEEL +4 -0
  4. mem_os_python-1.6.27.dist-info/entry_points.txt +2 -0
  5. mem_os_python-1.6.27.dist-info/licenses/LICENSE +21 -0
  6. memos/__init__.py +16 -0
  7. memos/_js/adapters/anthropic.d.ts +279 -0
  8. memos/_js/adapters/anthropic.d.ts.map +1 -0
  9. memos/_js/adapters/anthropic.js +348 -0
  10. memos/_js/adapters/anthropic.js.map +1 -0
  11. memos/_js/adapters/base.d.ts +10 -0
  12. memos/_js/adapters/base.d.ts.map +1 -0
  13. memos/_js/adapters/base.js +2 -0
  14. memos/_js/adapters/base.js.map +1 -0
  15. memos/_js/adapters/openai.d.ts +264 -0
  16. memos/_js/adapters/openai.d.ts.map +1 -0
  17. memos/_js/adapters/openai.js +342 -0
  18. memos/_js/adapters/openai.js.map +1 -0
  19. memos/_js/apps/explorer.d.ts +244 -0
  20. memos/_js/apps/explorer.d.ts.map +1 -0
  21. memos/_js/apps/explorer.js +738 -0
  22. memos/_js/apps/explorer.js.map +1 -0
  23. memos/_js/citations.d.ts +65 -0
  24. memos/_js/citations.d.ts.map +1 -0
  25. memos/_js/citations.js +143 -0
  26. memos/_js/citations.js.map +1 -0
  27. memos/_js/cli-browse.d.ts +3 -0
  28. memos/_js/cli-browse.d.ts.map +1 -0
  29. memos/_js/cli-browse.js +129 -0
  30. memos/_js/cli-browse.js.map +1 -0
  31. memos/_js/cli-completion.d.ts +31 -0
  32. memos/_js/cli-completion.d.ts.map +1 -0
  33. memos/_js/cli-completion.js +340 -0
  34. memos/_js/cli-completion.js.map +1 -0
  35. memos/_js/cli-help.d.ts +18 -0
  36. memos/_js/cli-help.d.ts.map +1 -0
  37. memos/_js/cli-help.js +357 -0
  38. memos/_js/cli-help.js.map +1 -0
  39. memos/_js/cli.d.ts +28 -0
  40. memos/_js/cli.d.ts.map +1 -0
  41. memos/_js/cli.js +2880 -0
  42. memos/_js/cli.js.map +1 -0
  43. memos/_js/compression.d.ts +25 -0
  44. memos/_js/compression.d.ts.map +1 -0
  45. memos/_js/compression.js +319 -0
  46. memos/_js/compression.js.map +1 -0
  47. memos/_js/confidence-machine.d.ts +99 -0
  48. memos/_js/confidence-machine.d.ts.map +1 -0
  49. memos/_js/confidence-machine.js +222 -0
  50. memos/_js/confidence-machine.js.map +1 -0
  51. memos/_js/context-pack.d.ts +506 -0
  52. memos/_js/context-pack.d.ts.map +1 -0
  53. memos/_js/context-pack.js +1435 -0
  54. memos/_js/context-pack.js.map +1 -0
  55. memos/_js/contradictions.d.ts +160 -0
  56. memos/_js/contradictions.d.ts.map +1 -0
  57. memos/_js/contradictions.js +255 -0
  58. memos/_js/contradictions.js.map +1 -0
  59. memos/_js/dashboard.d.ts +30 -0
  60. memos/_js/dashboard.d.ts.map +1 -0
  61. memos/_js/dashboard.js +302 -0
  62. memos/_js/dashboard.js.map +1 -0
  63. memos/_js/ebbinghaus.d.ts +29 -0
  64. memos/_js/ebbinghaus.d.ts.map +1 -0
  65. memos/_js/ebbinghaus.js +32 -0
  66. memos/_js/ebbinghaus.js.map +1 -0
  67. memos/_js/embedding-queue.d.ts +190 -0
  68. memos/_js/embedding-queue.d.ts.map +1 -0
  69. memos/_js/embedding-queue.js +316 -0
  70. memos/_js/embedding-queue.js.map +1 -0
  71. memos/_js/embeddings.d.ts +187 -0
  72. memos/_js/embeddings.d.ts.map +1 -0
  73. memos/_js/embeddings.js +633 -0
  74. memos/_js/embeddings.js.map +1 -0
  75. memos/_js/entity-extraction.d.ts +54 -0
  76. memos/_js/entity-extraction.d.ts.map +1 -0
  77. memos/_js/entity-extraction.js +325 -0
  78. memos/_js/entity-extraction.js.map +1 -0
  79. memos/_js/entity-index.d.ts +93 -0
  80. memos/_js/entity-index.d.ts.map +1 -0
  81. memos/_js/entity-index.js +165 -0
  82. memos/_js/entity-index.js.map +1 -0
  83. memos/_js/event-memory.d.ts +147 -0
  84. memos/_js/event-memory.d.ts.map +1 -0
  85. memos/_js/event-memory.js +290 -0
  86. memos/_js/event-memory.js.map +1 -0
  87. memos/_js/external-import.d.ts +98 -0
  88. memos/_js/external-import.d.ts.map +1 -0
  89. memos/_js/external-import.js +669 -0
  90. memos/_js/external-import.js.map +1 -0
  91. memos/_js/fidelity.d.ts +367 -0
  92. memos/_js/fidelity.d.ts.map +1 -0
  93. memos/_js/fidelity.js +911 -0
  94. memos/_js/fidelity.js.map +1 -0
  95. memos/_js/graph-expansion.d.ts +119 -0
  96. memos/_js/graph-expansion.d.ts.map +1 -0
  97. memos/_js/graph-expansion.js +213 -0
  98. memos/_js/graph-expansion.js.map +1 -0
  99. memos/_js/graph-mermaid.d.ts +13 -0
  100. memos/_js/graph-mermaid.d.ts.map +1 -0
  101. memos/_js/graph-mermaid.js +32 -0
  102. memos/_js/graph-mermaid.js.map +1 -0
  103. memos/_js/graph.d.ts +170 -0
  104. memos/_js/graph.d.ts.map +1 -0
  105. memos/_js/graph.js +482 -0
  106. memos/_js/graph.js.map +1 -0
  107. memos/_js/harness.d.ts +63 -0
  108. memos/_js/harness.d.ts.map +1 -0
  109. memos/_js/harness.js +93 -0
  110. memos/_js/harness.js.map +1 -0
  111. memos/_js/importance.d.ts +118 -0
  112. memos/_js/importance.d.ts.map +1 -0
  113. memos/_js/importance.js +144 -0
  114. memos/_js/importance.js.map +1 -0
  115. memos/_js/index.d.ts +51 -0
  116. memos/_js/index.d.ts.map +1 -0
  117. memos/_js/index.js +53 -0
  118. memos/_js/index.js.map +1 -0
  119. memos/_js/mcp.d.ts +58 -0
  120. memos/_js/mcp.d.ts.map +1 -0
  121. memos/_js/mcp.js +1853 -0
  122. memos/_js/mcp.js.map +1 -0
  123. memos/_js/memory.d.ts +1762 -0
  124. memos/_js/memory.d.ts.map +1 -0
  125. memos/_js/memory.js +6283 -0
  126. memos/_js/memory.js.map +1 -0
  127. memos/_js/procedural.d.ts +74 -0
  128. memos/_js/procedural.d.ts.map +1 -0
  129. memos/_js/procedural.js +125 -0
  130. memos/_js/procedural.js.map +1 -0
  131. memos/_js/project-config.d.ts +68 -0
  132. memos/_js/project-config.d.ts.map +1 -0
  133. memos/_js/project-config.js +59 -0
  134. memos/_js/project-config.js.map +1 -0
  135. memos/_js/proof-of-forgetting.d.ts +57 -0
  136. memos/_js/proof-of-forgetting.d.ts.map +1 -0
  137. memos/_js/proof-of-forgetting.js +80 -0
  138. memos/_js/proof-of-forgetting.js.map +1 -0
  139. memos/_js/provenance.d.ts +122 -0
  140. memos/_js/provenance.d.ts.map +1 -0
  141. memos/_js/provenance.js +182 -0
  142. memos/_js/provenance.js.map +1 -0
  143. memos/_js/quarantine-commands.d.ts +23 -0
  144. memos/_js/quarantine-commands.d.ts.map +1 -0
  145. memos/_js/quarantine-commands.js +42 -0
  146. memos/_js/quarantine-commands.js.map +1 -0
  147. memos/_js/quarantine.d.ts +120 -0
  148. memos/_js/quarantine.d.ts.map +1 -0
  149. memos/_js/quarantine.js +873 -0
  150. memos/_js/quarantine.js.map +1 -0
  151. memos/_js/redact.d.ts +12 -0
  152. memos/_js/redact.d.ts.map +1 -0
  153. memos/_js/redact.js +26 -0
  154. memos/_js/redact.js.map +1 -0
  155. memos/_js/repl.d.ts +57 -0
  156. memos/_js/repl.d.ts.map +1 -0
  157. memos/_js/repl.js +295 -0
  158. memos/_js/repl.js.map +1 -0
  159. memos/_js/rerank-local.d.ts +61 -0
  160. memos/_js/rerank-local.d.ts.map +1 -0
  161. memos/_js/rerank-local.js +210 -0
  162. memos/_js/rerank-local.js.map +1 -0
  163. memos/_js/retain-filter.d.ts +98 -0
  164. memos/_js/retain-filter.d.ts.map +1 -0
  165. memos/_js/retain-filter.js +232 -0
  166. memos/_js/retain-filter.js.map +1 -0
  167. memos/_js/retrieval.d.ts +265 -0
  168. memos/_js/retrieval.d.ts.map +1 -0
  169. memos/_js/retrieval.js +1018 -0
  170. memos/_js/retrieval.js.map +1 -0
  171. memos/_js/revert.d.ts +77 -0
  172. memos/_js/revert.d.ts.map +1 -0
  173. memos/_js/revert.js +252 -0
  174. memos/_js/revert.js.map +1 -0
  175. memos/_js/scope.d.ts +30 -0
  176. memos/_js/scope.d.ts.map +1 -0
  177. memos/_js/scope.js +71 -0
  178. memos/_js/scope.js.map +1 -0
  179. memos/_js/semantic-screen.d.ts +152 -0
  180. memos/_js/semantic-screen.d.ts.map +1 -0
  181. memos/_js/semantic-screen.js +290 -0
  182. memos/_js/semantic-screen.js.map +1 -0
  183. memos/_js/session-hooks.d.ts +127 -0
  184. memos/_js/session-hooks.d.ts.map +1 -0
  185. memos/_js/session-hooks.js +482 -0
  186. memos/_js/session-hooks.js.map +1 -0
  187. memos/_js/storage/sqlite.d.ts +427 -0
  188. memos/_js/storage/sqlite.d.ts.map +1 -0
  189. memos/_js/storage/sqlite.js +2428 -0
  190. memos/_js/storage/sqlite.js.map +1 -0
  191. memos/_js/sync.d.ts +213 -0
  192. memos/_js/sync.d.ts.map +1 -0
  193. memos/_js/sync.js +389 -0
  194. memos/_js/sync.js.map +1 -0
  195. memos/_js/tamper-log.d.ts +98 -0
  196. memos/_js/tamper-log.d.ts.map +1 -0
  197. memos/_js/tamper-log.js +327 -0
  198. memos/_js/tamper-log.js.map +1 -0
  199. memos/_js/temporal.d.ts +92 -0
  200. memos/_js/temporal.d.ts.map +1 -0
  201. memos/_js/temporal.js +536 -0
  202. memos/_js/temporal.js.map +1 -0
  203. memos/_js/time-travel.d.ts +38 -0
  204. memos/_js/time-travel.d.ts.map +1 -0
  205. memos/_js/time-travel.js +46 -0
  206. memos/_js/time-travel.js.map +1 -0
  207. memos/_js/timestamp-format.d.ts +18 -0
  208. memos/_js/timestamp-format.d.ts.map +1 -0
  209. memos/_js/timestamp-format.js +52 -0
  210. memos/_js/timestamp-format.js.map +1 -0
  211. memos/_js/triple-extraction.d.ts +31 -0
  212. memos/_js/triple-extraction.d.ts.map +1 -0
  213. memos/_js/triple-extraction.js +116 -0
  214. memos/_js/triple-extraction.js.map +1 -0
  215. memos/_js/types.d.ts +2474 -0
  216. memos/_js/types.d.ts.map +1 -0
  217. memos/_js/types.js +20 -0
  218. memos/_js/types.js.map +1 -0
  219. memos/_js/updater.d.ts +95 -0
  220. memos/_js/updater.d.ts.map +1 -0
  221. memos/_js/updater.js +268 -0
  222. memos/_js/updater.js.map +1 -0
  223. memos/_js/version.d.ts +17 -0
  224. memos/_js/version.d.ts.map +1 -0
  225. memos/_js/version.js +34 -0
  226. memos/_js/version.js.map +1 -0
  227. memos/_js/vision/clip-query-cache.d.ts +58 -0
  228. memos/_js/vision/clip-query-cache.d.ts.map +1 -0
  229. memos/_js/vision/clip-query-cache.js +79 -0
  230. memos/_js/vision/clip-query-cache.js.map +1 -0
  231. memos/_js/vision/clip.d.ts +113 -0
  232. memos/_js/vision/clip.d.ts.map +1 -0
  233. memos/_js/vision/clip.js +224 -0
  234. memos/_js/vision/clip.js.map +1 -0
  235. memos/_js/vision/fake-clip.d.ts +55 -0
  236. memos/_js/vision/fake-clip.d.ts.map +1 -0
  237. memos/_js/vision/fake-clip.js +122 -0
  238. memos/_js/vision/fake-clip.js.map +1 -0
  239. memos/_js/vision/index.d.ts +15 -0
  240. memos/_js/vision/index.d.ts.map +1 -0
  241. memos/_js/vision/index.js +13 -0
  242. memos/_js/vision/index.js.map +1 -0
  243. memos/_js/vision/store.d.ts +137 -0
  244. memos/_js/vision/store.d.ts.map +1 -0
  245. memos/_js/vision/store.js +383 -0
  246. memos/_js/vision/store.js.map +1 -0
  247. memos/adapters/__init__.py +0 -0
  248. memos/adapters/crewai.py +385 -0
  249. memos/adapters/langchain.py +301 -0
  250. memos/adapters/ollama.py +396 -0
  251. memos/server/__init__.py +0 -0
  252. memos/server/main.py +547 -0
  253. memos/server/routes.py +360 -0
@@ -0,0 +1,427 @@
1
+ /**
2
+ * SQLite-backed storage adapter for MemOS.
3
+ *
4
+ * Uses `better-sqlite3` for synchronous, high-performance local persistence.
5
+ * Full-text search is powered by SQLite FTS5.
6
+ *
7
+ * @module @memos/storage/sqlite
8
+ */
9
+ import Database from "better-sqlite3";
10
+ import type { StorageAdapter, ContradictionRecord, ContradictionStatus, NewProceduralLesson, ProceduralLesson, MemoryNode, NewTamperLogEntry, TamperLogEntry, MemoryEdge, SearchFilter, ScoredMemory, GraphSnapshot, UpdateMemoryInput, EdgeRelation, EmbeddingVector, EmbeddingRecordInfo } from "../types.js";
11
+ /**
12
+ * Default database path: `~/.memos/memos.db`.
13
+ */
14
+ export declare function defaultDbPath(): string;
15
+ /** How the semantic leg chooses which stored vectors to score. */
16
+ export type SemanticScanMode = "exact" | "prefilter";
17
+ /**
18
+ * Telemetry for the most recent `querySimilarEmbeddings` call. Lets
19
+ * callers (and tests) see which parts of the scan actually ran without
20
+ * depending on wall-clock timings, which are useless in CI.
21
+ */
22
+ export interface SemanticScanStats {
23
+ /** Candidate ids selected by SQL for the scan. */
24
+ candidates: number;
25
+ /** Candidates served straight from the in-memory vector cache. */
26
+ cacheHits: number;
27
+ /**
28
+ * Squared norms computed during the scan — one per vector hydrated
29
+ * from SQLite. `0` means every norm was already cached, which is the
30
+ * steady state for a warm store.
31
+ */
32
+ normComputations: number;
33
+ /**
34
+ * Candidates that fell back to the legacy JSON-stored-vector path:
35
+ * never cached, so their vector AND norm are re-parsed on every query.
36
+ * Non-zero only for databases written before the float32 BLOB format.
37
+ */
38
+ legacyRows: number;
39
+ /** Candidates dropped by the coarse prefilter (0 in `"exact"` mode). */
40
+ prefilterSkipped: number;
41
+ /** Candidates exactly rescored after the prefilter. */
42
+ rescored: number;
43
+ /** True when the scan stopped early because a perfect match was found. */
44
+ earlyExit: boolean;
45
+ }
46
+ /**
47
+ * Tokenize a natural-language query into individually quoted FTS5
48
+ * terms.
49
+ *
50
+ * The query is split on non-alphanumeric boundaries, lowercased, and
51
+ * function words are dropped. Each surviving term is double-quoted
52
+ * (escaping any embedded quote) so FTS5 special characters cannot
53
+ * inject syntax.
54
+ *
55
+ * If stopword removal empties the query (e.g. "what is it"), the raw
56
+ * tokens are used instead so the search never degrades to a
57
+ * match-everything no-op.
58
+ *
59
+ * @param query — Raw user query text.
60
+ * @returns Quoted FTS5 terms, e.g. `['"dark"', '"mode"']`.
61
+ */
62
+ export declare function buildFtsTerms(query: string): string[];
63
+ /**
64
+ * Build an FTS5 MATCH expression from a natural-language query.
65
+ *
66
+ * Terms are joined with `operator` — `" AND "` for precision (every
67
+ * term must appear) or `" OR "` for recall (any term may appear).
68
+ *
69
+ * @param query — Raw user query text.
70
+ * @param operator — Join operator between terms. Default `" AND "`.
71
+ * @returns An FTS5 MATCH expression, e.g. `"dark" AND "mode"`.
72
+ */
73
+ export declare function buildFtsQuery(query: string, operator?: " AND " | " OR "): string;
74
+ /**
75
+ * SQLite storage implementation.
76
+ */
77
+ export declare class SQLiteStorage implements StorageAdapter {
78
+ private db;
79
+ private cipherKey;
80
+ private readonly path;
81
+ private readonly wal;
82
+ /**
83
+ * Per-id access count delta buffer. Batched into a single UPDATE per
84
+ * id on a 500 ms debounce. Removes the read-modify-write write that
85
+ * was previously amplified to a `SET access_count = access_count + 1`
86
+ * on every `getNode` call. See {@link flushAccessCounts}.
87
+ */
88
+ private readonly accessBuffer;
89
+ private accessFlushTimer;
90
+ private accessFlushIntervalMs;
91
+ /**
92
+ * Create a new SQLiteStorage instance.
93
+ *
94
+ * @param path — Filesystem path to the `.db` file.
95
+ * @param wal — Enable WAL journal mode (recommended).
96
+ */
97
+ constructor(path: string, wal?: boolean, options?: {
98
+ vectorCacheEntries?: number;
99
+ cipherKey?: string;
100
+ /**
101
+ * How `querySimilarEmbeddings` picks which stored vectors to score.
102
+ * `"exact"` (default) scores every candidate. `"prefilter"` ranks
103
+ * candidates with a coarse prefix projection first and exactly
104
+ * rescodes only the top-N — bounded work at large corpus sizes, * APPROXIMATE (a true neighbour ranked below the cutoff can be
105
+ * missed). Set via `MemOSConfig.storageOptions.semanticScan`.
106
+ */
107
+ semanticScan?: SemanticScanMode;
108
+ });
109
+ /**
110
+ * Open the database file, switching to the cipher-capable driver and
111
+ * applying `PRAGMA key` when encryption is configured. The key MUST be
112
+ * set before any other statement on an encrypted database.
113
+ */
114
+ private openDatabase;
115
+ /**
116
+ * Open the database and create tables / indices if they do not exist.
117
+ */
118
+ init(): Promise<void>;
119
+ /**
120
+ * One-time backfill: for every node, read the JSON `tags` column and
121
+ * ensure each tag exists in `node_tags`. Idempotent thanks to
122
+ * `INSERT OR IGNORE`. Runs inside a single transaction so a 100k-node
123
+ * database finishes in well under a second on a warm cache.
124
+ */
125
+ private migrateBackfillNodeTags;
126
+ /**
127
+ * One-time backfill of the `entity_index` inverted table for pre-existing
128
+ * rows (databases created before the table existed). Idempotent — nodes
129
+ * already present in the index are skipped. Delegates to
130
+ * `src/entity-index.ts`, which prefers each row's stored
131
+ * `metadata.entities` (canonicalized with the deployment's aliases at
132
+ * write time) and falls back to extracting from content.
133
+ */
134
+ private migrateBackfillEntityIndex;
135
+ /**
136
+ * Replace the `node_tags` rows for a single node. Used after
137
+ * `saveNode` / `updateNode` to keep the join table in lockstep with
138
+ * the JSON column.
139
+ *
140
+ * Runs inside the caller's transaction (saveNode/updateNode wrap their
141
+ * write + this call in one `db.transaction`) and reuses cached prepared
142
+ * statements — previously each call paid two uncached `db.prepare()`
143
+ * parses plus its own transaction commit.
144
+ */
145
+ private writeNodeTags;
146
+ /**
147
+ * ── item2: entity leg ── mirror a node's entities into the
148
+ * `entity_index` inverted table, keeping it in lockstep with the node
149
+ * row (the entity analogue of `writeNodeTags`). Runs inside the
150
+ * caller's transaction (`saveNode` / `updateNode`).
151
+ *
152
+ * Prefers the write-time canonicalized `metadata.entities` — `MemOS.store`
153
+ * canonicalizes with the deployment's `entityAliases`, so reusing it
154
+ * keeps the index consistent with query-time canonicalization. Falls
155
+ * back to extracting from content (built-in aliases) for rows written
156
+ * straight through storage.
157
+ */
158
+ private writeNodeEntities;
159
+ /**
160
+ * Migration-safe column addition. Checks if column exists before ALTER TABLE.
161
+ * SQLite does not support ALTER TABLE IF NOT EXISTS, so we check pragmatically.
162
+ */
163
+ private migrateAddColumn;
164
+ saveNode(node: MemoryNode): Promise<MemoryNode>;
165
+ getNode(id: string): Promise<MemoryNode | null>;
166
+ /**
167
+ * Record a read access. Routes through the same debounced
168
+ * `accessBuffer` as `getNode`, so a search that touches the top N
169
+ * results costs one coalesced UPDATE per id instead of a
170
+ * read-modify-write per hit — and, critically, does NOT stamp
171
+ * `updated_at`.
172
+ */
173
+ recordAccess(id: string): void;
174
+ private bufferAccess;
175
+ private scheduleAccessFlush;
176
+ /** Drain the buffered access counters to SQLite. */
177
+ flushAccessCounts(): void;
178
+ peekNode(id: string): Promise<MemoryNode | null>;
179
+ evictLeastImportant(): Promise<string | null>;
180
+ updateNode(id: string, input: UpdateMemoryInput): Promise<MemoryNode | null>;
181
+ deleteNode(id: string): Promise<boolean>;
182
+ appendTamperEntry(entry: NewTamperLogEntry): Promise<TamperLogEntry>;
183
+ readTamperLog(): Promise<TamperLogEntry[]>;
184
+ saveEdge(edge: MemoryEdge): Promise<MemoryEdge>;
185
+ /**
186
+ * Batch-insert multiple edges in a single transaction.
187
+ * Uses a cached prepared statement — ~10x faster than calling
188
+ * saveEdge() in a loop for 10+ edges.
189
+ */
190
+ saveEdgesBatch(edges: MemoryEdge[]): Promise<MemoryEdge[]>;
191
+ /**
192
+ * Prepared statement cache. better-sqlite3 caches at the C++ level,
193
+ * but the JS Statement wrapper is still recreated on each prepare()
194
+ * call. Caching the JS object avoids that overhead on hot paths.
195
+ */
196
+ private readonly stmtCache;
197
+ private getPreparedStatement;
198
+ getEdge(id: string): Promise<MemoryEdge | null>;
199
+ deleteEdge(id: string): Promise<boolean>;
200
+ /**
201
+ * Close (invalidate) the currently-valid edges incident to a node by
202
+ * stamping `valid_to`. Rows are updated, never deleted — as-of reads at
203
+ * earlier timestamps still return them. Returns the number of edges closed.
204
+ */
205
+ closeEdgesForNode(nodeId: string, validTo: number): Promise<number>;
206
+ queryNodes(filter?: SearchFilter): Promise<ScoredMemory[]>;
207
+ saveEmbedding(nodeId: string, vector: EmbeddingVector, model: string): Promise<void>;
208
+ getEmbeddingInfo(nodeId: string): Promise<EmbeddingRecordInfo | null>;
209
+ /**
210
+ * Bulk-fetch stored embedding vectors for the given node ids —
211
+ * the write-time contradiction scan's bounded neighbor lookup.
212
+ * Cache hits are zero-cost; misses are fetched in chunks of 500
213
+ * (SQLite bound-parameter limits). Returns only ids with a stored
214
+ * vector.
215
+ */
216
+ getEmbeddingVectors(nodeIds: string[]): Promise<Map<string, EmbeddingVector>>;
217
+ /**
218
+ * Record a contradiction pair. Node ids are canonicalized (sorted)
219
+ * so the UNIQUE(node_a, node_b) constraint dedups reversed pairs;
220
+ * INSERT OR IGNORE makes repeat detection idempotent.
221
+ */
222
+ addContradiction(nodeA: string, nodeB: string, status?: ContradictionStatus): Promise<ContradictionRecord>;
223
+ /**
224
+ * Bounded read-time lookup: recorded contradiction pairs where
225
+ * node_a OR node_b is in `nodeIds`. Empty input returns [] without
226
+ * touching the database.
227
+ */
228
+ getContradictionPairsFor(nodeIds: string[]): Promise<ContradictionRecord[]>;
229
+ updateContradictionStatus(id: string, status: ContradictionStatus): Promise<void>;
230
+ private rowToContradiction;
231
+ saveProceduralLesson(input: NewProceduralLesson): Promise<ProceduralLesson>;
232
+ getProceduralLesson(id: string): Promise<ProceduralLesson | null>;
233
+ updateProceduralLesson(id: string, patch: Partial<ProceduralLesson>): Promise<ProceduralLesson | null>;
234
+ listProceduralLessons(namespace?: string): Promise<ProceduralLesson[]>;
235
+ private rowToProceduralLesson;
236
+ /**
237
+ * Bounded id-prefix lookup backing citation resolution. Dashes in
238
+ * stored ids are ignored so `[mem:a3f9]` matches `a3f9c2e1-…`.
239
+ */
240
+ findNodesByIdPrefix(prefix: string): Promise<MemoryNode[]>;
241
+ getAllEmbeddingInfos(): Promise<Array<{
242
+ nodeId: string;
243
+ } & EmbeddingRecordInfo>>;
244
+ getAllEmbeddings(): Promise<Array<{
245
+ nodeId: string;
246
+ vector: EmbeddingVector;
247
+ model: string;
248
+ }>>;
249
+ setNodeNamespace(id: string, namespace: string): Promise<void>;
250
+ querySimilarEmbeddings(vector: EmbeddingVector, filter: SearchFilter | undefined, limit: number, threshold?: number, model?: string): Promise<ScoredMemory[]>;
251
+ /**
252
+ * Query image memories by CLIP vector similarity.
253
+ *
254
+ * Identical scoring to `querySimilarEmbeddings` — the scan loop is
255
+ * table-agnostic — but runs against `image_embeddings` and filters on
256
+ * model + dimensions, so a text-space vector can never be scored
257
+ * against a CLIP query (or vice versa).
258
+ *
259
+ * The hook for image→image search is already here: pass an
260
+ * *image-encoded* query and the same call returns the nearest
261
+ * neighbouring images ("more like this screenshot").
262
+ */
263
+ querySimilarImages(vector: EmbeddingVector, filter: SearchFilter | undefined, limit: number, threshold?: number, model?: string): Promise<ScoredMemory[]>;
264
+ /**
265
+ * The shared semantic scan. `space` selects the vector table
266
+ * (`embeddings` vs `image_embeddings`) AND the vectorCache namespace,
267
+ * so the two spaces can never cross even when one nodeId carries both.
268
+ */
269
+ private scanSimilar;
270
+ /**
271
+ * Rank candidate ids by cosine against a strided prefix projection of
272
+ * each stored vector (opt-in prefilter path). The projection is built
273
+ * once per stored row and cached with it, so repeat queries pay only
274
+ * the `dims / PREFILTER_STRIDE` dot product per candidate.
275
+ *
276
+ * Approximate by design: it orders candidates, it does not certify
277
+ * them. Callers must rescore the survivors exactly.
278
+ */
279
+ private rankByProjection;
280
+ /**
281
+ * Strided prefix projection used by the prefilter. Built lazily on the
282
+ * first prefilter query so the exact path never pays for it.
283
+ */
284
+ private project;
285
+ getEmbeddingModelCounts(): Promise<Array<{
286
+ model: string;
287
+ count: number;
288
+ }>>;
289
+ deleteEmbeddingsByModel(model: string): Promise<number>;
290
+ saveImageEmbedding(nodeId: string, vector: EmbeddingVector, model: string): Promise<void>;
291
+ getImageEmbeddingInfo(nodeId: string): Promise<EmbeddingRecordInfo | null>;
292
+ getAllImageEmbeddings(): Promise<Array<{
293
+ nodeId: string;
294
+ vector: EmbeddingVector;
295
+ model: string;
296
+ }>>;
297
+ getImageEmbeddingModelCounts(): Promise<Array<{
298
+ model: string;
299
+ count: number;
300
+ }>>;
301
+ deleteImageEmbedding(nodeId: string): Promise<boolean>;
302
+ deleteImageEmbeddingsByModel(model: string): Promise<number>;
303
+ queryEdges(filter?: {
304
+ sourceId?: string;
305
+ targetId?: string;
306
+ relation?: EdgeRelation;
307
+ validAt?: number;
308
+ }): Promise<MemoryEdge[]>;
309
+ getGraph(): Promise<GraphSnapshot>;
310
+ /**
311
+ * Bitemporal as-of graph read: nodes and edges whose validity interval
312
+ * covers `atTime` (unix ms). Predicates mirror the existing as-of read
313
+ * paths exactly — nodes use `valid_to >= ?` (see the `validAt` search
314
+ * filter), edges use strict `valid_to > ?` (see `queryEdges`).
315
+ */
316
+ getGraphAtTime(atTime: number): Promise<GraphSnapshot>;
317
+ setTTL(id: string, seconds: number): Promise<void>;
318
+ clearTTL(id: string): Promise<void>;
319
+ sweepExpired(): Promise<number>;
320
+ queryNodesByTag(tag: string): Promise<MemoryNode[]>;
321
+ /**
322
+ * ── item2: entity leg ── candidate generation for hybrid search: node
323
+ * ids whose indexed entities intersect `entities`, ranked by number of
324
+ * matched entities (desc), node id tiebreak. Backed by the
325
+ * `entity_index` inverted table — O(indexed entities), no content scan.
326
+ */
327
+ searchByEntities(entities: string[], limit: number): Promise<Array<{
328
+ nodeId: string;
329
+ matches: number;
330
+ }>>;
331
+ /**
332
+ * Per-harness memory counts for `memos harness list`. Legacy and
333
+ * unattributed rows read as `"unknown"` via the column default.
334
+ */
335
+ getHarnessCounts(): Promise<Array<{
336
+ harness: string;
337
+ count: number;
338
+ }>>;
339
+ /**
340
+ * Full node snapshot for harness merges (`memos harness merge
341
+ * --from`). Returns EVERYTHING — including historical (superseded)
342
+ * and quarantined rows — so the merge preserves the bitemporal
343
+ * version ledger verbatim. Read-only; the merge writes through the
344
+ * target storage's normal save path.
345
+ */
346
+ listAllNodes(): Promise<MemoryNode[]>;
347
+ /**
348
+ * Full edge snapshot for harness merges. Endpoints are remapped by
349
+ * the merge when node ids collide in the target.
350
+ */
351
+ listAllEdges(): Promise<MemoryEdge[]>;
352
+ deleteAllNodes(): Promise<void>;
353
+ close(): Promise<void>;
354
+ private rowToNode;
355
+ private rowToEdge;
356
+ /**
357
+ * In-process parsed-vector cache (nodeId -> vector + derived norms).
358
+ * The semantic leg otherwise re-fetches EVERY stored vector BLOB from
359
+ * SQLite on every query (tens of MB of memcpy per query on large
360
+ * stores). Writes go through this class, so invalidation is exact;
361
+ * external writers are not tracked (single-process deployments are the
362
+ * supported shape — the Python bridge runs one Node process).
363
+ *
364
+ * The entry bundles the squared L2 norm with the vector: it is
365
+ * computed once per stored row instead of once per query, and it is
366
+ * invalidated by the same `set`/eviction/clear that invalidates the
367
+ * vector itself, so it can never disagree with the stored row.
368
+ */
369
+ private vectorCache;
370
+ private vectorCacheMaxEntries;
371
+ private semanticScanMode;
372
+ private vectorCacheGet;
373
+ private vectorCacheSet;
374
+ /**
375
+ * Telemetry for the last `querySimilarEmbeddings` call. Read-only: the
376
+ * scan fills it in, nothing else mutates it.
377
+ */
378
+ private semanticScanTelemetry;
379
+ /** Scan telemetry for the most recent semantic query. */
380
+ get semanticScanStats(): SemanticScanStats;
381
+ private lookupStoredVector;
382
+ /**
383
+ * Zero-copy Float32Array view over a float32 BLOB. Byte-order and values
384
+ * are identical to `parseEmbedding`'s BLOB branch; alignment is guarded
385
+ * (Node Buffers are 8-byte aligned from the pool, but a sliced view may
386
+ * not be 4-byte aligned — those fall back to `parseEmbedding`).
387
+ */
388
+ private parseEmbeddingF32;
389
+ private parseEmbedding;
390
+ private serializeEmbedding;
391
+ private mapSortField;
392
+ private buildTagFilter;
393
+ private buildMetadataFilter;
394
+ /**
395
+ * Namespace/scope predicate shared by the FTS and structured query
396
+ * paths. Covers exact (`namespace`), multi (`namespaces`), and
397
+ * hierarchical (`namespacePrefix`) constraints. When
398
+ * `includeSharedScope` is set, the shared `default` namespace is OR'd
399
+ * in — a scoped read always sees shared memories (company-brain
400
+ * container semantics). Returns null when no namespace constraint is
401
+ * present (unscoped searches are untouched).
402
+ */
403
+ private buildNamespaceCondition;
404
+ /**
405
+ * Scoped-space inventory: every namespace with its live memory count.
406
+ * Powers `memos scope list`.
407
+ */
408
+ listNamespaces(): Promise<Array<{
409
+ namespace: string;
410
+ count: number;
411
+ }>>;
412
+ }
413
+ /**
414
+ * Load the cipher-capable driver (an API-compatible better-sqlite3 fork
415
+ * with multiple-cipher support). Kept optional: installs without it keep
416
+ * the default plaintext driver and never load this module. Exported for
417
+ * the `memos encrypt` / `memos decrypt` CLI commands.
418
+ */
419
+ export declare function loadCipherDriver(): typeof Database;
420
+ /**
421
+ * Encrypt a plaintext database in place. The original file is preserved
422
+ * as `<path>.plaintext.bak`. Uses the standard sqlcipher_export recipe.
423
+ * Returns the backup path.
424
+ */
425
+ export declare function encryptDatabase(dbPath: string, key: string): Promise<string>;
426
+ export declare function decryptDatabase(dbPath: string, key: string): Promise<string>;
427
+ //# sourceMappingURL=sqlite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../src/storage/sqlite.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAiBtC,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAGrB;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,CA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