memory-optimization-workflow · git:20260509.af5c7ee · 2026-05-09 · sha256 21baf7c8a7deb766

memory-optimization-workflow git:20260509.af5c7eeA

Immutable. This exact content is served forever at /api/v1/blob/21baf7c8a7deb766.

---
name: memory-optimization-workflow
description: Use when deciding the cheapest context path across direct reading, markdown conversion, graph build, incremental update, or graph query for mixed corpora.
---

# Memory Optimization Workflow

Minimize token spend and reread cost.

Fast routing:
- small plain-text corpus -> read directly
- PDF / Office docs -> `markitdown`
- noisy web pages -> `defuddle`
- repeated questions across same corpus -> `graphify`
- existing graph + changed sources -> `graphify --update`
- existing graph + new question -> graph query first

Checks:

```powershell
apx check graphify
apx check markitdown-file-intake
apx check defuddle
```

Rules:
- prefer Markdown over binary/doc formats
- prefer graph memory over full rereads
- stop and report missing tools

References:
- [`../../references/HELPER_TOOLS.md`](../../references/HELPER_TOOLS.md)
- [`../../references/GRAPHIFY_PROVENANCE.md`](../../references/GRAPHIFY_PROVENANCE.md)