Architecture Context
arch_contextRetrieves relevant components, decisions, and lessons for a question or touched files, helping agents check architectural memory before non-trivial code changes.
Instructions
Retrieve architectural memory relevant to a question or set of touched files. Returns three card kinds, each with an updated-at age stamp:
Components: what parts the system is made of.
Decisions: why they were built that way.
Lessons: rules that survived previous mistakes — each rule comes with
why(incident context) andwhen(when to apply) continuation bullets. Superseded and deprecated cards are hidden by default. Cards older than 90 days are prefixed with⚠ stale— verify them against the current code before acting. Call this BEFORE any non-trivial change. Returns an init hint when the arch layer is empty.
Each kind has its own independent top-N budget — a verbose decision bucket can't starve components. Pass limits: { component, decision, lesson } to override the per-kind cap (default 5 each, max 50; 0 suppresses the kind). When you pass project, cards whose payload matches that project also get a small additive rank boost (~one calibrated tier) so short global cards don't drown out longer project-scoped ones on raw cosine — globals stay visible but no longer dominate. When you suspect ranking issues, prefer arch_list for ground-truth enumeration.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| group | No | Specific group, or omit to query all known groups | |
| limits | No | Per-kind result limits — components, decisions, and lessons each get their own top-N so a verbose decision bucket cannot starve components out of the output. Default is 5 per kind. Set a kind to 0 to suppress it entirely. | |
| project | No | Scope results to a single project inside the group (same value the indexer uses as `payload.project` on code chunks). Components are filtered hard — a component without `project=X` is dropped. Decisions and lessons are filtered soft — cards with `project=X` OR no `project` field pass through, so globally-scoped guidance still surfaces. Omit to query the whole group. | |
| question | Yes | Question, or comma-separated list of files being touched | |
| min_score | No | Drop hits whose cosine similarity is below this threshold. Default 0.45. Lower it (e.g. 0.30) when the arch memory is sparse and you want broader recall; raise it (e.g. 0.60) when you only want high-confidence matches. |