Query lessons for diff context
query_lessonsRetrieve relevant lessons from past mistakes to avoid errors in your code changes. Use this before opening a PR to get ranked guidance tailored to your diff.
Instructions
Token-budget retrieval of relevant learning rules (lessons) for a given code diff or PR context. Returns ranked lessons packed within max_tokens using bi-encoder retrieval + severity-weighted scoring. Use this before opening a PR, writing a fix, or asking "what mistakes should I avoid in this area of code?"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| diff_text | Yes | The PR diff, code snippet, or description of the change being made. | |
| max_tokens | No | Maximum tokens for returned lessons context (default 3000, max 8000). | |
| top_k | No | Max number of lessons to return (default 15, max 50). | |
| project_id | No | Project UUID. Defaults to configured project. |