Skip to content

Questions and answers

Q&A pairs: the question is embedded, the answer is returned — the right format for FAQ.

Updated on Aug 10, 2026

For FAQ, embedding the question yields much better search results than embedding running text: the user's question matches directly with the registered question. The Q&A pair does exactly that — the question becomes the vector, and the search returns the answer in the text field, with the original question in question for reference.

POSThttps://api.hinow.ai/v1/rag/documents/qaBearer

Register a question-answer pair in the database.

Parâmetros

  • rag_idstring· bodyobrigatório
  • questionstring· bodyobrigatório
  • answerstring· bodyobrigatório

Respostas

200Indexed pair (the document_id identifies the pair)
{
  "document_id": "0388772e3fe94ec19217790846d79133",
  "chunks": 1,
  "embed_tokens": 4
}
PUThttps://api.hinow.ai/v1/rag/documents/qa/{document_id}Bearer

Edit an existing pair (re-embeds the question).

Parâmetros

  • document_idstring· pathobrigatório
  • rag_idstring· bodyobrigatório
  • questionstring· bodyobrigatório
  • answerstring· bodyobrigatório

Respostas

200Pair updated
404Pair outside the informed scope/database

In search, a Q&A result arrives like this — notice that text is the answer and the score is high when the question matches:

{
  "score": 0.824,
  "document_id": "0388772e3fe94ec19217790846d79133",
  "source": "Voces aceitam pix?",
  "question": "Voces aceitam pix?",
  "text": "Sim! Pix, cartao de credito, boleto e transferencia.",
  "metadata": { "kind": "qa", ... }
}

Removing a pair

Q&A is a document like any other: use DELETE /v1/rag/documents/{document_id}?rag_id=... and it goes to trash like the rest.

Was this page helpful?