Query lessons for diff context
query_lessonsRetrieve the most relevant learning rules for a code diff to inform fixes and PRs, using bi-encoder retrieval and severity-weighted scoring.
Instructions
Retrieve the learning rules ("lessons") most relevant to a given code diff or PR context, packed within a token budget. Uses bi-encoder retrieval + severity-weighted scoring; pass the diff/description as the query and max_tokens (default 2000). Returns ranked { lessons: [{ title, rule, severity }] }. Read-only. Use before writing a fix or opening a PR; use list_lessons to browse all lessons unfiltered.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top_k | No | Max number of lessons to return (default 15, max 50). | |
| 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). | |
| project_id | No | Project UUID. Defaults to configured project. |