Workspaces
A workspace defines everything the agent has access to: files, libraries, skills, and initialization code.
workspace = Workspace(
local_dirs=[("./data", "/workspace/data")],
libraries=[Library.from_file("helpers.py")],
skill_dirs=["./skills/research"],
custom_init_code="model = load_my_model()",
)
What you can configure
| Field | What it does |
|---|---|
local_dirs |
Mount local directories into the workspace |
local_files |
Mount individual files |
libraries |
Python modules the agent can import |
skill_dirs |
Skill folders for agent discovery |
custom_init_code |
Python code to run at startup |
preload_models |
Whether to load models before agent starts (default: true) |
hidden_model_loading |
Hide model loading output from agent (default: true) |
Libraries
Make Python files importable by the agent:
workspace = Workspace(libraries=[
Library.from_file("utils.py"),
Library.from_skill_dir("skills/steering"),
])
When using ScopedSandbox, RPC handles are also libraries:
model_tools = scoped.serve("interface.py", expose_as="library")
workspace = Workspace(libraries=[model_tools])
Either way, the agent just imports:
Skills
Skill directories contain documentation and tools the agent can discover. Useful for giving the agent reference material or predefined procedures.
Custom init code
Run arbitrary Python before the agent starts:
workspace = Workspace(
custom_init_code="""
from transformers import AutoModel
model = AutoModel.from_pretrained("google/gemma-2-9b")
tokenizer = AutoTokenizer.from_pretrained("google/gemma-2-9b")
"""
)
Variables defined here are available in the agent's namespace.
Seer toolkit
Common interpretability utilities live in experiments/toolkit/:
extract_activations.py— layer activation extractionsteering_hook.py— activation steering via hooksgenerate_response.py— text generation helper
These are meant to be copied and modified.