feat(integrations): add LlamaIndex VectorStore adapter#7
Open
Davidobot wants to merge 1 commit into
Open
Conversation
Add `LodeDBVectorStore`, a LlamaIndex `BasePydanticVectorStore` backed by the local LodeDB SDK, alongside the existing LangChain adapter. Installable via the new `lodedb[llama-index]` extra. The adapter is text-path: the LodeDB SDK is text-in and embeds internally (there is no precomputed-vector entry point), so it sets `is_embedding_query=False` and feeds node text and the raw query string to LodeDB. LlamaIndex's own embed_model is therefore not used for indexing or querying. - add / query / delete / delete_nodes, plus node_ids and doc_ids scoping - exact-match metadata filter translation (EQ + AND) - exact top-k only (VectorStoreQueryMode.DEFAULT) - unsupported operators/conditions, non-DEFAULT modes, get(), get_nodes(), and filter-based deletion raise clearly (LodeDB exposes no vector read or metadata enumeration) Also adds a runnable example and roundtrip + unsupported-ops tests (gated on the optional dep), updates README/CHANGELOG/docs, and broadens the gitignore data-dir pattern to /data*/ so example stores stop leaking into git status.
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 a LlamaIndex
VectorStoreadapter for LodeDB —LodeDBVectorStore, allama_index.core.vector_stores.types.BasePydanticVectorStorebacked by the local LodeDB SDK — alongside the existing LangChain adapter. Installable via the newlodedb[llama-index]extra.This unlocks the LlamaIndex ecosystem directly and is the prerequisite for app-level integrations built on LlamaIndex's vector-store abstraction (e.g. PrivateGPT).
Design
The adapter is text-path. The
LodeDBSDK is text-in and embeds internally —add()/search()take strings and there is no precomputed-vector entry point — so the adapter setsis_embedding_query=Falseand feeds LlamaIndex node text (node.get_content) and the rawquery.query_strto LodeDB, which does the embedding. LlamaIndex's ownembed_modelis not used for indexing or querying. (Honoring it would require a vector-in LodeDB API that does not exist yet.)Supported:
add/query/delete/delete_nodes,client,persist, async shimsnode_idsanddoc_idsquery scoping (doc-id resolution is session-local via a ref-doc map)EQ+AND)VectorStoreQueryMode.DEFAULT)Raises clearly where LodeDB cannot honor the contract (all documented in the module docstring): non-
EQ/OR/ nested filters, non-DEFAULT query modes,get()(no full-precision vector read), andget_nodes/ filter-based deletion (no metadata enumeration).Changes
src/lodedb/local/integrations/llama_index.py— the adapterexamples/llama_index_store.py— runnable exampletests/test_local_integrations.py— roundtrip + unsupported-ops tests (gated on the optional dep)pyproject.toml—llama-indexextra.gitignore— broaden/data/→/data*/so example data dirs (data_langchain/,data_llama_index/, …) stop leaking intogit statusTesting
uv run pytest tests/test_local_integrations.py tests/test_import_boundary.py→ 5 passeduv run ruff check/ruff format --check→ cleanuv run python examples/llama_index_store.pyruns end-to-end on the real MiniLM model (semantically correct ranking)import lodedbdoes not importllama_index— the optional-dependency boundary is intact