Retrieve Lessons
retrieve_lessonsRetrieve relevant past lessons for any tool action, offering per-action guidance before execution to prevent repeated costly mistakes.
Instructions
Retrieve the most relevant lessons for a given tool/action context. Use in PreToolUse hooks for per-action guidance.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scope | No | ||
| filters | No | Pre-filter the candidate corpus before lexical or vector ranking. | |
| toolName | Yes | The tool being called (e.g., Bash, Edit, Read) | |
| maxResults | No | Max lessons to return (default 5) | |
| queryRewrite | No | Enable bounded deterministic synonym expansion when the original lexical match is weak. Defaults true. | |
| requireScope | No | Fail closed unless a complete four-field scope is supplied. | |
| actionContext | No | Description of what the tool call is doing | |
| includeShared | No | Include explicitly shared memories with scoped results. Defaults true. | |
| includeRetrievalMeta | No | Include path provenance such as lexical/dense pools and query variants. |