DR Context Pipeline v1 (retrieval + compression + lint)
name: dr-context-pipeline-v1
by daniel-refahi-ikara · published 2026-03-22
$ claw add gh:daniel-refahi-ikara/daniel-refahi-ikara-dr-context-pipeline---
name: dr-context-pipeline-v1
description: "Deterministic memory/context pipeline for agents: route a user message, retrieve relevant memory snippets, compress into a cited Context Pack (sources are snippet IDs), lint, and fall back safely. Prerequisite: a file-based memory layout with memory/always_on.md + topic files (works out-of-the-box with dr-memory-foundation). Use when building or standardizing agent memory, reducing prompt bloat, implementing retrieval+compression, creating a context pack, designing a memory pipeline, adding lint gates, or setting up golden regression tests for agent context."
---
# DR Context Pipeline v1 (retrieval + compression + lint)
Use this skill to standardize how an agent loads memory into its prompt **for correctness**.
Prerequisites
Operating procedure (default)
1) Load the always-on policy + topic catalog (your `memory/always_on.md`).
2) Route the message deterministically (task type + caps) using `references/router.yml`.
3) Retrieve top relevant snippets from your memory store; emit a **Retrieval Bundle JSON** (see schema).
4) Compress Retrieval Bundle → **Context Pack JSON** using `references/compressor_prompt.txt`.
- **IMPORTANT:** Context Pack `sources` MUST be **snippet IDs only** (`S1`, `S2`, …).
5) Lint the Context Pack. If lint fails, **skip compression** and fall back to raw retrieved snippets.
6) Call the main reasoning model with: always-on policy header + Context Pack (+ raw snippets for high-stakes tasks) + user message.
What to read / use
Notes
More tools from the same signal band
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...