custom_prompt
to cognee.cognify()
to control entity types, relationship labels, and extraction rules.
Before you start:
- Complete Quickstart to understand basic operations
- Ensure you have LLM Providers configured
- Have some text or files to process
Full Working Example
This simple example uses a few strings for demonstration. In practice, you can add multiple documents, files, or entire datasets - the custom prompt processing works the same way across all your data.
What Just Happened
Step 1: Add Your Data
add
function. The same approach works with multiple documents, files, or entire datasets.
Step 2: Write a Custom Prompt
custom_prompt
is ignored when temporal_cognify=True
.Step 3: Cognify with Your Custom Prompt
datasets
parameter.
Step 4: Ask Questions
SearchType.GRAPH_COMPLETION
to get answers that leverage your custom extraction rules.