1. Learn
  2. /
  3. Courses
  4. /
  5. Retrieval Augmented Generation (RAG) with LangChain

Connected

Exercise

Creating a Cypher few-shot prompt

The final technique you'll utilize to improve the reliability of the generated Cypher is providing a few-shot prompt. Few-shot prompts are a great way of steering a model toward a desired output without needing to fine-tune it on a large dataset of examples.

A set of examples tailored to this particular use case is available as examples; feel free to print it in the shell to view its contents. You'll use these to create a few-shot prompt for the Cypher generation process. The graph you created before is still available as graph.

Instructions 1/2

undefined XP
    1
    2
  • Create an example prompt template from the string provided.
  • Use the example_prompt, examples, and prefix and suffix provided to create a few-shot prompt.