getContext
Builds a token-budgeted markdown brief of the user's working set—pinned and recently updated documents, key entities, and query-relevant hits—for loading at session start instead of many small reads.
Instructions
Assemble a token-budgeted markdown brief of the user's working set — pinned documents, recently-updated documents, key entities, and (when you pass a query) the most relevant hits — for loading at the start of a session. Deterministic and fast (no LLM). The brief never exceeds budgetTokens; lower-priority content is dropped behind a visible marker. Prefer this over many small reads when you need to warm up context about the user.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Optional focus. When set, the brief adds a section of the most query-relevant hits (documents + episodes), co-ranked by the same recall used by recall/ask. | |
| scopes | No | Scopes to read from: project, personal, team. Defaults to project+personal. Unknown values are rejected. | |
| budgetTokens | No | Token budget for the brief (default 4000). The brief never exceeds it; the lowest-priority tail is dropped behind a marker. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| budget | Yes | The token budget that was applied. | |
| tokens | Yes | Estimated token count of the brief (always <= budget). | |
| dropped | No | How many lower-priority items were omitted to fit the budget. | |
| markdown | Yes | The assembled context brief as markdown: pinned documents, recently-updated documents, key entities, and (when a query is given) relevant hits. Load this verbatim at session start. | |
| sections | No | Per-section counts of what made it into the brief. |