ccr-retrieve
Category: context · Cloud + Local · Status: v1 — production
ccr-retrieve completes the Compress-Cache-Retrieve loop. When the model calls prxy_retrieve, this module fetches the original content from blob storage ({ccrPrefix}/{hash}.txt) and returns it as a tool_result.
What it does
Two fulfillment paths:
- pre() — Request includes assistant
tool_useforprxy_retrievewithout matchingtool_result. Gateway injects results before the provider call. - Auto-loop — Provider returns
prxy_retrieveonly (non-streaming). Gateway fulfills internally and calls the provider again (up tomaxAutoLoops).
Model: prxy_retrieve({ hash: "abc…" })
Gateway: blob.get("ccr/abc….txt") → tool_result → model continues
Optional query parameter filters JSON arrays by substring.
When to use it
✅ Always pair with ccr-inject + structured-crusher (ccr: true)
✅ Agents that need reversible compression without client-side retrieve logic
✅ Non-streaming API calls (auto-loop)
❌ Without the CCR stack (no blobs to fetch)
Configuration
ccr-retrieve:
toolName: prxy_retrieve
ccrPrefix: ccr
maxAutoLoops: 4
fulfillPending: true
autoLoop: true
Metrics emitted
ccr-retrieve.applied(boolean)ccr-retrieve.pending_fulfilled(number)ccr-retrieve.auto_loops(number)ccr-retrieve.tool(string)ccr-retrieve.prefix(string)
Examples
Standard CCR pipeline:
- module: structured-crusher
config: { ccr: true }
- ccr-inject
- ccr-retrieve
Disable auto-loop (client handles all tool round-trips):
ccr-retrieve:
autoLoop: false
Auto-loop runs only on non-streaming requests. Streamed responses with prxy_retrieve require the client to send the assistant message back; ccr-retrieve fulfills in pre() on the follow-up request.