memory-query-workflow ยท diff
git:20260509.9238157 to git:20260509.3a5a68e
41 added, 14 removed. Audit A to A.
---
name: memory-query-workflow
- description: Use when querying, tracing, or explaining information from an existing graphify graph instead of rereading the full source corpus.
+ description: Use when a graph already exists and the user needs retrieval, tracing, explanation, or gap detection from graph memory before reopening the full corpus.
---
# Memory Query Workflow
- Use built graph memory before reopening source files.
+ ## Overview
- Check:
+ Use existing graph memory first.
+ Query the graph before rereading source files unless the graph is missing, stale, or too weak for the question.
+
+ ## Required Check
+
```powershell
apx check graphify
```
- Required state:
+ ## Required State
+
- existing `graphify-out/graph.json`
- Routing:
- - broad question -> `graphify query`
- - relationship trace -> `graphify path`
- - concept explanation -> `graphify explain`
- - no graph -> run `memory-build`
- - stale graph -> recommend `graphify --update`
+ ## Routing
- Rules:
- - prefer graph retrieval over corpus reread
- - say when graph is missing, stale, or weak
+ | Question shape | Action |
+ |---|---|
+ | broad question about connected concepts | `graphify query` |
+ | trace between two concepts, files, or systems | `graphify path` |
+ | explain one concept or node in context | `graphify explain` |
+ | no graph exists | switch to `memory-build-workflow` |
+ | graph exists but corpus changed | recommend `graphify --update` before trusting results |
- Reference:
+ ## Core Rules
+
+ - prefer graph retrieval over full-corpus reread
+ - say explicitly when the graph is missing, stale, sparse, or weakly matched
+ - do not overclaim beyond what graph nodes and edges support
+ - when graph coverage is weak, use the graph result to target the next direct read instead of restarting broad exploration
+
+ ## Minimal Workflow
+
+ 1. Confirm `graphify-out/graph.json` exists.
+ 2. Choose `query`, `path`, or `explain` based on question shape.
+ 3. Answer from graph evidence first.
+ 4. If result quality is weak, say why: missing graph, stale graph, low coverage, or weak node match.
+ 5. Escalate to build/update or targeted reread only when needed.
+
+ ## Common Failure Modes
+
+ - skipping graph lookup and rereading everything
+ - hiding that the graph is stale or incomplete
+ - using `query` for a question that clearly needs a path trace
+ - treating no-result output as proof the corpus lacks the concept
+
+ ## Reference
+
- [`../graphify/UPSTREAM.md`](../graphify/UPSTREAM.md)