Skip to content

fix: use fetched embedding property in vector cypher retriever#541

Open
liuzemei wants to merge 1 commit into
neo4j:mainfrom
liuzemei:fix-vector-cypher-filter-property-540
Open

fix: use fetched embedding property in vector cypher retriever#541
liuzemei wants to merge 1 commit into
neo4j:mainfrom
liuzemei:fix-vector-cypher-filter-property-540

Conversation

@liuzemei

@liuzemei liuzemei commented Jun 8, 2026

Copy link
Copy Markdown

Summary

  • use the fetched _embedding_node_property for VectorCypherRetriever filtered fallback queries
  • add a regression test for the procedure fallback path with metadata filters

Fixes #540

Tests

  • uv run pytest tests/unit/retrievers/test_vector.py::TestVectorCypherRetrieverSearchClausePath::test_filtered_fallback_uses_fetched_embedding_property -q
  • uv run pytest tests/unit/retrievers/test_vector.py -q
  • uv run pytest tests/unit/retrievers/test_base.py tests/unit/retrievers/test_hybrid.py tests/unit/retrievers/test_retriever_parameter_inference.py tests/unit/retrievers/test_text2cypher.py tests/unit/retrievers/test_tools_retriever.py tests/unit/retrievers/test_vector.py -q
  • uv run ruff format --check src/neo4j_graphrag/retrievers/vector.py tests/unit/retrievers/test_vector.py
  • uv run ruff check src/neo4j_graphrag/retrievers/vector.py tests/unit/retrievers/test_vector.py
  • git diff --check

Signed-off-by: Sheldon <neooosky@gmail.com>
@liuzemei
liuzemei requested a review from a team as a code owner June 8, 2026 04:43
self.result_formatter = validated_data.result_formatter
self._node_label = None
self._node_embedding_property = None
self._embedding_node_property = None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

filters={"organization": {"$eq": "neo4j"}},
)

expected_query, search_params = get_search_query(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand what this test is doing. It's never testing that the property was properly populated (_fetch_index_info is moched) and it's also never testing the actual query being generated?

@stellasia

Copy link
Copy Markdown
Contributor

Hey @liuzemei ,

To be able to merge your changes we will need a signed CLA from you.
See http://neo4j.com/developer/cla/ for further information.

Thanks

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.

[BUG]: VectorCypherRetriever: filtered vector search fails because _node_embedding_property is never populated

3 participants