I am working with the Neo4jGraph
object and passing it to the GraphCypherQAChain
. However, I want to restrict access to specific parts of the graph, such as only allowing certain node labels (e.g. ,Person
, Company
) and certain relationship types (e.g., WORKS_AT
).
This is what i am using
from langchain_community.graphs import Neo4jGraph
graph.refresh_schema()
print(graph.schema)
chain = GraphCypherQAChain.from_llm(graph=graph,
cypher_llm = cypher_model,
qa_llm= qa_model,
verbose=True,
validate_cypher = True,
allow_dangerous_requests=True
#use_function_response = True
)
This Neo4jGraph Object is returning all the Nodes and Relationships present in the DB. But i want to apply filter on this object so i can access only specific node or relationship. Is there any way to do it?
Any help would be really Appreciated!