Skip to main content
Version: Studio 2.2.32

Large results and long work

Agents in Studio Chat and Flows are given search results, database queries, web pages, documents and program output of any size. Read this to know what an agent does when a result is too long to read at once, or a piece of work is too long for one working space, and what you see when it happens. Nothing is cut and nothing is lost: the whole result is kept as a file, and the agent reads it, searches it or hands it to the coder.

Large results are saved as files​

Any tool result longer than 30,000 characters (Tool result size kept in view) is saved in full as a file in the chat's or run's folder, under Saved results (the tool-results folder). A Flow step's results go in a folder named after the step; a chat's go in a folder for each turn. That covers every tool: Data Bridge connectors, MCP tools, web pages, searches, Intelligence Graph reads and code output. The agent does not get the whole result in its working space. It gets:

  • the file's path, and the line "Nothing was cut from the file";
  • a preview of up to 4,000 characters (Preview of a saved result) that shows the result's shape: for a table, its rows and columns with their types, the first five rows and the last two; for JSON, its keys and its largest lists; for text, its first lines and headings;
  • how to read the rest.

Tables are saved as CSV, JSON is saved laid out one field per line, and a long text field inside a result, such as a page of a filing, is saved as its own file so it can be read by line. A file is never overwritten, even when several tools return at once.

The same rule covers what you send and what the agent writes:

WhatOverSaved as
A message you paste into the composer30,000 characters (Pasted message size kept in view)a copy in the chat's inputs/pasted folder, such as inputs/pasted/turn-3.md. The agent reads the whole message in that turn, and later turns read it from the file.
The agent's answer, or a reply in a shared chat60,000 characters (Answer size kept in the chat)a file in the chat's answers folder, such as answers/turn-3.md. The chat keeps the start of the answer, which ends with "[This answer is 84,000 characters. The full answer is saved in answers/turn-3.md.]" A reply in a shared chat ends with "[This reply is {chars} characters. The full reply is saved in {file}.]"
A query to a database through Data Bridge30,000 characters, like any tool resulta CSV file. One query returns at most 1,000 rows (Rows per connector query), and 200 when the agent does not ask for a number (Default rows per connector query).

A chat turn or Flow run saves at most 1,000 results as files and 512 MiB in all (Saved results per run, Saved result size per run). Past that, later results keep only their preview, and the run says so: "{step} saved more large results than a run may keep, so later ones were cut to their first {chars} characters." If a save fails, the agent uses the start of the result and Lens says so: "This result was too long to show in full and could not be saved. The agent used the first {chars} characters."

Who can open a saved result, and how long it is kept, is the same as for the other files of the chat or run (Files, previews and approvals, Folio).

How an agent reads a saved file​

Every agent, in a chat or a Flow step, has four read tools that work on the chat's or run's files without starting the coder.

ToolWhat it does
read_fileReads a range of lines, each with its line number. A step reads up to 2,000 lines or 40,000 characters at a time (File read page lines, File read page size), and the result says where to carry on. A very long line is read in parts, so a file that is one long line can still be paged.
grep_filesSearches one file, or every text file in a folder, for a pattern. By default it lists the files that match; asked for more, it shows the matching lines with their line numbers and lines of context, or a count for each file. It searches up to 200 files at once (Files searched at once) and says which it skipped.
list_filesLists a folder: its folders first, each with a count of files, then its files, newest first, each with its size and when it changed.
file_shapeShows a file's structure without reading it all: the rows, columns, types and first and last rows of a table (CSV, TSV, XLSX or Parquet), the keys of a JSON file, or the lines and headings of a text file.

The agent that coordinates a chat has a fifth, plan_reading, which splits a long document into reading parts by line range. It reads smaller pages, 500 lines or 20,000 characters (File read page lines for the coordinator, File read page size for the coordinator), so it hands long reading to steps.

An agent that calls read_workspace_file keeps working: it is an older name for read_file.

The read tools never open folders whose names start with a dot, another chat's or run's files, or a Folio file the chat or run was not given. A file over 100 MiB (Largest file the agent reads directly) is refused with "This file is {size}, too large to read here. Use run_analysis to work on it." A step's handover from an earlier step, a document and an Intelligence Graph entry are read page by page in the same way, up to 20,000 tokens a page (Page size for paged readers); see Read a graph entry in full.

Looking and computing​

One rule decides who does what. An agent looks at a saved file itself: its shape, a few rows, a search. Anything that counts, filters or joins, or passes over a whole table or JSON file, goes to the coder through an analysis. The coder works on the file on its own disk, runs code on it and hands back its findings, each with the file and line it came from (Kernel).

While a long program runs in the kernel, its row in Lens shows how long it has run, for example "Running 12 min of up to 29 min". It updates once a minute and goes when the program finishes.

A long document is split up before it is read:

  • In a chat, a document up to 300,000 characters (Longest document one step reads) is read whole by one step, however many parts the agent asks for. Every extra step costs model calls, so a document one step can read whole is not split. A longer document is split into reading parts of up to 150,000 characters (Reading part size), each with text and none larger than that limit, and the agent adds one reading step for each part. Each step reads its part in full and writes notes with the page or line of every fact, and one more step writes the answer from those notes. A document needs at most 24 parts (Reading parts per document); a longer one goes to the coder. Whatever the limit is set to, a step never takes more of a document than fits in its working space before its first note, with room left for its own instructions.
  • Nothing to read. A step with nothing to read, such as a reading part that is blank or past the end of the document, is skipped before it does any work, and so is a step built only on such steps. Its card reads Skipped, and Lens says why, for example "Nothing to read: report.txt has 1,200 lines, so lines 1,201 to 2,400 are past its end." A step that builds on any step with work always runs.
  • In a Flow step, the step reads the document page by page, or hands it to the coder. The coder's explorer reads it outside the coder's own working space and returns each fact with the file and the place it came from.

The working space​

An agent's working space is how much it can hold at once: the instructions, the conversation, the results it has seen and its own reasoning. Each Flow step and each chat step has a working space of 600,000 tokens (Working space per step), and the agent that coordinates a chat has 400,000 (Working space for the coordinator). An agent starts with at most 200,000 (Working space at the start of a step). The models Studio uses accept up to 1,000,000 tokens (Model context window).

Studio measures the working space from each model call's own count, cached tokens, images and PDF pages included, and acts at three marks:

MarkStudio defaultWhat happens
First working space note60%The agent is told its working space is filling. It reads in small ranges and keeps notes of what it has found.
Carry-on point80%A step is told to write its notes now, with every figure and the file and line it came from. If work is left, it can carry on in a fresh working space from those notes (Carry on). The agent that coordinates a chat is told to add steps for the reading that remains.
Stop point90%A step that has not carried on is stopped cleanly with its notes, and carries on from them while it has fresh starts left. The agent that coordinates a chat gets one more call to answer, then stops.

A model request to Amazon Bedrock may carry at most 20 MB. Studio checks each request against 18 MiB (Largest model request) before it is sent, so a step heavy with images or PDF pages writes its notes and carries on instead of failing.

You can see the working space as it fills: a small ring in the chat composer, in the Lens header of a Flow run and beside each step's title (Working space).

Carry on​

A step that chooses to carry on at the carry-on point, or is stopped at the stop point, starts again in a fresh working space. It is seeded with its objective, its notes, the list of files it saved so far and the handover pages it has not yet read. It carries on from there, with nothing lost. A step may do this five times (Fresh starts per step). Lens shows "This step carried on with a fresh working space (1 of 5). Its notes are in {file}." on the step. A step that fills its working space again after its last fresh start ends, and the working space popover says "{step} ran out of working space. Its notes so far are in {file}."

Summaries and compaction​

The agent that coordinates a chat makes room in a different way. At 70% of its working space (Summary point) it summarises its earlier work and carries on in the same answer. It does this at most twice in one answer (Summaries per answer) and keeps the latest 8 messages word for word (Recent messages kept in full). A summary never loses a file: every saved file, link and figure is kept word for word, and the list of the chat's files is given back to the agent after every summary.

How the coordinator makes room chooses the method, set per deployment:

ChoiceWhat the coordinator does
Let the model summarise (the Studio default)Asks the model, through Amazon Bedrock, to summarise its earlier work itself. Studio then gives back every file path and link from the summarised messages, word for word. If the model's own summary cannot be used, Studio summarises for the rest of the answer instead, as with Summarise earlier work.
Summarise earlier workStudio summarises the coordinator's earlier work with the coordinator's own model, reusing the cached context. Model for summaries set to A smaller, lighter model uses a smaller model instead of Same model as the coordinator.
Off: start fresh from notesEnds the pass and starts fresh from its notes.

Across turns, earlier messages of a long chat are folded into the chat's summary, and the list of files saved earlier in the chat comes back at the start of every turn (Context for earlier files), so "the trade results earlier" still has a file to read weeks later. The chat shows one quiet line between two turns when this happened: "Earlier messages summarised · files kept".

The coder keeps its own working space and summarises its work as it goes. Before each summary it saves its transcript, and afterwards it is given back its facts file, the findings it recorded as it worked. Its files are unchanged. Lens shows "The coder summarised its earlier work to make room. Its files are unchanged."

Caching​

Much of what an agent sends with each model call repeats: its instructions, its tools and the conversation so far. Studio caches that part with Amazon Bedrock, so the next call reads it from the cache instead of sending it again, and long chats and Flows answer sooner. Caching is on by default for the coordinator and every step (Prompt caching), and the coder caches its own calls.

CacheLastsSetting
The coordinator's tool list1 hourHow long the coordinator's cache lasts
A step's calls5 minutesHow long a step's cache lasts
The coder1 hourHow long the coder's cache lasts

The coordinator's tool list is the same from turn to turn, so one hour keeps it cached while people take a few minutes to reply. Its instructions and the conversation change every turn, so they are cached for 5 minutes, which covers the calls within a turn. A step's cache lasts an hour too (How long a step's cache lasts), because a step often waits several minutes for a coder analysis between its model calls; its instructions are fixed for the step, so they are read back from the cache, not written again. One hour suits the coder when one chat runs several analyses a few minutes apart. If Amazon Bedrock refuses the 1-hour cache for a model, Studio uses 5 minutes for that model.

AlphaAgent counts every input token of a model call once, whether it was read from the cache or not (What leaves your account). Caching makes answers faster and lowers what Amazon Bedrock charges your AWS account; it does not lower the input tokens AlphaAgent counts.

What was read​

Studio records how much of each file an agent read: Read in full, Read in part with the share, Searched, Analysed with code or Not opened. Reading part of a large file is how large files are meant to be used, so it is recorded, not flagged. Two cases are said out loud:

  • A saved result nobody opened. A step that saved a result and never opened it is asked once to read it before it finishes. If it finishes anyway, the step's warnings say "{step} finished without opening a result it saved from {tool}. The full result is in {file}." In a chat, the answer's footer counts it too.
  • A document read in part. When an answer rests on part of a document, a footer under the answer reads "Not everything was read · 2 files" (or "· 1 file") and opens the working space popover at Partly read (Working space). On a Flow run the step's warnings say "{step} read {pages_read} of {total_pages} pages of {file}." what the coder read counts too.

The coder keeps a record of what it read in each analysis. A file it read only part of is listed under Partly read, with the pages read when the file has pages. A file it was given but never opened is listed under Not opened. A file it searched, or ran a program over, counts as used and is not listed. The record holds up to 500 files by default (Files in an analysis's reading record), partly read files first.

Step details lists what the step read, with these labels (Flows: run, schedule, approve).

Notes​

  • Every number on this page is a Studio default. An administrator sets each one per deployment on its Runtime limits tab in Organisations, within the range on Limits and quotas. Larger working spaces cost more per call and use more of the deployment's per-minute Amazon Bedrock quota.
  • Save large results as files turns the rule off for a deployment. Use it only to roll back: large results are then cut to a preview.
  • A safety limit of 16,000 tokens (Safety limit for one tool result) catches any result that reached the working space without being saved, and saves it then. It should never be reached.
  • Files that agents in earlier releases kept in the _tool_output folder stay readable. Nothing new is written there.