iQ Suite - Docs
SDK ReferenceInstant RAG

Query Instant RAG

Query an existing instant RAG context with a specific query.

Description

The Query Instant RAG endpoint allows you to query an existing instant Retrieval-Augmented Generation (RAG) context using a specific query. This enables you to generate responses that are informed by the provided context.

HTTP Request

POST /index/instant/query

Authentication

All requests must include an Authorization header with a valid API key.

Headers

KeyValue
AuthorizationBearer YOUR_API_KEY
Content-Typeapplication/json

Request Body

  • index: The ID of the index associated with the RAG.
  • query: The query string to generate a response.

JSON

FieldTypeDescription
indexstringThe ID of the index
querystringThe query string for RAG

Request Example

response = client.query_instant_rag(
        index_id='your_index_id',
        query='your search query'
)
# Print the response from the platform
print(f"Response: {response}")

Response

Success

Status Code: 200 OK

Body:

{
   "data": {
       "uuid": "b8582f90-c2f2-4b25-915e-b1da8eca3233",
       "query": "what is this document about?",
       "retrieval_response": "This document discusses the principles of effective web design, particularly focusing on typography and the importance of clear communication over mere aesthetics. It emphasizes that good design should not distract from the message being conveyed and highlights the significance of choosing appropriate typefaces for readability and comfort. The document also touches on the historical context of typography and the technical considerations involved in selecting web fonts, such as the variety of styles available within a font family.",
       "credits_cost": 0.03,
       "total_tokens": 940
   }
}

On this page