memory.fetch_context
Retrieve a ranked Markdown context pack from project memory, including current task state and conventions. Use before reading source files to prioritize relevant sections.
Instructions
Return a budgeted, ranked Markdown context pack assembled from the project's .agent-memory/ files. Call this before reading source files manually; the pack contains current task state, conventions, and any sections relevant to the query. An empty query returns the bootstrap pack (local current state + conventions + index summary).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | search query; empty returns the bootstrap pack | |
| scope | No | paths or module names to prioritize via substring match | |
| budget | No | approximate character budget for the returned pack; 0 uses manifest default | |
| include | No | context categories to include (advisory in M2; M3 enforces) | |
| exclude_archive | No | if true, archive/ files are skipped entirely; defaults to false |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context | Yes | the Markdown context pack | |
| included_files | Yes | per-file provenance for everything in the pack | |
| omitted | No | candidates that were dropped (budget exhausted, parse error, etc.) | |
| suggested_next_queries | No | ||
| context_metadata | Yes |