ai_rag_answer
RAG answer with verified citations — Bring your own documents (up to 250,000 characters) and a question: chunks the text, ranks passages offline with BM25, answers from the top passages with inline [n] citations, then verifies every citation offline (the passage exists and the quoted text is really in it). grounded=true only when all citations check out; if no passage matches, answers NOT in docs without a model call. docs= is text split by lines containing only --- or a JSON array of strings or {title,text}. Optional: k= passages (1-8), size= words per chunk. Nothing stored. Price: $0.012 USDC (Base, via x402).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"q": "<q>",
"docs": "<docs>"
},
"name": "ai_rag_answer"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | e.g. How long do refunds take? | |
| docs | Yes | e.g. Refund policy: refunds are processed within 5 business days after approval. --- Shipping: orders ship in 3 to 7 days depending on region. |