Skip to main content
Memory transforms an agent from a stateless question-answering machine into an intelligent assistant that learns and adapts. Without memory, every run starts cold—the agent has no idea who it spoke to yesterday, what a user prefers, or what happened in the last conversation. With memory enabled, your agents can recall past interactions, surface relevant context automatically, and deliver responses that feel personal and continuous rather than generic and repetitive.

Types of memory in Layest

Layest gives you three distinct memory layers, each designed for a different scope and lifetime of information.
Short-term memory holds context for a single conversation or agent run. It accumulates as the agent works through a workflow—tool outputs, intermediate reasoning steps, and user messages are all kept in the active context window and discarded when the run ends.What it stores: The full message history, tool call results, and any variables generated during the current run.Lifetime: Exists only for the duration of the run. Nothing is written to persistent storage.When to rely on it: Short-term memory is always on. You don’t need to configure anything—every agent has it. It’s sufficient for single-session tasks where continuity across conversations isn’t required.
Long-term memory persists information across separate runs and conversations. When the agent encounters a fact worth retaining—a decision made, a preference stated, a summary of a completed task—it can write that fact to the knowledge base, where it remains available in future runs.What it stores: Structured facts, summaries, decisions, and any data you explicitly instruct the agent to remember.Lifetime: Indefinite, until you delete the entry or it exceeds a configured retention window.When to rely on it: Use long-term memory for agents that need continuity over time—account management bots, onboarding assistants, or any agent that should build context across multiple sessions with the same user or project.To enable long-term memory, open the agent editor, go to Memory → Long-term Memory, and toggle it on. You can also define a Memory Instruction—a prompt fragment that tells the agent what kinds of information are worth retaining.
User memory is a dedicated store for per-user facts and preferences. Where long-term memory is scoped to the agent’s overall knowledge, user memory is keyed to a specific end user—their name, role, communication style, stated preferences, and any other attributes the agent should carry forward into every conversation with that person.What it stores: User identity attributes, stated preferences, historical interaction summaries, and custom fields you define.Lifetime: Tied to the user record. Persists until the user record is deleted or memory is explicitly cleared for that user.When to rely on it: Use user memory in customer-facing agents where personalization matters. When a user returns after weeks away, the agent greets them by name, remembers their preferences, and picks up where the last conversation left off.User memory requires a user_id to be passed in the trigger payload or set via the API so Layest knows which user record to read from and write to.

Enable memory for an agent

1

Open the agent editor

Navigate to Agents, select the agent, and click the Memory tab.
2

Enable the memory types you need

Toggle on Long-term Memory, User Memory, or both. Short-term memory is always active and has no toggle.
3

Write a memory instruction (optional but recommended)

In the Memory Instruction field, describe what the agent should remember. For example:
4

Set the retention window

Under Retention, choose how long stored memories should be kept before automatic expiry: 30 days, 90 days, 1 year, or indefinitely.
5

Save the agent

Click Save. Memory takes effect on the next run.

View and manage stored memory

To inspect or edit what your agent has stored:
  1. Go to Agents and open the agent.
  2. Click Memory → Stored Memories.
  3. Browse the list of memory entries. Each entry shows its scope (long-term or user), the creation timestamp, and the stored content.
  4. Click any entry to view its full content, edit the text, or delete it.
You can also bulk-delete memories by selecting multiple entries and clicking Delete Selected. This is useful when testing and you want to reset the agent’s knowledge to a clean state.

Memory privacy and data retention settings

Memory stores real information about real users. Before enabling user memory or long-term memory in a production agent, review your organization’s data privacy policies and any applicable regulations (such as GDPR or CCPA). Users have the right to request deletion of their stored data—use the Clear User Memory action in the user record to honor those requests promptly.
Layest gives you the following controls to manage memory responsibly:
  • Retention window – Automatically expire memories after a set period. Expired memories are permanently deleted and cannot be recovered.
  • Memory instruction guardrails – Instruct the agent in its memory instruction never to store specified categories of information (passwords, financial data, health records).
  • Manual deletion – Delete individual entries or all memories for a specific user at any time from the Stored Memories view.
  • Audit log – Every memory write and delete is recorded in the workspace audit log, including which run triggered the write.
  • Data residency – Long-term and user memory are stored in the same region as your Layest workspace. Contact your account team if you have specific data residency requirements.