{"uid":"cap_91ZDk-DOF6o3cZJyYrzX_","slug":"agent402-tools-rag-corpus-prep-c85c4a18","name":"agent402.tools RAG Corpus Prep","description":"Bundled execution of the RAG corpus prep workflow - Take a raw document and turn it into a vector-DB-ready JSONL dataset, deterministically. Measures the corpus, token-counts it with the real OpenAI BPE, chunks at the right token boundary, attache...","url":"https://agent402.tools/api/skill/rag-prep","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"doc":{"type":"string","description":"the source document to prep for embedding (raw text, no markup required)"}}},"responseSchema":{"type":"json","example":{"args":{"doc":"Alice from acme@example.com filed a support ticket on 2026-06-21 about the checkout flow returning a 502 from api.acme.com/v2/orders. Engineer Bob investigated and found the issue was a connection-pool exhaustion in the order-service: postgres max_connections was 100 and the pool had been silently leaking since the rollout of feature flag #orders-2026. Fix landed in commit 9a3b2c1; deploy went out 2026-06-22. Follow-up: add pgbouncer in front of the order-service and an alert on pool.in_use / max_connections > 0.8 in PagerDuty. Slack thread: #incident-orders-502. Mentioned engineers: @alice @bob @carol."},"pack":"rag-prep","steps":[{"ok":true,"slug":"text-stats","result":{}},{"ok":true,"slug":"token-count","result":{}},{"ok":true,"slug":"text-chunk","result":{}},{"ok":true,"slug":"extract-entities","result":{}},{"ok":true,"slug":"keywords","result":{}},{"ok":true,"slug":"jsonl","result":{}},{"ok":true,"slug":"json-validate","result":{}}],"summary":"7/7 steps succeeded"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.05","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.05/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Pt1j3SU91qEq1qmmNxf2b","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.05","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Takes a raw document and produces a vector-DB-ready JSONL dataset by measuring, token-counting (OpenAI BPE), and chunking the text at correct token boundaries.","exampleAgentPrompt":"Take this raw text and prep it for my vector database — tokenize it with OpenAI BPE, chunk it at proper token boundaries, and return a JSONL dataset I can feed straight into my embedding pipeline: [raw document text here].","exampleUseCases":null,"resultDescription":"A vector-DB-ready JSONL dataset where each record represents a properly token-bounded chunk of the source document, annotated with token counts and ready for embedding ingestion.","failureModes":["Empty or missing 'doc' field returns a 400 validation error","Document too large may exceed processing limits","Malformed input (non-string doc) returns schema validation error","Network timeout on very large documents","Payment failure (x402) results in 402 Payment Required before processing begins"],"whenToPreferThis":"Choose this endpoint when you need a deterministic, reproducible chunking pipeline that uses real OpenAI BPE tokenization and produces clean JSONL output ready for vector DB ingestion — especially when consistency and token-boundary accuracy matter more than speed or custom chunking logic.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T07:08:07.957Z","isFirstParty":false}