Memory
Persistent long-term memory storage for agents
Memory provides persistent long-term storage designed for agents to retain knowledge across runs. Unlike artifacts which store work products, memory is where agents keep learned preferences, past decisions, and accumulated context.
How Memory Works
When you run an agent with --memory:
- Before running - VM0 loads the memory into the agent's environment
- During running - The agent reads from and writes to memory as needed
- After running - VM0 persists any changes back to the memory
This allows your agent to build up knowledge over time, improving its effectiveness across multiple runs.
vm0 run my-agent "review the latest PRs" --memory my-agent-memoryManaging Memory
You can manage memory manually using the vm0 memory commands.
Initialize
Initialize a memory in the current directory:
vm0 memory initThis creates a .vm0/storage.yaml config file with type: memory. The current directory name becomes the memory name.
Push
Upload local files to the cloud:
vm0 memory pushOptions:
-f, --force- Force upload even if content unchanged
Pull
Download memory from the cloud:
# Pull latest version
vm0 memory pull
# Pull a specific memory by name
vm0 memory pull my-agent-memoryClone
Clone a remote memory to a new local directory:
vm0 memory clone my-agent-memoryStatus
Check the cloud memory status:
vm0 memory statusShows version, file count, and size of the remote memory.
List
List all remote memories:
vm0 memory listExample Workflow
# Create a memory directory
mkdir my-agent-memory && cd my-agent-memory
# Initialize as memory
vm0 memory init
# Add some initial context
echo "Prefer concise PR reviews" > preferences.md
# Push to cloud
vm0 memory push
# Run agent with this memory
vm0 run my-agent "review the latest PRs" --memory my-agent-memory
# Pull the agent's updated memory locally
vm0 memory pullMemory vs Artifact vs Volume
| Volume | Artifact | Memory | |
|---|---|---|---|
| Purpose | Pre-installed environment for the agent | Output produced by the agent | Long-term knowledge retained by the agent |
| Contains | Skills, configurations, scripts | Files created or modified during runs | Learned preferences, decisions, context |
| Persistence | Not auto-persisted after runs | Automatically persisted after each run | Automatically persisted after each run |
| Use case | Tools and knowledge given before start | Work products the agent creates | Knowledge the agent accumulates over time |