Skip to content

Instantly share code, notes, and snippets.

@JoshChima
JoshChima / sql-entity-extractor-prompt.py
Last active September 25, 2024 06:21
A prompt for extracting SQL entities for use in Microsoft's graphrag implementation. Builds on the default entity extraction prompt by modifying prompt goals. Includes SQL specific extraction examples.
# !!Note: Still a work in progress
# A prompt for extracting SQL entities for use in Microsoft's graphrag implementation. Builds on the default entity extraction prompt by modifying prompt goals. Includes SQL specific extraction examples.
# Original Prompt: https://github.com/microsoft/graphrag/blob/main/graphrag/index/graph/extractors/graph/prompts.py
GRAPH_EXTRACTION_PROMPT = """
-Goal-
Given the following information regarding entities in a sql database:
- Table & View DDL