Skip to content

User Intent

Cluster: Uncategorised | Type: component | MCP Tools: 4

Overview

Public API

UserIntentDecisionError(ValueError)

The LLM did not produce a usable, validated intent decision.

IntentDecision

Validated intent-endorsement verdict.

Field Type Default
posture str required
baseline_posture str required
requires_confirmation bool required
baseline_requires_confirmation bool required
literal_interpretation str ''
extrapolated_interpretation str ''
baseline_extrapolation str ''
divergence_summary str ''
degraded bool False
llm_used bool False
reasons tuple[str, ...] ()
rationale str ''
raw_response str ''

Methods:

escalated() -> bool

extrapolation_enriched() -> bool

agentic_evidence() -> dict[str, Any]

to_dict() -> dict[str, Any]

to_endorsed_intent() -> EndorsedIntent

Build an EndorsedIntent from the FINAL (post-clamp) fields.

UserIntentPlanner

Runtime-first facade with deterministic fallback + one-way posture clamp.

Field Type Default
runtime UserIntentRuntime \| None None
last_decision IntentDecision \| None field(default=None, init=False)
last_llm_used bool field(default=False, init=False)
last_fallback_reason str field(default='', init=False)

Methods:

interpret(literal_request: str, context: str = '', risks: list[str] | None = None) -> IntentDecision

UserIntentInput(BaseModel)

Field Type Default
op Literal['interpret', 'record_explicit', 'infer_from_behavior', 'get', 'reset', 'list', 'ops', 'help'] 'interpret'
literal_request str ''
context str ''
risks list[str] []
key str ''
value str ''
event str ''
preference_path str '.g6/memory/user_preferences.yaml'

UserIntentBlock(AIBlock[UserIntentInput, dict, dict])

Constructor:

Parameter Type Default
name str 'user_intent'
state dict \| None None

Methods:

infer(data: UserIntentInput) -> Result[dict]

EndorsedIntent(BaseModel)

Field Type Default
literal_interpretation str required
extrapolated_interpretation str required
divergence_summary str ''
requires_confirmation bool False

UserExtrapolatedIntent

Methods:

interpret(literal_request: str, context: str = '', risks: list[str] | None = None) -> EndorsedIntent

UserIntentPatternRuntime

Stateless executable mechanisms for user_intent's applied patterns.

Methods:

tighten(posture: Any, baseline_posture: Any = '', requires_confirmation: bool = False, baseline_requires_confirmation: bool = False, degraded: bool = False, risks_present: bool = False, divergence_detected: bool = False) -> UserIntentPatternReview

One-way endorsement-posture guard (hook-based-safety-guard-rails).

Preference(BaseModel)

Field Type Default
key str required
value str required
source Literal['explicit', 'inferred'] required
confidence float required
evidence_count int 1

PreferenceUncertaintyModel

Constructor:

Parameter Type Default
path str \| Path '.g6/memory/user_preferences.yaml'

Methods:

record_explicit(key: str, value: str) -> Preference

infer_from_behavior(event: str) -> Preference

get(key: str) -> Preference | None

reset(key: str) -> None

list() -> list[Preference]

save() -> Path

Functions

deterministic_intent_decision(literal_request: str, context: str = '', risks: list[str] | None = None) -> IntentDecision

Demoted-real STRUCTURAL baseline (the zero-LLM floor).

apply_intent_floor(baseline: IntentDecision, candidate_posture: Any) -> IntentDecision

One-way endorsement-posture safety clamp (stricter-of, ESCALATE only).

build_default_planner() -> 'UserIntentPlanner | None'

Build the on-by-default agentic planner, or None when suppressed.

grounded_interpret_intent(literal_request: str, context: str = '', risks: list[str] | None = None, planner: UserIntentPlanner | None = None) -> IntentDecision

The ONE shared grounded chokepoint for EVERY user_intent interpret decision.

applied_agentic_patterns() -> list[dict[str, Any]]

Return compact metadata for user_intent-applied vendored patterns.

MCP Tools

Operation Source
ops user_intent_mcp
help user_intent_mcp
interpret user_intent_mcp
list_patterns user_intent_mcp