Default Prompt
The default LLM reranker prompt is designed to be general-purpose:Custom Prompt Configuration
You can provide a custom prompt template when configuring the LLM reranker:Prompt Variables
Your custom prompt can use the following variables:Variable | Description |
---|---|
{query} | The search query |
{memories} | The list of memory entries to rank |
{user_id} | The user ID (if available) |
{user_context} | Additional user context (if provided) |
Domain-Specific Examples
Customer Support
Educational Content
Personal Assistant
Advanced Prompt Techniques
Multi-Criteria Ranking
Contextual Ranking
Best Practices
- Be Specific: Clearly define what makes a memory relevant for your use case
- Use Examples: Include examples in your prompt for better model understanding
- Structure Output: Specify the exact JSON format you want returned
- Test Iteratively: Refine your prompt based on actual ranking performance
- Consider Token Limits: Keep prompts concise while being comprehensive
Prompt Testing
You can test different prompts by comparing ranking results:Common Issues
- Too Long: Keep prompts under token limits for your chosen LLM
- Too Vague: Be specific about ranking criteria
- Inconsistent Format: Ensure JSON output format is clearly specified
- Missing Context: Include relevant variables for your use case