Create a taxonomy
This flat taxonomy matches each document against$REFERENCE_COLLECTION_ID with the retriever $RETRIEVER_ID and copies name and department from the best match.
taxonomy_name and config sit at the top level. A flat taxonomy requires retriever_id, input_mappings and source_collection inside config.
input_mappingsbuilds the retriever’s inputs from each document. Each entry is{ input_key, source_type, path }.input_keymust be a key in the retriever’s owninput_schema.source_typeispayload(a document field atpath),vector(a stored vector atpath),blob(the document’s source blob URL) orliteral(a static value inoverride). It never takes a feature URI.enrichment_fieldslists the fields to copy from the matched reference document. Everyfield_pathmust exist in the reference collection’s output schema, or the create returns422with the fields that do.merge_modeisreplaceorappend. Omit the list to copy the whole payload.
Run a taxonomy
Materialized at ingest
Attach the taxonomy to a collection.execution_mode accepts only materialize.
Collection body excerpt
scroll_filters (label only matching documents), target_collection_id, execution_phase, priority and, for hierarchical taxonomies, hierarchical_enrichment_style (full_chain, best_match or combined).
On demand in a retriever
Add ataxonomy_enrich stage after a stage that returns documents, such as feature_search. It labels the documents flowing through the retriever and stores nothing. Parameters and output fields are on Retriever stages.
taxonomy_enrich stage
Retroactively on existing documents
cURL
task_id and estimated_documents; follow it with GET /v1/tasks/{task_id}. Use it after you change a taxonomy or add reference data, or when you move from a flat to a hierarchical taxonomy. scroll_filters limits it to matching documents; reapply_all relabels documents that already have a label. See Apply taxonomy.
Hierarchical taxonomies
A hierarchical taxonomy labels in levels, such as brand, then category, then product line. Each node is a reference collection. A document that matches a node is passed down and matched against that node’s children, and it collects enrichment fields from every level it matches. A document labeledNike > Athletic > Running carries fields from all three nodes.
cURL
- The hierarchy is a flat list. Each node names its parent in
parent_collection_id;nullmarks a root. Order does not matter. collection_idis the only required field on a node and is its identifier.retriever_idandinput_mappingsare optional at theconfiglevel and can be set per node. A child inherits its parent’s enrichment fields and can override or extend them.- Instead of listing nodes, set
inference_strategytoschema,clusterorllmwithinference_collections, and Mixpeek builds the nodes. A common path is to infer a first tree, then edit it.
GET /v1/taxonomies/{taxonomy_id} returns the taxonomy with its nodes; add ?version= to read an earlier version.
Build a taxonomy from clusters
POST /v1/taxonomies/from-documents turns a cluster run, or a set of documents you selected, into a new flat taxonomy in one call. It creates a node collection that reuses the existing vectors (no re-embedding), a search retriever over it, the taxonomy and its nodes. Send cluster_run (cluster_id and run_id) for one node per cluster, or documents plus node_label for one node at the documents’ centroid. See Create a taxonomy from a document selection.
Labels the data does not confirm
A flat taxonomy gives each document its closest node, even a poor fit: a taxonomy whose only node isml would label a recipe ml. So each run compares the match scores of all the documents it labels. When the scores split into a high and a low group with a gap of at least 0.2, the low group gets no label, and a label an earlier run gave them is removed. With no gap, or fewer than three documents, every match is kept.
The outcome is recorded under _internal, where <id> is the taxonomy ID without tax_:
Filter on
_internal._taxonomy_<id>_confirmed equal to false to review the withheld documents.
Run any retriever at ingest
A taxonomy copies fields from a matched document. When you need something else written back, such as an LLM classification or a lookup in another collection, attach a retriever enrichment to the collection. After each batch, Mixpeek runs the retriever once per document and writes the fields you pick from its results onto the document.cURL
Retriever enrichments run one document at a time within a collection, so their time grows linearly with document count.
Post-processing order
After extraction, enrichment steps run in phase order, then bypriority (higher first) within a phase:
Monitor and maintain
- List taxonomies with
POST /v1/taxonomies/list. - Follow materialized enrichment with the
collection.documents.writtenwebhook event. - Check that a
taxonomy_enrichstage does not dominate retriever latency in retriever analytics. - Save config changes as numbered versions with
POST /v1/taxonomies/{taxonomy_id}/versions; every earlier version stays readable. - Copy only the fields you need at query time into
enrichment_fields; every field is written onto every labeled document.
Related
- Clusters: discover categories before you define a taxonomy
- Retriever stages: the
taxonomy_enrichstage - Collections: where
taxonomy_applicationsandretriever_enrichmentslive - Create taxonomy in the API reference

