# AgentDiet RAG Context Window Distiller — Workflow Executor

> AgentDiet RAG Context Window Distiller — Workflow Executor is a paid API for AI agents from rag-diet.agentdiet.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-22).

Executes a deterministic context-compression workflow that distills and de-bloats AI context windows, reducing token usage by up to 91% via RAG-based distillation.

## Facts

- Endpoint: GET https://rag-diet.agentdiet.dev/v1/workflows/execute?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-22
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentdiet-rag-context-window-distiller-workflow-executor-a52f73a9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_AIa3_vIgE6xOwW--tFpxi

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agentdiet-rag-context-window-distiller-workflow-executor-a52f73a9
```

Example prompt: Compress this query's retrieved context using AgentDiet's RAG distiller so I can fit it into a smaller context window — run it as a GET workflow with the query 'what are the key findings from this research report?'

## When to prefer this

Choose this endpoint when you need to programmatically compress or distill large retrieved context (RAG chunks, documents, agent memory) before passing it to an LLM, especially when token budgets are tight or LLM API costs are a concern. It is particularly suited for A2A and agentic pipeline workflows where context is passed between nodes and must be kept under a token ceiling. Prefer it over generic summarization endpoints when you need a deterministic compression ratio proof and micropayment-settled ($0.01 USDC) per-call billing on Base.

## Known failure modes

- Missing required 'input' object or 'type'/'method' fields returns a validation error
- Invalid method enum value (not GET or POST) causes schema rejection
- Empty or malformed query string may result in low-quality distillation output
- Payment failure or insufficient USDC balance returns a 402 Payment Required response
- Service unavailability or upstream workflow node errors may return a non-ok status

## How this service works

Deterministic B2A/A2A/MCP/x402/MPP/L402 execution and intelligence node at https://rag-diet.agentdiet.dev settling in USDC on Base.

## Output

A JSON object containing a 'data' field with the compressed/distilled output, a 'status' field indicating success, and an 'roi_proof' object showing the compression_ratio_pct achieved (e.g. 91.4%), confirming how much the context was reduced.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "POST"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "query": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {},
  "status": "ok",
  "roi_proof": {
   "compression_ratio_pct": 91.4
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentdiet-rag-context-window-distiller-workflow-executor-a52f73a9/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from rag-diet.agentdiet.dev](https://www.zero.xyz/host/rag-diet.agentdiet.dev/llms.txt)
