Graph RAG with LangChain and Neo4j
Adam Cowley
Manager, Developer Education at Neo4j
Text | Vector Embedding |
---|---|
He's just a city boy born | [0.12, -0.34, 0.56, 0.78, ..., -0.91] |
born and raised in South Detroit | [0.22, 0.45, -0.67, 0.11, ..., 0.33] |
He took the midnight train | [-0.55, 0.89, 0.12, -0.44, ..., 0.67] |
going anywhere | [0.78, -0.23, 0.45, 0.91, ..., -0.12] |
act_splitter = RecursiveCharacterTextSplitter(
# Split text into acts
separators=[ r"\n\nTHE PROLOGUE.", r"\n\nACT",
r"\n\n\*\*\* END"],
is_separator_regex=True
)
scene_splitter = RecursiveCharacterTextSplitter(
# Split act into scenes
separators=[r"\nSCENE "],
is_separator_regex=True
)
Blog Posts
Tutorials
Graph RAG with LangChain and Neo4j