Skip to main content
A taxonomy labels documents by matching them against a reference collection: a product catalog, a set of enrolled faces, a list of categories. It works like a SQL join on embedding similarity instead of key equality. For each document, a retriever you choose searches the reference collection, and the fields of the best match (a SKU, a name, a category) are copied onto the document. You can run a taxonomy as documents are processed, inside a retriever at query time, or over documents that already exist.

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.
Only taxonomy_name and config sit at the top level. A flat taxonomy requires retriever_id, input_mappings and source_collection inside config.
  • input_mappings builds the retriever’s inputs from each document. Each entry is { input_key, source_type, path }. input_key must be a key in the retriever’s own input_schema. source_type is payload (a document field at path), vector (a stored vector at path), blob (the document’s source blob URL) or literal (a static value in override). It never takes a feature URI.
  • enrichment_fields lists the fields to copy from the matched reference document. Every field_path must exist in the reference collection’s output schema, or the create returns 422 with the fields that do. merge_mode is replace or append. Omit the list to copy the whole payload.
Creating the taxonomy labels nothing yet. Pick one of the three ways to run it below.

Run a taxonomy

Materialized at ingest

Attach the taxonomy to a collection. execution_mode accepts only materialize.
Collection body excerpt
Labels land on documents about 30 seconds after a batch finishes; the step is debounced so a burst of batches runs it once. Each entry also takes 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 a taxonomy_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
The call returns a 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 labeled Nike > Athletic > Running carries fields from all three nodes.
cURL
  • The hierarchy is a flat list. Each node names its parent in parent_collection_id; null marks a root. Order does not matter.
  • collection_id is the only required field on a node and is its identifier.
  • retriever_id and input_mappings are optional at the config level 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_strategy to schema, cluster or llm with inference_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 is ml 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
A retriever enrichment’s input_mappings uses a different shape from a taxonomy’s. The enrichment form nests the source: { input_key, source: { source_type, path, value } }, with source_type document_field, constant or source_blob. The taxonomy form is flat: { input_key, source_type, path, override }, with source_type payload, literal, vector or blob. The two vocabularies share no values, so a wrong source_type is rejected; a flat entry sent to an enrichment fails its source requirement.
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 by priority (higher first) within a phase:

Monitor and maintain

  • List taxonomies with POST /v1/taxonomies/list.
  • Follow materialized enrichment with the collection.documents.written webhook event.
  • Check that a taxonomy_enrich stage 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.