neo4j-graphrag-python icon indicating copy to clipboard operation
neo4j-graphrag-python copied to clipboard

Add an optional node label in external retrievers to optimize the match query

Open stellasia opened this issue 11 months ago • 0 comments

It would be good to be able to filter on a node label in external retrievers (i.e. WeaviateNeo4jRetriever, QdrantNeo4jRetriever and PineconNeo4jRetriever) like this:

retriever = WeaviateNeo4jRetriever(
    driver=driver,
    client=client,
    collection="Entities",
    id_property_external="entity_id",
    id_property_neo4j="name",
    node_label="Entity",  # ADD THIS
)

and then update the get_match_query function to take into account this node_label in the Cypher query if provided.

stellasia avatar May 20 '25 15:05 stellasia