1. 学习
  2. /
  3. 课程
  4. /
  5. Graph RAG with LangChain and Neo4j

Connected

练习

Building a text-to-Cypher chain

You've written you're own Cypher queries, so let's try using LLMs to generate them! Generating a Cypher query from a user query in natural language is a key part of a text-to-Cypher Graph RAG workflow.

You're working with the same database as the previous exercise, containing nodes that represent people, companies, and WORKS_FOR relationships available as graph.

说明

100 XP
  • Update the partial_variables dictionary to insert the graph schema into the prompt.
  • Create the text-to-Cypher chain using the prompt, llm, and parsing to a string.