Skip to content

Latest commit

 

History

History
37 lines (28 loc) · 6.57 KB

File metadata and controls

37 lines (28 loc) · 6.57 KB

HierarchicalNodeInput

A node in a hierarchical taxonomy representing one level in the tree structure. Each node represents a collection containing documents at a specific hierarchy level. Nodes form parent-child relationships to create multi-level taxonomies with property inheritance. When a document matches a child node, it inherits all properties from parent nodes up to the root. Use Cases: - Define organizational hierarchies: employees → managers → executives - Create product categorizations: products → electronics → phones → smartphones - Build classification trees: industries → technology → software - Implement face recognition hierarchies: people → employees → team members - Enable property inheritance: child nodes get all parent properties Hierarchy Behavior: - Root nodes: parent_collection_id = None (top of hierarchy) - Child nodes: parent_collection_id references parent node's collection_id - Property inheritance: Children inherit all parent enrichment_fields - Path construction: Creates path array from root to leaf - Multi-level matching: Documents matched at deepest applicable level Configuration: - Per-node retrievers: Override taxonomy-level retriever for specific nodes - Per-node enrichment: Override which fields to enrich at each level - Per-node input mappings: Customize retriever inputs per hierarchy level - Labels/summaries: Human-readable metadata for UI display Related Models: - HierarchicalTaxonomyConfig: Contains list of hierarchical nodes - TaxonomyAssignment: Result of matching documents to nodes - EnrichmentField: Specifies which fields to enrich from node Requirements: - collection_id: REQUIRED - must reference an existing collection - parent_collection_id: REQUIRED for non-root nodes (None for root) - All other fields: OPTIONAL with inheritance from taxonomy-level config

Properties

Name Type Description Notes
collection_id str REQUIRED. Collection ID representing this node in the hierarchy. Must reference an existing collection containing documents for this hierarchy level. Format: 'col_' prefix followed by alphanumeric/underscore characters. Used to: Match documents against this level, identify node in path, store enrichment data. Example: 'col_executives' for executive level, 'col_products_phones' for phones category.
parent_collection_id str OPTIONAL. Collection ID of the parent node in the hierarchy. When None: This is a root node (top of hierarchy). When set: References parent node's collection_id, creating parent-child relationship. Format: Same as collection_id ('col_' prefix). Used to: Build hierarchy tree, determine inheritance order, construct path arrays. Example: 'col_managers' is parent of 'col_executives', 'col_products' is parent of 'col_electronics'. Validation: Must reference a valid collection_id from another node in same taxonomy. [optional]
label str OPTIONAL. Human-readable display name for this hierarchy node. Used in UI, visualizations, and taxonomy assignment results. NOT REQUIRED - When None: collection name or auto-generated label may be used. Format: Free text, typically title case, 2-50 characters. Examples: 'Executive Leadership', 'Mobile Phones', 'Engineering Team'. Can be LLM-generated or manually specified during taxonomy creation. [optional]
summary str OPTIONAL. Brief description of this hierarchy level and its contents. Used for: Documentation, UI tooltips, understanding hierarchy structure. NOT REQUIRED - When None: no summary available for this node. Format: Free text, typically 1-3 sentences, up to 500 characters. Can be LLM-generated or manually provided. [optional]
keywords List[str] OPTIONAL. Keywords or tags describing this hierarchy level. Used for: Search, filtering, categorization, LLM understanding. NOT REQUIRED - When None: no keywords defined for this node. Format: List of strings, typically 3-10 keywords per node. Can be LLM-generated from collection contents or manually specified. [optional]
retriever_id str OPTIONAL. Retriever to use for matching documents at this hierarchy level. When None: Uses taxonomy-level retriever_id (inheritance from parent config). When set: Overrides taxonomy-level retriever for this specific node. Format: 'ret_' prefix followed by alphanumeric characters. Use for: Specialized matching at certain levels (e.g., face recognition for employees, semantic search for products). Must reference an existing RetrieverModel. [optional]
enrichment_fields List[EnrichmentField] OPTIONAL. Fields to enrich into documents when they match this hierarchy level. Specifies which properties from node collection to copy to matched documents. When None: No field-level enrichment (only taxonomy assignment recorded). Format: List of EnrichmentField objects with field_path and merge_mode. Inheritance: Child nodes inherit all parent enrichment_fields plus their own. Example: executives node adds 'executive_level' on top of inherited 'employee_id', 'department'. [optional]
input_mappings List[InputMapping] OPTIONAL. Custom input mappings for the retriever at this hierarchy level. Specifies how to construct retriever inputs from document features. When None: Uses taxonomy-level input_mappings (inheritance). When set: Overrides taxonomy-level mappings for this specific node. Format: List of InputMapping objects specifying input_key, source_type, path. Use for: Different matching strategies at different levels (e.g., face at employee level, text at department level). [optional]

Example

from mixpeek.models.hierarchical_node_input import HierarchicalNodeInput

# TODO update the JSON string below
json = "{}"
# create an instance of HierarchicalNodeInput from a JSON string
hierarchical_node_input_instance = HierarchicalNodeInput.from_json(json)
# print the JSON string representation of the object
print(HierarchicalNodeInput.to_json())

# convert the object into a dict
hierarchical_node_input_dict = hierarchical_node_input_instance.to_dict()
# create an instance of HierarchicalNodeInput from a dict
hierarchical_node_input_from_dict = HierarchicalNodeInput.from_dict(hierarchical_node_input_dict)

[Back to Model list] [Back to API list] [Back to README]