smolagents
Store a note with a smolagents tool, then read that same file from a later process.
A smolagents tool can write a file while a worker is running. When that process exits, the next worker does not have the file.
mountable.io is a persistent filesystem for AI agents. write_note stores
the note there. A later process calls read_note and gets the same file.
mountable.io maintains the
runnable example,
separately from Hugging Face. The example calls
ToolCallingAgent.execute_tool_call on two real tools. It does not call a
model. smolagents 1.26.0 marks its API as experimental, so the example pins
that version.
Prerequisites
Use an existing mountable.io account with a saved payment method, an existing filesystem and an API key that can access it. Storage and file operations follow the usage prices. The example creates no account, filesystem or credits.
You also need Python 3.11+ and uv. Set MOUNTABLE_API_KEY in your private
environment or secret manager. Never put a key in a command argument.
Use your filesystem ID in place of FS_ID below.
git clone https://github.com/writeitai/mountable.git
cd mountable/examples/smolagents-workspace
uv sync --locked
export FS_ID="your-filesystem-id"Your backend chooses the filesystem and the note path from its authenticated user. Do not let a model choose another user's filesystem. The path is not a tool argument.
Store a note
write opens the filesystem read-write and calls write_note. The tool
creates notes/brief.md and returns stored.
uv run python notes.py write \
--filesystem "$FS_ID" \
--path notes/brief.md \
--text "Parser review complete. Check the file next."The path has to look like notes/brief.md. The note is UTF-8 text up to
16 KiB. The write uses If-None-Match: *, so an existing file is left as
it is. After a timeout, read the path before writing it again.
A 402 with filesystem_spending_cap_reached stops that user's billable
mountable.io work. Other filesystems keep working. The filesystem cap does
not limit what a model provider charges if you add a model later.
Read it from a fresh process
read is a new process. It opens the filesystem read-only and calls
read_note. A read-only session cannot replace the file.
uv run python notes.py read \
--filesystem "$FS_ID" \
--path notes/brief.mdThe command prints the note. It does not print the API key. Use a new path for each note you want to keep. This example does not delete files for you.
Offline checks
From the example directory:
uv run pytest -qThe tests call real smolagents tools against a fake filesystem. They make no paid cloud or model calls.
Sources: smolagents tools, Files API.