Skip to main content
When a tool output is too large for context, the full result is saved to disk so the agent can read it back on demand.
The user asks for a large tool result; oversized output is stored on disk and the agent gets a preview plus a path to read the full file.

Quick Start

1

Zero-config (default retention)

No setup required β€” overflow outputs are stored automatically under ~/.praisonai/cache/tool_outputs/.
2

Custom retention

Or programmatically:

How It Works


What the Agent Sees

The agent can then read the full file from the path in the marker.

Configuration

Storage Layout

When no run_id is supplied β€” i.e. get_tool_output_store() is called with no argument outside of an agent run β€” the store returns a fresh, un-cached instance scoped to a new auto-generated UUID. It does not adopt whichever store happens to be live process-wide, so outputs from unrelated runs never share a directory.

Retrieve Programmatically


Common Patterns

Long-running research agents β€” web search bodies are stored when truncated; the agent reads them back in a follow-up turn. Pair with per-tool budgets β€” combine with Context Per-Tool Budgets for fine-grained limits. Short retention on CI β€” set PRAISONAI_TOOL_OUTPUT_RETENTION_HOURS=1 on shared runners.

Best Practices

Old run directories are removed when older than the retention window on the next store initialisation.
Outputs are plaintext on disk β€” avoid tools that return credentials or tokens into the store.
Pass a consistent run_id to get_tool_output_store(run_id=...) when multiple agents share one session.
Inside an agent run, run_id is threaded through automatically from the agent’s internal run context. You do not need to pass it yourself β€” overflow outputs go under ~/.praisonai/cache/tool_outputs/<run_id>/ scoped to that run. If you build a workflow that shares outputs across agents, pass a stable run_id explicitly to get_tool_output_store(run_id=...) so they land in the same directory.
Use per-tool budgets to control inline size; the store handles anything that still overflows.

Not the same as Tool Output Spill. This store handles arbitrary large tool return values with time-based retention under ~/.praisonai/cache/ (PRAISONAI_TOOL_OUTPUT_RETENTION_HOURS). Tool Output Spill is specific to execute_command and uses a different dir (PRAISONAI_TOOL_OUTPUT_DIR) with process-exit cleanup.

Tool Output Spill

Save large execute_command output to a retrievable artifact

Context Per-Tool Budgets

Per-tool truncation limits

Context Window Management

Overflow and compaction strategies

Context Management

Agent context lifecycle