Skip to content

unstructured2graph: parameterize vector index name and dimension#243

Merged
antejavor merged 3 commits into
mainfrom
fix/237-parameterize-vector-index
Jul 24, 2026
Merged

unstructured2graph: parameterize vector index name and dimension#243
antejavor merged 3 commits into
mainfrom
fix/237-parameterize-vector-index

Conversation

@antejavor

Copy link
Copy Markdown
Contributor

Summary

  • create_vector_search_index hardcoded the index name (vs_name) and dimension: 384 as literals. The dimension only matched lightrag_memgraph.embeddings.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 via build_memgraph_sentence_embed(...) would get a silent vector-index mismatch, and the fixed index name blocked creating a second index (e.g. on an Entity label).
  • Exported DEFAULT_EMBEDDING_DIM and DEFAULT_MODEL_NAME from lightrag_memgraph's top-level __init__.py.
  • Added dimension and index_name params to create_vector_search_index, defaulting dimension from DEFAULT_EMBEDDING_DIM.

Test plan

  • lightrag_memgraph test confirms DEFAULT_EMBEDDING_DIM/DEFAULT_MODEL_NAME are importable from the top-level package and match the submodule values.
  • create_vector_search_index unit tests: default dimension tracks DEFAULT_EMBEDDING_DIM; custom dimension/index_name are honored (supports a second index on another label).
  • pytest passes for both integrations/lightrag-memgraph and unstructured2graph.

Closes #237

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
@antejavor
antejavor merged commit a5cb8eb into main Jul 24, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unstructured2graph: create_vector_search_index hardcodes dimension and index name

1 participant