Agents with memory: how long-term context changes automation
Marcus Lindqvist
Staff Engineer
· 7 min read
Most automation tools treat every run as the first one. The agent reads the input, does its job and forgets everything. That works for simple tasks, but it breaks down the moment a workflow depends on history.
Why stateless agents hit a ceiling
Imagine a support workflow that drafts replies. Without memory, it asks the same clarifying questions every time, ignores that a customer already reported the issue twice, and cannot learn that a particular account prefers short answers. Every run is a cold start.
Teams work around this by stuffing context into prompts by hand. It is fragile, expensive and quietly grows out of date. We saw this pattern in dozens of customer interviews, and it is the main reason we built long-term memory into the platform.
The first time the agent said "last month you asked me to skip the greeting, so I did", the team stopped treating it like a tool and started treating it like a colleague.
Camila Torres, Solutions Engineer at Nexora
What memory looks like in practice
Memory is not one big transcript. It works best as small, scoped facts that an agent can read and update. We settled on three layers:
- Run memory holds context for a single execution and is cleared afterwards.
- Entity memory attaches facts to a customer, project or account, such as tone preferences or past decisions.
- Workspace memory stores shared rules, like your refund policy or brand voice.
Here is how you can scope memory to a single customer using the memory option when you start a run:
import { Nexora } from "@nexora/sdk";
const client = new Nexora({ apiKey: process.env.NEXORA_API_KEY });
// Run a workflow with memory scoped to one customer
const run = await client.workflows.run("support-triage", {
input: { ticketId: "T-1042" },
memory: { scope: "customer", ttlDays: 90 },
approvals: { required: true, reviewer: "support-leads" },
});
console.log(run.status); // "awaiting_approval"
Guardrails you should set
Remembering everything is not the goal. A few rules keep memory useful and safe:
- Give every fact an expiry date, so stale information fades on its own.
- Keep sensitive fields out of memory and reference them at run time instead.
- Require approval before an agent writes to workspace-wide memory.
- Review what was stored in the run log, not just what was sent.
Where to start
Pick one workflow where people repeat themselves, such as support replies or lead follow-ups. Turn on entity memory for that workflow only, review the run logs for a week, and tighten the rules before you expand. Most teams see the benefit within a few days.
Written by
Marcus Lindqvist
Staff Engineer at Nexora. Marcus works on agents, memory and the run engine, and writes about building reliable AI systems.