When to Use Annotations
Annotations solve the problem of turning retriever output into verified decisions. Any workflow where a person reviews documents and records a judgment benefits from annotations:
Annotations are domain-agnostic — labels are free-form strings, and the
payload field accepts any structured JSON your workflow needs.
Annotation Lifecycle
document_idandcollection_id— what was reviewedretriever_id,execution_id,stage_name— how the document was found (provenance)label,confidence,reasoning— the human decisionpayload— structured data specific to the workflowactor_idandactor_type— who made the decision (user, API key, or system)
annotation.created, annotation.updated, annotation.deleted) and log to the audit trail.
Create an Annotation
Record a decision after reviewing a document:Query Annotations
List annotations with filters to build review queues or dashboards:document_id, collection_id, label, actor_id, retriever_id, as_of. All filters are optional and can be combined.
Read the Judgment Set at a Past Instant
Passas_of to get the annotations as they stood at one moment. Annotations created
after that instant are excluded, and every annotation still in the set is rewound to
its state at that time using its revision chain.
as_of and
re-reads the identical judgment set weeks later, after reviewers have added and
revised decisions.
A rewound annotation reports the version it held at that instant, and its
revisions array contains only the revisions below that version. Comparing version
across two as_of reads tells you which decisions moved between them.
Aggregate Stats
Get label distribution counts for dashboards and progress tracking:Update a Decision
When a review is revisited — for example, a deferred case gets a clinical consult and can now be approved:Bulk Operations
Process up to 1000 creates, updates, and deletes in a single call. Each operation is independent — a failure in one does not roll back the others.Example: Medical Coding Review Workflow
A healthcare organization uses Mixpeek to surface HCC suspect conditions from clinical notes. Coders review each result and record their decision:- Retriever runs
agent_searchacross clinical notes, returning suspect HCC conditions with supporting evidence. - Review queue — the application calls
POST /v1/annotations/list?label=deferredto show unresolved cases. - Coder annotates — for each document, the coder selects a label and the app calls
POST /v1/annotationswith the decision, ICD-10 codes, and RAF impact. - Dashboard —
GET /v1/annotations/stats?collection_id=col_notespowers a progress bar showing approved/rejected/deferred counts. - Audit — compliance officers query annotations by
actor_idto review individual coder decisions. Thereasoningfield provides the justification trail required for CMS audits.
Annotations are stored independently from documents — they don’t modify the underlying document data. This separation ensures that the original clinical record remains untouched while the review layer captures all human decisions.
Best Practices
- Use consistent labels within a workflow. Pick a label vocabulary (e.g.,
approved,rejected,deferred) and stick with it — the stats endpoint groups by exact string match. - Include reasoning for audit-sensitive workflows. The
reasoningfield is indexed and retrievable, making it valuable for compliance reviews and dispute resolution. - Link provenance when annotating retriever results. Setting
retriever_id,execution_id, andstage_namelets you trace exactly how the document was surfaced, which is critical for evaluating retriever quality. - Use payload for structured data rather than encoding it in the label. Labels should be human-readable categories; domain-specific fields (codes, scores, amounts) belong in
payload. - Listen to webhooks for real-time updates. Subscribe to
annotation.createdandannotation.updatedevents to trigger downstream workflows (e.g., auto-submit approved records, escalate rejected ones).
References
- Create Annotation
- List Annotations
- Annotation Stats
- Update Annotation
- Delete Annotation
- Bulk Annotations
- Interaction Signals — implicit behavioral signals (complementary to annotations)
- Webhooks — subscribe to annotation lifecycle events

