Python Code
# Variables persist across executions. # Run this, then run the next example. x = 42 greeting = "hello" x
⏸ Python is blocked on msg_recv — click Push → to unblock it
Dart →
Result & State 0 vars
Execute code to see the result
Session State
No variables yet
Bridge Events 0
Run code to see bridge events in real-time
Loading tool schemas...

AgentSession combines a Monty bridge, host functions, OS providers, and variable persistence into one API.

Stateful: Variables defined in one execution persist to the next. Click "Clear State" to reset.

Host Functions: Python can call Dart-defined tools: `echo(msg)`, `add_numbers(a, b)`, `get_time()`.

Plugins: `tmpl_render()` (Jinja2 templates), `msg_send()/msg_recv()` (message channels), `sandbox_spawn()/sandbox_await()` (child interpreters).

Filesystem: pathlib works via MemoryFsProvider: `Path('/sandbox/f.txt').write_text(...)`

Events: Every bridge event streams in real-time to the Events panel.