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:| Use Case | Labels | Payload Example |
|---|---|---|
| Medical coding review | approved, rejected, deferred | {"codes_approved": ["E11.40"], "raf_impact": 0.302} |
| Brand infringement triage | infringement, safe, needs_review | {"confidence_model": 0.91, "match_type": "logo"} |
| Duplicate detection | confirmed_dupe, false_positive | {"canonical_id": "doc_abc", "similarity": 0.97} |
| Content moderation | approved, flagged, removed | {"policy_violation": "copyright", "severity": "high"} |
| Document classification | correct, incorrect, ambiguous | {"predicted_class": "invoice", "true_class": "receipt"} |
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. All filters are optional and can be combined.
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

