Add LodeDB vector database adapter - #130
Open
Davidobot wants to merge 2 commits into
Open
Conversation
Register LodeDB (local-first, on-disk, in-process vector store) as a cognee
vector_db_provider under packages/vector/lodedb. The adapter implementation ships
in the lodedb package (lodedb.local.integrations.cognee.CogneeLodeDBAdapter), where
it is maintained and tested against LodeDB's API; this package registers it via
use_vector_adapter("lodedb", ...).
cognee owns embedding, so the adapter uses LodeDB's vector-in path: one LodeDB index
per collection under vector_db_url, the serialized DataPoint payload in LodeDB's
raw-text sidecar, and belongs_to_set membership as scalar presence keys for node_name
filtering. Includes register/adapter/__init__ modules, pyproject, README, example,
.env.example, and offline tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
cognee-community-vector-adapter-lodedb, registering LodeDB as a cogneevector_db_provider. LodeDB is a local-first, on-disk, in-process vector store (no server, no account, no API key): an exact brute-force scan by default, optional IVF-style ANN for large corpora, hybrid (vector + BM25) retrieval, and O(changed) delta persistence for fast incremental writes.How it works
cognee owns embedding (its
EmbeddingEngine), so the adapter uses LodeDB's vector-in path:vector_db_url(a local directory, created if absent).retrieveandinclude_payloadsearches return it.belongs_to_setmembership is stored as scalar metadata presence keys, sonode_name(NodeSet) filtering pushes into LodeDB's metadata planner rather than post-filtering in Python.1 - cosine_similarity.Implements the full
VectorDBInterface(has_collection,create_collection,create_data_points,search,batch_search,retrieve,delete_data_points,create_vector_index,index_data_points,prune,embed_data) plusremove_belongs_to_set_tagsandupsert_raw_vectors.The adapter implementation ships in the
lodedbpackage (lodedb.local.integrations.cognee, added in lodedb 1.3.1) where it is maintained and tested against LodeDB's API; this package registers it viause_vector_adapter("lodedb", ...).Usage
Or via env (
.env.example):VECTOR_DB_PROVIDER=lodedb,VECTOR_DB_URL=./.lodedb.Contents
cognee_community_vector_adapter_lodedb/—registermodule + adapter re-exportpyproject.toml(lodedb>=1.3.1,cognee>=1.1.0,<2),README.md,example.py,.env.exampletests/test_lodedb.py— offline tests (deterministic stub embedding, no LLM or network): provider registration, create/search/retrieve roundtrip, andnode_name(belongs_to_set) filtering.Notes
I held off on adding a
test_lodedb.ymlworkflow and a committed lockfile, since CI wiring depends on the org's LLM/embedding secrets and your preferred lock tooling. Happy to add a per-package workflow following the milvus/qdrant pattern (the included tests are offline and need no secrets) and apoetry.lockif you'd like.