Skip to content

Commit 4e618d3

Browse files
committed
Dynamic cypher generation
1 parent e618df9 commit 4e618d3

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/content/docs/reference/graphrag/dynamic-cypher-generation.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ tags: ["Intermediate"]
66

77
## Required Graph Shape
88

9+
![Domain Graph](../../../../assets/images/domain-graph.svg)
910
[Domain Graph](/reference/knowledge-graph/domain-graph)
1011

1112
## Context
@@ -40,6 +41,22 @@ Still, the range of questions is limited by the provided snippets.
4041

4142
Snippets of parameterized Cypher queries and a description of what they do are made available to the LLM.
4243

44+
## Graph Query
45+
46+
```cypher
47+
// Which movies has ($director) directed?
48+
MATCH (d:Director)-[:DIRECTED]->(m:Movie)
49+
WHERE d.name = $director
50+
RETURN m.title, m.year
51+
```
52+
53+
```cypher
54+
// Which which movies were released between $startYear and $endYear
55+
MATCH (m:Movie)
56+
WHERE $startYear <= m.year <= $endYear
57+
RETURN m.title, m.year
58+
```
59+
4360
## Further reading
4461

4562
- [Build a Knowledge Graph-based Agent With Llama 3.1, NVIDIA NIM, and LangChain](https://medium.com/neo4j/build-a-knowledge-graph-based-agent-with-llama-3-1-nvidia-nim-and-langchain-feb65788e637) (Tomaz Bratanic, August 2024)

0 commit comments

Comments
 (0)