Skip to content

AI & Behavior Traits

Part of the HoloScript Traits reference. Browse: Interaction · AI Autonomous · All Traits

AI/Behavior Traits

@llm_agent

Category: AI Tags: llm, agent, processing, autonomy, brain

LLM-powered decision-making with tool calling.

hsplus
object NPC @llm_agent(model: 'gpt-4', temperature: 0.7) {
  system_prompt: "You are a helpful shopkeeper..."
  tools: ['get_inventory', 'sell_item', 'buy_item']
}
ConfigTypeDefaultDescription
modelstring'gpt-4'LLM model identifier
system_promptstring''System message
temperaturenumber0.7Creativity (0-1)
context_windownumber8192Max tokens
toolsArray[]Available tool definitions
max_actions_per_turnnumber3Action limit per turn
bounded_autonomybooleantrueLimit autonomous actions
escalation_conditionsArray[]When to escalate
rate_limit_msnumber1000Min time between requests

State:

  • conversationHistory - Message history
  • isProcessing - Currently processing
  • pendingToolCalls - Pending tool invocations

Events:

  • llm_message - Message received
  • llm_response - Response generated
  • llm_tool_call - Tool invoked
  • llm_escalate - Escalation triggered

@behavior_tree

Category: AI Tags: bt, logic, decision, npc, state

Behavior tree AI with node-based logic.

hsplus
object Guard @behavior_tree {
  root: sequence [
    condition 'can_see_player',
    action 'chase_player',
    action 'attack'
  ]
}
ConfigTypeDefaultDescription
tick_ratenumber10Updates per second
debug_modebooleanfalseShow node execution
interrupt_on_higher_prioritybooleantruePriority interrupts

Events:

  • bt_node_enter - Node started
  • bt_node_success - Node succeeded
  • bt_node_failure - Node failed
  • bt_tree_complete - Full tree evaluated

@goal_oriented

Goal-oriented action planning (GOAP).

hsplus
object Worker @goal_oriented {
  goals: ['gather_resources', 'build_shelter']
  actions: ['chop_wood', 'mine_stone', 'craft']
}
ConfigTypeDefaultDescription
planning_depthnumber5Max action chain length
replan_intervalnumber1000Replanning frequency (ms)

Events:

  • goal_selected - New goal chosen
  • goal_achieved - Goal completed
  • action_started - Action begun
  • action_completed - Action finished

@perception

Category: AI Tags: vision, hearing, sense, detection, npc

Sensory perception with line-of-sight and detection.

hsplus
object Sentry @perception(view_angle: 90, view_distance: 20) {
  detect_tags: ['player', 'enemy']
}
ConfigTypeDefaultDescription
view_anglenumber120Field of view (degrees)
view_distancenumber10Max sight distance
hearing_radiusnumber5Sound detection radius
memory_durationnumber5000How long to remember (ms)

State:

  • visibleTargets - Currently visible entities
  • heardSounds - Recent sounds detected
  • memory - Remembered but not visible

Events:

  • perception_spotted - Target spotted
  • perception_lost - Target lost
  • perception_heard - Sound detected

@emotion

Emotional state machine with expressions.

hsplus
object Pet @emotion {
  emotions: ['happy', 'sad', 'angry', 'neutral']
  default_emotion: 'neutral'
}
ConfigTypeDefaultDescription
decay_ratenumber0.1How fast emotions fade
expression_blend_timenumber500Blend duration (ms)

State:

  • currentEmotion - Active emotion
  • emotionIntensity - Intensity (0-1)
  • emotionHistory - Recent emotions

Events:

  • emotion_changed - Emotion transitioned
  • emotion_triggered - Emotion stimulus received

@memory

Long-term memory and recall for NPCs.

hsplus
object Historian @memory(capacity: 100, consolidation_interval: 60000) {
  memory_types: ['events', 'conversations', 'locations']
}
ConfigTypeDefaultDescription
capacitynumber100Max memories stored
consolidation_intervalnumber60000Memory cleanup (ms)
importance_thresholdnumber0.3Min importance to keep

Events:

  • memory_store - Memory saved
  • memory_recall - Memory retrieved
  • memory_forget - Memory discarded

See Also

Released under the MIT License.