Skip to main content
v1

Rules and Response Resolution

Rule types currently implemented

Rule type resolver coverage

rule_typeResolverWhen to use
EXACTExactRuleTypeResolverExact text-driven trigger
REGEXRegexRuleTypeResolverPattern-driven trigger
JSON_PATHJsonPathRuleTypeResolverCondition over session/context/payload facts

Rule actions in detail

Action behavior

actionWhat it changesTypical real-world use
SET_STATEsession.stateMove flow to AWAITING_ACCOUNT_ID
SET_INTENTsession.intentReclassify after deterministic signal
SET_JSONinput param from JSON path extractPull ticketId/correlationId from context
GET_CONTEXTinput param snapshot of contextUse context in downstream prompts/tasks
GET_SESSIONinput param snapshot of session factsExpose runtime flags to prompts
GET_SCHEMA_JSONinput param schema-only field subsetUse only extracted form fields
SET_TASKexecutes custom task bean methodsRaise incident, call internal orchestrator

Response selection algorithm

  1. Find enabled ce_response candidates matching intent/state
  2. Score by exact state/intent > ANY/null fallback > priority
  3. Choose top candidate
  4. Resolve by response type

EXACT vs DERIVED

  • EXACT: deterministic payload (exact_text)
  • DERIVED: template-rendered + LLM-generated output
Derived response path (concept)
TEXT
ce_response(response_type=DERIVED, output_format=TEXT)
-> template from ce_prompt_template(response_type=TEXT)
-> render variables
-> llm.generateText(...)
-> optional ResponseTransformer
-> persisted assistant output
Intervention points
  • Use ResponseTransformer after response resolution to apply consumer-specific post-processing.
  • Use hook on RulesStep to inspect rule cascades in production debugging.
Enum drift warning

Do not insert unimplemented rule types/actions in DB. Keep ce_rule values aligned with installed resolver classes.