store_media- Images, videos, audio, and file uploadsstore_tool_messages- Tool calls and their resultsstore_history_messages- Historical messages from previous runs
Storage control works identically for Agents and Teams. This page shows examples for both.
How Storage Control Works
Think of these flags as filters for your database, not your agent. During a run, your agent or team sees everything: media, tool results, history. Everything works normally. The filtering only happens when saving to the database after the run finishes. So you can turn off storing media or tool messages without breaking anything. Your agent still processes images, tools still run, history still flows to the model. You’re just choosing what gets written to disk. Token metrics still reflect the real usage, even if you didn’t persist all the data.Important:
store_tool_messages=False removes tool-call and result pairsWhen you disable tool message storage, Agno removes both the tool result and the strips the tool call from the corresponding assistant message (message from the LLM). This is required to maintain valid message sequences that model providers expect.Your metrics will still show the actual tokens used, including the removed tool messages.Storage Flags Reference
| Flag | Default | What It Controls | Impact When Disabled |
|---|---|---|---|
store_media | True | Images, videos, audio, files uploaded by users | Media not persisted to database |
store_tool_messages | True | Tool calls and their results (also removes corresponding assistant messages) | Tool execution details not stored, saves significant space |
store_history_messages | False | Historical messages from previous runs | Old history not stored, only current run persisted |
Disable Media Storage
Large media uploads (images, PDFs, audio) can dominate your session tables. Turn them off withstore_media=False and store the original files elsewhere (S3, GCS, etc.).
Recommended Workflow
- Upload the file to your preferred storage service and keep the URL/ID
- Pass that URL to the agent/team so it can fetch/process the file
- Skip persisting the raw media via
store_media=False
Disable Tool Storage
Tool calls can easily bloat storage (think web-scraped pages or large API payloads). Togglestore_tool_messages=False to remove both the tool result and the tool-call from the corresponding assistant message that triggered it from the persisted run. Metrics still show the real token usage.
Considerations
- Removing tool messages keeps the provider-friendly message ordering intact (no stray tool roles)
- When auditing tool behavior later, re-run the tool or log its output somewhere else before the run completes
- Pair this with
store_media=Falsewhen tools return binary payloads you don’t need in the session record
History Storage
store_history_messages defaults to False to prevent database bloat. History still reaches the LLM during runs (via add_history_to_context), but historic messages are scrubbed before persistence. Only the current run’s messages are written to the database.
Set store_history_messages=True if you need to persist complete conversation history.
When to Enable It
- You need to inspect past conversations in the database
- You’re debugging multi-run interactions
- Your agent relies heavily on historical context across sessions