POST
/
api
/
v1
/
rag
/
query
curl -X POST https://api.ravan.ai/api/v1/rag/query \
  -H "X-Api-Key: YOUR_API_KEY" -H "Content-Type: application/json" \
  -d '{"org_id": "1268c1f0-19f3-47db-aefb-c16a7c3ace6e", "kb_id": "product_docs", "query": "What is the pricing per minute?"}'
{
  "success": true,
  "message": "Query completed successfully",
  "data": {
    "results": [
      { "doc_id": "pricing_page", "chunk": "Contact our sales team for usage-based pricing details. No hidden fees.", "score": 0.94, "metadata": {"category": "pricing"} }
    ]
  }
}
This endpoint is used internally by agents during calls. You can also call it directly to test retrieval quality.

Authorizations

X-Api-Key
string
required
Your Agni API key.

Body

org_id
string
required
UUID of your organization.
kb_id
string
required
Knowledge base to search.
query
string
required
Natural language question or search query.

Response

success
boolean
Whether the request succeeded.
message
string
Human-readable status message.
data
object
Query results with relevant document chunks and similarity scores.
curl -X POST https://api.ravan.ai/api/v1/rag/query \
  -H "X-Api-Key: YOUR_API_KEY" -H "Content-Type: application/json" \
  -d '{"org_id": "1268c1f0-19f3-47db-aefb-c16a7c3ace6e", "kb_id": "product_docs", "query": "What is the pricing per minute?"}'
{
  "success": true,
  "message": "Query completed successfully",
  "data": {
    "results": [
      { "doc_id": "pricing_page", "chunk": "Contact our sales team for usage-based pricing details. No hidden fees.", "score": 0.94, "metadata": {"category": "pricing"} }
    ]
  }
}

Authorizations

X-Api-Key
string
header
required

Body

application/json
org_id
string
required
kb_id
string
required
query
string
required

Response

Successful response