Skip to main content
POST
Report back on a query that already ran: what was missing, what was wrong, or that it was exactly right. Feedback feeds retrieval-quality work; it does not change the result of the query it refers to. Both people and agents can submit. An agent that can tell a retrieval was unhelpful is often the best source of signal you have, so source labels which one it was.

Linking feedback to a query

Every HydraDB response carries a request_id in meta, and the same value in the X-Request-ID header. Send that id back and we can line your comment up with the exact query it is about: the text queried, what came back, how long it took.
Query response
Send request_id back exactly as you received it. It must be the UUID from meta.request_id (or the X-Request-ID header). Any other value is rejected with 400.
Submit feedback for queries that returned. If the query itself failed, handle the error instead: there is no retrieval to judge, and the fix is in the request rather than in the index.

Fields

Ground truth

If you already know the right answer (you are running an evaluation set, or you know which document the user needed), send it. It is a much stronger signal than a comment, because we can score it without a human reading it.
  • answer: the response you expected.
  • source_ids: the sources that actually contain the answer. This is the one that grades retrieval: it tells us whether the query surfaced those documents, and where they ranked.
Send either on its own or both together. If ground_truth is your only signal, at least one of the two has to carry something; values that are empty or all whitespace are treated as not sent.
Evaluation run
At eval volumes you may brush the rate limit, so keep the submission from ending the loop: an unguarded call means a single 429 loses every remaining case, not just the one it failed on. Duplicate source_ids are collapsed and blank entries dropped, so you do not need to de-duplicate or filter your answer key first. A list that still has one real id in it is scored on that id.

Submitting more than once

Each submission is stored separately: a second comment about the same query does not replace the first. Send several as your understanding of a bad result develops, and file feedback from more than one user on the same query.

Rate limit

100 submissions per minute per organization. Over that, you get 429 with a Retry-After header and a message naming the seconds to wait; it is safe to retry after waiting. The ceiling is well above normal use; an agent reporting on every query it makes will stay comfortably under it.

Errors

A successful submission returns 201. Each submission is its own row, so the worst case of retrying after a 500 is a duplicate report.

Authorizations

Authorization
string
header
required

API key sent as a Bearer token: "Bearer prefix.secret"

Body

application/json

Feedback submission

feedback
string
required

Free-text comment describing what was right or wrong about the results. Required unless ground_truth is supplied.

Required string length: 1 - 8000
Pattern: \S
request_id
string<uuid>
required

The request_id from response.meta of the query this feedback is about. Required — it is what links the feedback to the query that ran.

Example:

"9d13aef4-02f4-4e73-8c62-4c2601d04f9d"

collection
string

Optional collection scope for this feedback. A collection is scoped to a database, so database must be sent alongside it; sending collection on its own is rejected.

Minimum string length: 1
Example:

"team_docs"

database
string

Owning database. Formerly tenant_id; the tenant_id alias is still accepted (deprecated).

Minimum string length: 1
Example:

"acme_corp"

ground_truth
object

What you already know the right answer to be, when you know it. Supply an expected answer, the source_ids that contain it, or both — at least one is required if the field is present. Machine-checkable, so it is a stronger signal than a comment: submit it alone and feedback becomes optional.

Example:
metadata
object

Free-form key-value context stored alongside the feedback (e.g. agent name, conversation or eval-run ID).

Example:
rating
enum<string>

Optional overall judgement: positive, negative, or neutral. Omit to send a comment with no rating.

Available options:
positive,
negative,
neutral
source
enum<string>

Who is submitting: user (default) or agent.

Available options:
user,
agent
sub_tenant_id
string
deprecated

deprecated: use collection

Minimum string length: 1
Example:

"sub_tenant_4567"

tenant_id
string
deprecated

deprecated: use database

Minimum string length: 1
Example:

"tenant_1234"

Response

Created

data
object
Example:
error
object | null

Null on success; an object with code and message on failure.

Example:

null

meta
object
Example:
success
boolean

Whether the request succeeded.

Example:

true