Every Mixpeek document carries the full lineage chain that produced it, from the original bucket object through every transformation. This guide shows the four patterns for navigating that chain efficiently from the API.Documentation Index
Fetch the complete documentation index at: https://docs.mixpeek.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Background on the lineage data model: see Documents → Lineage.
The TL;DR is that each document has
_internal.lineage with root_object_id,
root_bucket_id, source_document_id, and a chain array recording every
processing step.When to use what
| Pattern | Use case | Round-trips |
|---|---|---|
?expand=parent | ”Show me this scene and its source frame on one page” | 1 |
?expand=root_object | ”Show me this document with the original video metadata” | 1 |
?expand=ancestors | ”Show me the full pipeline that produced this document” | 1 |
?expand=children | ”Show me all the segments derived from this scene” | 1 |
GET /documents/{id}/ancestors | Same as expand=ancestors but returns only the chain | 1 |
GET /documents/{id}/descendants | Same as expand=children but returns only the children | 1 |
from_object filter | ”Search across everything derived from this video” | 1 (no GET first) |
expand parameter takes a comma-separated list, so a single request
fetches the document plus everything you need from its lineage tree.
$expand keywords
Lineage-aware$expand keywords resolve relative to a document’s own
_internal.lineage block. They land under _expanded.<keyword> in the response,
matching the existing user-field expand shape.
- parent
- root_object
- ancestors
- children
The single document referenced by For a tier-0 document (created directly from a bucket object),
_internal.lineage.source_document_id.cURL
Python
parent is
absent — there’s no upstream document. Use root_object instead.expand is accepted by POST /documents/list (in the request body)
and by retriever response shaping — the document GET endpoint is just the
simplest demonstration.
Convenience endpoints
For SDKs and UIs that want only the lineage walk without fetching the document itself, use the dedicated endpoints:List<DocumentResponse> with the same shape as
GET /documents/{id} per element.
Filter aliases
When you want to search the lineage tree (find every document derived from one root), use the filter aliases instead of expand. They work in document list endpoints, retriever filter stages, and aggregations.| Alias | Resolves to | Use for |
|---|---|---|
from_object | _internal.lineage.root_object_id | Everything derived from this bucket object |
from_bucket | _internal.lineage.root_bucket_id | Everything derived from this bucket |
from_document | _internal.lineage.source_document_id | Direct children of one upstream document |
from_collection | _internal.lineage.source_collection_id | Documents whose immediate parent was in this collection |
_internal.lineage.*) — they exist purely so you don’t have to learn
the internal schema. Mix them freely with normal user fields:
End-to-end example: decomposition tree
To render a decomposition tree for one bucket object — every document at every tier that descended from it — make one filtered list call per collection in the namespace usingfrom_object. The result is
already structured by collection, and each document’s _internal.lineage.chain
tells you where to draw the edges.
Limits & caveats
- Maximum 50 unique user-field references per
expandrequest — doesn’t apply to lineage keywords (those are bounded by chain length forancestorsand by the children cap forchildren). expand=childrenis capped at 100 children per parent. For deeper traversal or wider fan-out, fall back to afrom_documentfilter.- Recursive expansion is not supported —
expand=parentresolves one level. To walk further, useexpand=ancestors(full chain) or call/ancestorsthen re-expandfrom there. - Lineage is immutable provenance. If an ancestor is deleted, its
document_idreference in the chain remains. Theancestorsexpand silently skips unresolved references — never returnsnullslots — but client code should still be ready for shorter-than-expected chains.

