You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: API.md
+19-18Lines changed: 19 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ sqlite-memory enables semantic search over text content stored in SQLite. It:
32
32
33
33
## Sync Behavior
34
34
35
-
All `memory_sync_*` functions use **content-hash change detection** to avoid redundant embedding computation. Each piece of content is hashed before processing — if the hash already exists in the database, the content is skipped.
35
+
All `memory_add_*` functions use **content-hash change detection** to avoid redundant embedding computation. Each piece of content is hashed before processing — if the hash already exists in the database, the content is skipped.
36
36
37
37
### Change Detection
38
38
@@ -114,6 +114,7 @@ Configures the embedding model to use.
114
114
- Remote embedding requires a free API key from [vectors.space](https://vectors.space) (set via `memory_set_apikey`)
115
115
- Settings are persisted in `dbmem_settings` table
116
116
- For local models, the embedding engine is initialized immediately
117
+
-**Automatic reindex**: If a model was previously configured and the new provider/model differs, all existing content is automatically re-embedded with the new model. File-based entries are re-read from disk; text-based entries are re-embedded from stored content. Errors on individual entries are silently skipped (best-effort)
@@ -147,11 +147,11 @@ memories = recall("what's the project timeline")
147
147
148
148
## Intelligent Sync
149
149
150
-
All `memory_sync_*` functions use content-hash change detection to avoid redundant work:
150
+
All `memory_add_*` functions use content-hash change detection to avoid redundant work:
151
151
152
-
-**`memory_sync_text`** — Computes a hash of the content. If the same content was already indexed, it is skipped entirely. No duplicate embeddings are ever created.
153
-
-**`memory_sync_file`** — Reads the file and hashes its content. If the file was previously indexed with different content, the old entry (chunks, embeddings, FTS) is atomically replaced. Unchanged files are skipped.
154
-
-**`memory_sync_directory`** — Performs a full two-phase sync:
152
+
-**`memory_add_text`** — Computes a hash of the content. If the same content was already indexed, it is skipped entirely. No duplicate embeddings are ever created.
153
+
-**`memory_add_file`** — Reads the file and hashes its content. If the file was previously indexed with different content, the old entry (chunks, embeddings, FTS) is atomically replaced. Unchanged files are skipped.
154
+
-**`memory_add_directory`** — Performs a full two-phase sync:
155
155
1.**Cleanup**: Removes database entries for files that no longer exist on disk
156
156
2.**Scan**: Recursively processes all matching files — adding new ones, replacing modified ones, and skipping unchanged ones
157
157
@@ -240,7 +240,7 @@ make test
240
240
241
241
-**Local Engine**: Built-in llama.cpp for on-device embeddings (requires GGUF model)
242
242
-**Remote Engine**: [vectors.space](https://vectors.space) API for cloud embeddings (requires free API key)
243
-
-**File I/O**: `memory_sync_file` and `memory_sync_directory` functions
243
+
-**File I/O**: `memory_add_file` and `memory_add_directory` functions
0 commit comments