Skip to content

When your agent's instructions outgrow the box

Long agent instructions meet three limits: the box, the model and the reviewer. Where each part of the text belongs, and how EpicStaff stores it.

An agent answers questions from suppliers. In the first week, its instructions are ten lines long: who it works for, which tone to use, when to hand a question to a person.

By the third month, there are rules for late deliveries, for the two suppliers who invoice in dollars, for questions about the new framework contract, and a list of words the agent must never use. One afternoon, someone adds one more rule, and the screen will not save it. The box is full.

Someone asks an AI assistant to make the text shorter. Now it fits. Nobody checks, line by line, whether the short text still says everything the long one said.

What others have reported

One builder reported reaching a limit of 8,000 characters on agent instructions soon after starting. The builder asked an AI assistant to compress the text to about 5,000 characters, kept it readable, and said the agent stayed just as consistent.

Another builder reported that an agent, after it was given more instructions and more knowledge, began to fail now and then on a token limit: a cap on how much text the model may take in. A helper on the same forum said that nothing warns before that limit is reached.

Two reports, two different limits. The first was a limit of the box. The second was a limit of the model. Compressing the text helped with the first. It does not change the second; it only moves it further away.

Three limits on long instructions

An AI agent is a model that works from instructions and uses tools (see what an AI agent is). The instructions meet three limits:

  • The box: how much text the tool lets you save.
  • The model: how much text the model takes in at once. The instructions share that room with everything else in the call: the task, the tool results and the conversation so far. They usually go to the model with every call, so each extra paragraph counts on every call.
  • The reviewer: the longer the text, the harder it is for a person to see what changed, and why.

In EpicStaff, the box is not the limit. EpicStaff sets no length limit on an agent's instructions. The real limit is how much text your chosen model accepts.

That changes the question. It is no longer "will it fit?" It is "should all of it be here?" When you compare agent builders, ask about all three limits (more in what to look for in an AI agent builder).

Not every line is an instruction

Read your long instructions, and sort each line into one of three kinds.

  • Rules for every task. Who the agent works for, its tone, what it must never do, when it hands over to a person. These are the agent's instructions.
  • Directions for one job. The steps for a late-delivery question. The layout of one report. These belong with that job.
  • Reference material. Price lists, contract terms, the list of suppliers. The agent looks things up in these. It does not obey them.

Reference material is often the largest part, and the easiest to move out. Many platforms let an agent search such material when it needs it. But searching is not following. The agent sees the parts its search finds, not the whole text. So a rule the agent must always follow does not belong in searchable material. It belongs in the instructions.

Where each part goes in EpicStaff

An agent's own instructions are fixed text saved on the agent. A task step's instructions can include {placeholders}, which are filled at run time from values that earlier steps in the flow produced.

So the rules for every task go on the agent, once. The directions for one job go on the task step that does that job. Values that change from run to run, such as a supplier's name or an order number that an earlier step found, go into the step's instructions as placeholders.

The agent's text then stays short and stable. Each step carries only what that step needs.

What a saved version keeps

A saved flow version keeps each task step's own instructions. The agent's main instructions live on the agent, which flows share, so an older flow version uses the agent's current instructions.

This matters on the day you go back to an older flow version. The task steps come back as they were. The agent's main instructions stay as they are now. And when you change an agent's main instructions, every flow that uses that agent works with the new text.

So keep your own copy of each version of the agent's main instructions, with the date and the reason for the change.

Who changed a flow, and when: Someone changed the flow on Friday. Nobody can say who.

Keep the long text in your own files

You can create and change agents, including their instructions, through EpicStaff's REST API, not only in the screen.

That gives the long text a better home than a text box. Keep the agent's instructions as a text file in your own version control. Review a change to it like any other change. Then send the new text to the agent through the API.

Be exact about what this does. The agent does not read the file. Each time you send the text, it is saved on the agent. The file is your record of what the text was, who changed it, and why.

More on agents as code: If your agents live only in a screen, you do not really own them.

Before you add the next rule

Ask four questions about the new line, in this order.

  1. Does it hold for every task this agent does? Then it goes in the agent's instructions. Remember that every flow that uses the agent gets it.
  2. Is it about one job? Then it goes in that task step.
  3. Does it change from run to run? Then it is a placeholder that an earlier step fills.
  4. Is it something to look up, not something to obey? Then it stays out of the instructions, as reference material.

If a line fits none of the four, ask whether the agent needs it at all.

The supplier agent from the start did not need a bigger box. It needed its text sorted.

Q&A

Is there a length limit on AI agent instructions?

It depends on the tool. Some builders limit the instruction box, and every model limits how much text it takes in at once. EpicStaff sets no length limit on an agent's instructions. The real limit is how much text your chosen model accepts.

Can an AI agent's instructions change from run to run?

In EpicStaff, an agent's own instructions are fixed text saved on the agent. A task step's instructions can include {placeholders}, which are filled at run time from values that earlier steps in the flow produced.

If I restore an older flow version, do the agent's instructions go back too?

Not in EpicStaff. A saved flow version keeps each task step's own instructions. The agent's main instructions live on the agent, which flows share, so an older flow version uses the agent's current instructions. Keep your own copy of each version of them.

Can I manage agent instructions outside the screen?

Yes. You can create and change agents, including their instructions, through EpicStaff's REST API, not only in the screen. So you can keep the text in your own version control and send it through the API.

Keep reading