VocalDocscontracts 1.65.0

Evaluate a version or the working set

POST /v1/knowledge-bases/{knowledge_base_id}/evaluations

PropertyValue
Operationcreate_knowledge_evaluation
GroupKnowledge bases
Scopeknowledge:write
Route classcontrol
IdempotencyIdempotency-Key accepted: a retry with the same key replays the first answer
AuditAudited knowledge.evaluation.create (mutation)
Released in1.53.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Runs the corpus through the search path against a version or, when version is omitted, the working set, as a knowledge.evaluation job, and answers 202 with the Evaluation queued, its job_id and its Location (1.53.0; knowledge-bases.md section 10). A request while an Evaluation of the same target is queued or running answers that one. An empty corpus is 422 validation_failed with knowledge_corpus_empty; a version that does not exist is not_found and a retired one knowledge_base_version_retired. The job emits job.succeeded or job.failed.

Request

Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the knowledge:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.

curl -X POST "$VOCAL_API/v1/knowledge-bases/kb_.../evaluations" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'

Parameters

NameInTypeRequiredDescription
knowledge_base_idpathKnowledgeBaseIdyesThe id of a Knowledge base: kb_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
idempotency-keyheaderstringnoA client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response.

Request body

Content type application/json, required: KnowledgeEvaluationCreateRequest.

FieldTypeRequiredDescription
top_kintegernoThe target's retrieval_defaults.top_k when omitted.
versionKnowledgeVersionTargetnoThe working set when omitted, which is what a publish reads.

Responses

StatusContent typeShapeError codes
202application/jsonKnowledgeEvaluation
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopeknowledge_base_archived, idempotency_in_progress, idempotency_key_reused, knowledge_base_version_retired
422application/jsonErrorEnvelopevalidation_failed
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 202 answer

The shape is KnowledgeEvaluation.

FieldTypeRequiredDescription
baselineKnowledgeEvaluationBaseline or nullyesNull when no version is active or the active one has no completed Evaluation, so no relative check applied.
corpus_sha256stringyesThe digest of the ids and revisions of the corpus queries it ran.
created_atTimestampyes
created_byActorRef or nullyesWho asked for it; null when an automatic publish ran it after a sync.
error_codestring or nullyesWhy it failed, such as embedding_failed; null otherwise.
failing_checksarray of KnowledgeGateCheckyesThe checks the metrics fail, also when the outcome is advisory.
finished_atTimestamp or nullyes
gateKnowledgeGateOutcome or nullyespassed, failed or advisory once completed (knowledgeGateOutcome); null before.
idKnowledgeEvaluationIdyes
job_idJobIdyesThe knowledge.evaluation job that runs it.
knowledge_base_idKnowledgeBaseIdyes
manifest_sha256stringyesThe digest of the Document revisions and configuration it searched; a publish compares it with the working set.
metricsKnowledgeEvaluationMetrics or nullyesNull until completed.
object"knowledge_evaluation"yes
resultsarray of KnowledgeEvalResultyes
started_atTimestamp or nullyes
statusKnowledgeEvaluationStatusyes
thresholdsKnowledgeGateThresholdsyes
top_kintegeryes
versioninteger or nullyesThe version evaluated; null for the working set.