Standard RAG Tool

Runs the full RAG pipeline — retrieval from the knowledge base followed by LLM answer generation with citations.

Endpoint

POST /components/{chatbot_id}:standard-rag/run

Example Request

curl -X POST "https://glchat.glair.ai/components/{chatbot_id}:standard-rag/run" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: {your_user_api_key}" \
  -d '{
    "inputs": {
      "query": "What is our refund policy?"
    },
    "config": {}
  }'

Response

{
  "response": "Our refund policy allows returns within 30 days of purchase...",
  "references": [
    {
      "id": "54652883-dc0e-4e08-928e",
      "content": "Returns are accepted within 30 days of purchase...",
      "metadata": { "source": "policy-doc.pdf", ...},
      "score": 0.71
    }
  ]
}
Field
Type
Description

response

string

LLM-generated answer grounded in the retrieved chunks

references

list

Source chunks used to generate the response

Inputs Schema

Field
Type
Required
Default
Description

query

string

Yes

Shorthand alias — if standalone_query or generation_query are absent, both fall back to this value

generation_query

string

No

""

Query used for LLM generation. If absent, falls back to query. If query is also absent, defaults to ""

standalone_query

string

No

Query used for knowledge base retrieval

history

list[Message]

No

[]

Conversation history for context-aware generation

context

string

No

""

Additional context string to inject into the prompt

additional_instructions

string

No

""

Extra instructions appended to the system prompt

use_case_id

string

No

"answer_question"

Use case identifier that selects the prompt template

generation_strategy

string

No

"stuff"

"stuff" or "refine" — see [Runtime Config]([LINK: runtime-config subpage])

attachment_chunks

list[Chunk]

No

[]

Pre-loaded chunks from file attachments

search_chunk_results

list[Chunk]

No

[]

Pre-fetched search chunks to inject alongside retrieval results

memory_results

list[Chunk]

No

[]

Memory chunks from the user's memory store

retrieval_params

dict

No

{}

Low-level parameters forwarded to the vector store query


Last updated