Memory & Persistence
Your agent has both short-term and long-term memory. Understanding how these work helps you get the most out of your agent.
Short-term memory: Sessions
Section titled “Short-term memory: Sessions”During a conversation, your agent maintains context in session files stored at /data/sessions/. Each session is a JSONL file containing:
- Your messages
- Agent responses
- Tool calls and results
- Usage statistics
Sessions persist across turns within a conversation. When you send a message, the agent continues from where you left off.
Session commands
Section titled “Session commands”| Command | Effect |
|---|---|
/clear | Start a new session (old ones preserved) |
/resume | List recent sessions with hashes |
/resume abc1 | Resume a specific session by hash |
/compact | Compress session to save tokens |
Context limits
Section titled “Context limits”Each model has a context window limit (currently 200k tokens for all Claude models). When your session approaches the limit, use /compact to summarize older messages and free up space.
Long-term memory: MEMORY.md
Section titled “Long-term memory: MEMORY.md”/data/MEMORY.md is your agent’s persistent memory. It survives:
- Session changes
/clearcommands- Platform updates
- Channel switches
What goes in MEMORY.md
Section titled “What goes in MEMORY.md”The default MEMORY.md includes:
# agentname — Agent Memory
## Identity- Email: agentname@tinyfat.com- Owner: you@example.com
## Email Response Pattern[How to send emails via /data/outbox/email/]
## Rules[Default behavior rules]Customizing MEMORY.md
Section titled “Customizing MEMORY.md”Ask your agent to edit its memory:
“Add to your memory that I prefer concise responses”
Or:
“Show me your MEMORY.md file”
Then tell it what to change.
Configuration: config.json
Section titled “Configuration: config.json”Agent preferences like model selection are stored in /data/config.json:
{ "model": "sonnet"}The default model is claude-sonnet-4-6. Change it with /model haiku or /model sonnet, or just ask your agent to switch.
Cross-channel memory
Section titled “Cross-channel memory”All channels (Email, Telegram, Slack) share the same:
- MEMORY.md — Persistent memory
- Sessions — Conversation history
- Storage —
/datadirectory
Start a conversation on email, continue on Telegram. Your agent remembers everything.
Storage location
Section titled “Storage location”All agent data lives in R2 storage:
agents/{agent_id}/├── MEMORY.md # Long-term memory├── config.json # Preferences├── sessions/│ └── {id}.jsonl # Session files├── outbox/│ ├── email/ # Pending emails│ ├── sent/ # Sent emails│ └── failed/ # Failed emails└── events/ └── {name}/ # Scheduled eventsEach agent has isolated storage — agents can’t see each other’s data.
Context compaction
Section titled “Context compaction”When your session gets large, use /compact to reduce token usage:
- The agent summarizes the conversation history
- Old messages are replaced with the summary
- Recent messages are preserved
- You continue with full context of what happened
Custom compaction focus
Section titled “Custom compaction focus”/compact focus on the code changes we discussedTells the agent what to prioritize in the summary.
Data portability
Section titled “Data portability”Your data is yours:
- View anytime — Ask your agent to show files
- Export — Download from R2 (contact support)
- Self-host — Run your own instance with troublemaker
We don’t lock you in.
Best practices
Section titled “Best practices”Use MEMORY.md for
Section titled “Use MEMORY.md for”- Persistent preferences
- Project context that spans sessions
- Standing instructions
- Important information to always remember
Use sessions for
Section titled “Use sessions for”- Active conversations
- Work in progress
- Temporary context
Keep MEMORY.md focused
Section titled “Keep MEMORY.md focused”Don’t dump everything in MEMORY.md. It’s read every turn, so keep it concise and relevant.
Next steps
Section titled “Next steps”- Agent Workspace — Full filesystem layout
- Memory Bank Pattern — Organized project knowledge