Skip to content

API Reference parrot.registry.capabilities.models

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.registry.capabilities.models

View source

Pydantic v2 models for Intent Router and Capability Registry.

Defines all enums and data models for the FEAT-070 intent routing feature: routing types, capability entries, routing decisions, routing traces, and intent router configuration.

FEAT-111 addition: TraceEntry gains an optional store_rankings field (list of StoreScore) so the existing RoutingTrace machinery can carry store-level detail when the StoreRouter is active. The field defaults to None so all existing code that builds TraceEntry objects is unaffected.

Class CapabilityEntry

A registered capability in the semantic index.

Fields:

Field Type Default Description
name str Unique name of the capability
description str Human-readable description (used for embedding)
resource_type ResourceType
embedding Optional[list[float]] None Pre-computed embedding vector
metadata dict[str, Any]
not_for list[str] Query patterns this capability should NOT match

Class IntentRouterConfig

Configuration for the IntentRouter.

Fields:

Field Type Default Description
confidence_threshold float Min confidence to accept a route
hitl_threshold float Below this confidence, ask the human
strategy_timeout_s float Per-strategy timeout in seconds
exhaustive_mode bool Run all strategies and concatenate results
max_cascades int Max cascade steps before fallback
custom_keywords dict[str, str] Extra keyword→RoutingType mappings merged on top of the built-in keyword map. Keys are lowercase phrases; values are RoutingType enum values (e.g. 'graph_pageindex').
enable_output_mode_routing bool Activate the deterministic output-mode router
embedding_model str SentenceTransformer model id for the output-mode router
output_mode_routes dict[str, list[str]] Phrase bank: OutputMode value (str) or 'a2ui:' -> reference utterances.
tenant_output_mode_routes dict[str, dict[str, list[str]]] FEAT-755: per-tenant phrase banks, tenant id -> (label -> utterances). Built by route_bank.resolve_route_banks(); each entry becomes its own EmbeddingIntentRouter sharing the global router's encoder.
output_mode_threshold float Min max-cosine to accept a route; below -> abstain. Calibrated for multilingual-e5-small (on-topic ~0.92+, off-topic ~0.82-); re-sweep when changing 'embedding_model' (embedding-space drift).
discrepancy_margin float If (best-second) < margin, consult the LLM tie-breaker

Class ResourceType

Type of resource registered in the capability index.

Class RouterCandidate

A scored match from capability search.

Fields:

Field Type Default Description
entry CapabilityEntry
score float
resource_type ResourceType

Class RoutingDecision

The router's selected strategy and candidates.

Fields:

Field Type Default Description
routing_type RoutingType
candidates list[RouterCandidate]
cascades list[RoutingType]
confidence float
reasoning str LLM explanation for routing choice

Class RoutingTrace

Full trace of a routing session.

Fields:

Field Type Default Description
mode Literal['normal', 'exhaustive'] 'normal'
entries list[TraceEntry]
elapsed_ms float 0.0

Class RoutingType

Strategy the intent router can select.

Class TraceEntry

One step in the routing trace.

Fields:

Field Type Default Description
routing_type RoutingType
produced_context bool False
context_snippet Optional[str] None
error Optional[str] None
elapsed_ms float 0.0
store_rankings Optional[list] None Store-level routing detail (list[StoreScore]) from StoreRouter. None when router is inactive.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally