query_lessons
Retrieve active lessons for a project across its scope hierarchy, filtering by area, tags, or free-text semantic search to surface relevant coding rules and lessons.
Instructions
Query active lessons visible to a project across its full scope hierarchy (most-specific scope first), via plain SQL filtering or — when query_text is set and embeddings exist — semantic search.
Access level: read. Returns: a JSON or TOON array of matching lessons.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| area | No | Filter by area_affected, e.g. 'deployment', 'performance', 'security'. | |
| tags | No | Comma-separated tags; matched by exact tag equality, not substring. | |
| detail | No | 'summary': metadata only. 'full': also includes what_happened text (may return STALE_INDEX per row if its source file changed since indexing). | summary |
| format | No | Output format: 'json' or 'toon' (compact tabular). | json |
| project_id | Yes | Project id (with or without the 'project-' prefix). | |
| query_text | No | Free-text query. When set and ChromaDB has embeddings, enables semantic (RAG) search instead of plain SQL filtering. | |
| include_deprecated | No | Include deprecated lessons. Only affects plain SQL filtering — deprecated lessons are removed from the semantic (query_text) index on deprecation, so this does not revive them there. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |