Agent Memory
Give agents persistent memory that survives across conversations
Agent Memory lets your agents remember information across conversations. When enabled on a prompt step, the agent can save facts, recall past context, and manage its own knowledge — without any manual tool configuration.
How It Works
Memory operates on two layers:
- Auto-injection — The most recent memories are automatically included in the system prompt at the start of every execution. This gives the agent immediate awareness of what it knows.
- On-demand tools — The agent receives three built-in tools (
memory_write,memory_search,memory_delete) to actively manage its knowledge during conversations.
What the Agent Sees
When memory is enabled, the system prompt includes a block like this:
<agent_memory>
Your saved memories from previous conversations:
- [id] Customer prefers email [customer, communication]: Reached out via email twice, prefers async communication.
- [id] API rate limit [technical]: Production API is limited to 100 req/min.
Use memory_search to find older memories not shown here.
Use memory_write to save new important information.
Use memory_delete to remove outdated memories.
</agent_memory>The agent decides on its own when to save, search, or delete memories based on the conversation.
Enabling Memory
Memory is configured per prompt step in the agent workflow editor.
- Open the agent in Agent Studio
- Select a prompt step
- Expand the Memory accordion at the bottom of the config panel
- Check Enable memory
Settings
| Setting | Default | Description |
|---|---|---|
| Enable memory | Off | Toggles the entire memory feature for this step |
| Max memories in context | 10 | Number of recent memories auto-injected into the system prompt |
Memory is configured per step, not per agent. A research step might benefit from memory while a formatting step doesn't need it — saving tokens on steps where memory is irrelevant.
Built-in Tools
When memory is enabled, the platform automatically provides three tools to the agent. You don't need to add them manually.
memory_write
Saves a memory with a title and content. If a memory with the same title already exists, it gets updated (upsert).
| Parameter | Required | Description |
|---|---|---|
title | Yes | Short identifier, used as a unique key per agent |
content | Yes | The body of the memory — keep concise and factual |
tags | No | Comma-separated tags for categorization |
memory_search
Searches all saved memories by keyword across titles and content. Use this when the agent needs to recall information that may not be in the recent memories auto-injected into the prompt.
| Parameter | Required | Description |
|---|---|---|
query | Yes | Text to search for |
limit | No | Max results (default: 10, max: 50) |
memory_delete
Removes a memory by its ID. The agent uses this to clean up outdated or incorrect information.
| Parameter | Required | Description |
|---|---|---|
memory_id | Yes | The ID of the memory to delete |
Prompt Caching
Memory is designed to work well with LLM prompt caching (supported by Anthropic and OpenAI).
The auto-injected memory block is based on recency — the same N most recent memories appear in every request until a memory is written or deleted. This means the system prompt prefix stays stable across requests, maximizing cache hits.
The memory_search tool returns results as tool output, which doesn't affect the cached prompt prefix.
Managing Memories via API
Memories can also be managed through the REST API, for example to pre-populate an agent's knowledge or to build a memory management UI.
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /v1/tenants/{tenant}/agents/{agent}/memories | List memories (paginated, with optional ?query= filter) |
GET | /v1/tenants/{tenant}/agents/{agent}/memories/{memoryId} | Get a single memory |
POST | /v1/tenants/{tenant}/agents/{agent}/memories | Create a memory (409 if title already exists) |
PUT | /v1/tenants/{tenant}/agents/{agent}/memories/{memoryId} | Update a memory |
DELETE | /v1/tenants/{tenant}/agents/{agent}/memories/{memoryId} | Delete a memory |
Example: Create a Memory
curl -X POST \
https://api.fruxon.com/v1/tenants/{tenant}/agents/{agent}/memories \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"title": "Customer timezone",
"content": "Customer is based in UTC+9 (Tokyo). Schedule meetings accordingly.",
"tags": ["customer", "scheduling"]
}'The API POST endpoint uses strict create semantics — it returns 409 Conflict if a memory with the same title already exists. Use PUT to update existing memories. The agent's memory_write tool uses upsert semantics (create or update by title).
Best Practices
- Let the agent manage its own memory. The built-in tools are designed for the agent to decide what's worth remembering. You don't need to prompt-engineer memory management — the agent handles it naturally.
- Pre-populate for cold starts. Use the API to seed memories before the first conversation — for example, customer profiles, project context, or domain-specific facts.
- Keep memories concise. Each memory consumes tokens in the system prompt. Short, factual entries work better than long notes.
- Use tags for organization. Tags help when searching and make it easier to manage memories through the API.
- Enable memory only on steps that need it. A step that just formats output doesn't need access to memories. This saves tokens and keeps the prompt focused.
Next Steps
- Sessions — Conversation history that persists within a session
- Agent Studio — Visual workflow builder overview
- Creating Agents — Build your first agent