unstructured2graph: parameterize vector index name and dimension#243
Merged
Conversation
create_vector_search_index hardcoded the index name ("vs_name") and
dimension (384) as literals. The dimension only matched
lightrag_memgraph's DEFAULT_EMBEDDING_DIM by coincidence -- nothing kept
them in sync, and that constant wasn't even reachable from
lightrag_memgraph's top-level __init__.py. A caller swapping in a
different embedding model/dim would get a silent vector-index mismatch,
and the fixed index name blocked creating a second index (e.g. on an
Entity label).
- Export DEFAULT_EMBEDDING_DIM and DEFAULT_MODEL_NAME from
lightrag_memgraph's top-level __init__.py.
- Add dimension and index_name params to create_vector_search_index,
defaulting dimension from DEFAULT_EMBEDDING_DIM.
Fixes #237
6 tasks
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
create_vector_search_indexhardcoded the index name (vs_name) anddimension: 384as literals. The dimension only matchedlightrag_memgraph.embeddings.DEFAULT_EMBEDDING_DIMby coincidence -- nothing kept them in sync, and that constant wasn't even reachable fromlightrag_memgraph's top-level__init__.py. A caller swapping in a different embedding model/dim viabuild_memgraph_sentence_embed(...)would get a silent vector-index mismatch, and the fixed index name blocked creating a second index (e.g. on anEntitylabel).DEFAULT_EMBEDDING_DIMandDEFAULT_MODEL_NAMEfromlightrag_memgraph's top-level__init__.py.dimensionandindex_nameparams tocreate_vector_search_index, defaultingdimensionfromDEFAULT_EMBEDDING_DIM.Test plan
lightrag_memgraphtest confirmsDEFAULT_EMBEDDING_DIM/DEFAULT_MODEL_NAMEare importable from the top-level package and match the submodule values.create_vector_search_indexunit tests: default dimension tracksDEFAULT_EMBEDDING_DIM; customdimension/index_nameare honored (supports a second index on another label).pytestpasses for bothintegrations/lightrag-memgraphandunstructured2graph.Closes #237