-
Notifications
You must be signed in to change notification settings - Fork 1
systems embeddings and kuzu
Active contributors: Bryan
Embeddings and Kuzu are optional local extensions. src/lode/embeddings.py calls a TEI-compatible embedding endpoint, while src/lode/kuzu_store.py projects SQLite facts into an embedded Kuzu graph database.
src/lode/embeddings.py # HTTP embedding client with retry
src/lode/kuzu_store.py # SQLite-to-Kuzu projection
src/lode/storage.py # embedding queue, vectors, and source facts
docker-compose.yml # local TEI service wiring
| Name | File | Description |
|---|---|---|
embed_texts() |
src/lode/embeddings.py |
Sends text batches to a local embedding endpoint. |
pending_embedding_nodes() |
src/lode/storage.py |
Reads queued nodes for embedding. |
upsert_embedding() |
src/lode/storage.py |
Stores vectors and model metadata. |
sync_from_sqlite() |
src/lode/kuzu_store.py |
Rebuilds the Kuzu projection from SQLite. |
reset_schema() |
src/lode/kuzu_store.py |
Recreates Kuzu node and edge tables. |
replace_file_index() in src/lode/storage.py queues functions, methods, classes, routes, and doc sections that have content hashes. The lode embed command in src/lode/cli.py reads queued nodes, calls embed_texts() in src/lode/embeddings.py, and persists vectors through upsert_embedding().
lode kuzu-sync calls sync_from_sqlite() in src/lode/kuzu_store.py. The implementation resets Kuzu schema, inserts SQLite nodes into a Node table, and inserts SQLite edges into a LINK relationship table.
graph LR
SQLite[(SQLite facts)] --> Queue[embedding_queue]
Queue --> TEI[local TEI endpoint]
TEI --> Vectors[(embeddings)]
SQLite --> Kuzu[(Kuzu graph)]
-
docker-compose.ymlrunsghcr.io/huggingface/text-embeddings-inference:cpu-1.9. -
src/lode/config.pydefines SQLite and Kuzu data paths. -
pyproject.tomlputs Kuzu behind thekuzuoptional dependency.
Change embedding request behavior in embed_texts() in src/lode/embeddings.py. Change projected graph schema in reset_schema() and sync_from_sqlite() in src/lode/kuzu_store.py, then verify tests that cover optional dependency behavior.
| File | Purpose |
|---|---|
src/lode/embeddings.py |
Local embedding HTTP client. |
src/lode/kuzu_store.py |
Kuzu projection. |
src/lode/storage.py |
Embedding queue and vector persistence. |
docker-compose.yml |
Local embedding service. |
pyproject.toml |
Optional dependency declaration. |