{"uid":"cap_8ChZf4Fc5F9nxSfgNw4er","slug":"agentdiet-rag-context-sanitizer-63169d98","name":"AgentDiet RAG Context Sanitizer","description":"Deterministic B2A/A2A/MCP/x402/MPP/L402 execution and intelligence node at https://rag-diet.agentdiet.dev settling in USDC on Base.","url":"https://rag-diet.agentdiet.dev/v1/workflows/rag-context-sanitizer?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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":{"text":{"type":"string"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"data":{},"status":"ok","roi_proof":{"compression_ratio_pct":91.4}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_OTIzBZYMCDigxL9jtUuyN","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compresses and sanitizes RAG context text to reduce token usage by up to 91% before feeding it into an AI agent's context window","exampleAgentPrompt":"Can you run this retrieved document text through AgentDiet's RAG context sanitizer to strip out the bloat and compress it before I send it to the LLM — I want to see the compression ratio too?","exampleUseCases":[{"title":"Shrink RAG chunks before LLM inference","prompt":"I've got a bunch of retrieved document chunks that are way too long for my context window — can you compress them using AgentDiet's context sanitizer so I'm only sending the essential content to the model?"},{"title":"Cut token costs on high-volume agent pipeline","prompt":"My agent is burning through tokens because the RAG context is huge. Run this text through the AgentDiet de-bloater and tell me what compression ratio we got so I can see the savings."},{"title":"Sanitize noisy web-scraped context for QA bot","prompt":"The text I scraped for my QA bot is full of junk — nav menus, footers, repeated headers. Can you pass it through AgentDiet's RAG sanitizer to clean it up and give me back just the meaningful content?"}],"resultDescription":"Returns a JSON object with a 'data' field containing the sanitized/compressed text and an 'roi_proof' object showing the compression_ratio_pct (e.g. 91.4%), along with a status field confirming success.","failureModes":["Missing or empty 'text' query parameter returns an error or empty data","Input text too large may exceed processing limits","Payment not settled in USDC on Base causes 402 rejection","Invalid HTTP method (not GET or POST) returns method-not-allowed","Network timeouts on very large context payloads"],"whenToPreferThis":"Choose this endpoint when you need deterministic, measurable token reduction for RAG-retrieved context before passing it to an LLM — especially when you need a provable compression ratio (roi_proof) and are operating in an A2A or MCP agent pipeline that supports x402 micropayments in USDC on Base. Prefer this over generic summarization APIs when you need consistent, repeatable compression rather than abstractive rewriting.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-22T12:44:47.738Z","isFirstParty":false,"canonicalSlug":"agentdiet-rag-context-sanitizer-63169d98"}