# AgentRAG – Hybrid Retrieval-Augmented Query

> AgentRAG – Hybrid Retrieval-Augmented Query is a paid API for AI agents from api.agentx402.ai, paid per call via x402, $0.008/call, status unknown (last checked 2026-09-15).

Accepts a natural language query and optional source URLs, performs hybrid dense-vector + BM25 retrieval with reranking, and returns ranked, cited text chunks relevant to the query

## Facts

- Endpoint: POST https://api.agentx402.ai/v1/rag/ask
- Price: $0.008/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentrag-hybrid-retrieval-augmented-query-41555b44
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_N-ADgU-WNwnRx_OMCqz8m

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 agentrag-hybrid-retrieval-augmented-query-41555b44 -d '<json body>'
```

Example prompt: Search my indexed docs at https://docs.myapp.com for how to resolve error code E_CONN_TIMEOUT — I need the most relevant cited chunks using hybrid retrieval.

## When to prefer this

Prefer AgentRAG when you need precise retrieval over exact tokens such as error codes, API symbols, or configuration keys, where vector-only search underperforms. It is ideal when you have specific source URLs to ground retrieval and want cited, ranked chunks rather than a generated answer. Choose it over general web search when you want retrieval scoped to known documents, and over a pure vector store when keyword matching matters alongside semantic similarity.

## Known failure modes

- Query matches no indexed content — returns empty results and no payment is charged
- Provided source URL is unreachable or returns non-indexable content — indexing skipped for that source
- Malformed query or missing required 'input' field — returns 400 validation error
- Rate limit or credit exhaustion — returns 402 payment required or credit insufficient error
- Source document too large or unsupported format — partial indexing or rejection

## How this service works

Agent-native retrieval over x402 — send a query and, optionally, source URLs to index: get back ranked, cited chunks. Hybrid retrieval by default (dense vectors + BM25 keyword search, fused and reranked) beats vector-only search on exact tokens (error codes, API symbols, config keys). Pay-on-success: a query that matches nothing settles nothing. Ask $0.008; prepay $1 = 10,000 credits, spent at 80% of the per-op price (20% off). Docs: https://agentx402.ai

## Output

A list of ranked, cited text chunks matching the query, each accompanied by its source URL and relevance score, produced via fused dense-vector and BM25 retrieval with reranking. If no chunks match the query, no payment is settled.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "properties": {}
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentrag-hybrid-retrieval-augmented-query-41555b44/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.agentx402.ai](https://www.zero.xyz/host/api.agentx402.ai/llms.txt)
