Module dynamic_agent

Module dynamic_agent 

Source
Expand description

Dynamic runtime-script agent.

DynamicAgent executes Rhai scripts generated by the LLM at runtime. Rhai is a safe, sandboxed scripting language for Rust — it replaces the Python exec() approach with proper isolation.

The Rhai engine exposes a limited API to scripts:

  • agent_log(msg) — log a message
  • agent_alert(msg) — broadcast an alert
  • agent_state_get(key) — read from persistent state
  • agent_state_set(key, value) — write to persistent state

Scripts must define a fn main() function that is called on each message.

Structs§

DynamicAgent
A dynamically scripted agent.