Builtins API Reference
SelfReference
Constructor
Key Methods
Memory Key Isolation
Each key has independent state:- History (conversation transcript)
- Experiences (durable facts)
- Summary state (compaction checkpoints)
- Fork handles (child agent state)
Usage with @llm_chat
Runtime Primitives (via PyRepl)
When SelfRef is active, these are available inexecute_code:
PyRepl
Constructor
Properties
Methods
Tools Provided
execute_code
execute_code returns a natural-language summary. If code outputs images through display(Image(...)), an image-rich last expression, or ImgPath(...) / ImgUrl(...), the tool result becomes multimodal so the model can inspect the image.
reset_repl
Example
Custom Events
Execution Limits
FileToolset
Constructor
workspace. Path traversal above workspace is rejected.
Properties
Tools Provided
read_file
<lineno> | <content>.
read_image
grep
path_pattern scopes which files to search.
sed
echo_into
Stale-Write Protection
FileToolset tracks file hashes on read. If a file was modified externally between read and write,sed and echo_into will reject the write and ask the agent to re-read.