Agent Builder becomes more effective with use, thanks to its ability to memorize the feedback received. Every correction, preference expressed, and effective approach is stored and applied in subsequent interactions.
Memory is a key element that makes Agent Builder a collaborative tool. To make the most of this feature, it's important to understand how to communicate effectively with the agent. Here are three practical tips.
How memory works
Agent Builder is based on Deep Agents, an open-source LangChain framework for long-term autonomous tasks. The agent has access to an LLM for reasoning, tools for performing actions (web search, Slack, Google Sheets), the ability to generate sub-agents, and a filesystem.
Memory resides in the filesystem and is divided into two types:
- Short-term memory: Files created during a task, such as plans, tool call outputs (web search results), and progress. These exist for the duration of the conversation, but do not persist between different conversations.
- Long-term memory: Files saved to a persistent path (/memories/). These files are retained between conversations and contain the agent's core instructions and skills. Memory is stored in standard Markdown files.
Teach the agent to remember
During interaction with the agent, useful context is continuously generated. For example, you can define an effective format or refine the presentation of results. This context resides in short-term memory but can be transferred to long-term memory.
You can instruct the agent to save what it has learned with commands such as:
- "This approach worked well. Update your instructions to always use it in the future."
- "Remember that I prefer bullet points to long paragraphs."
- "Incorporate what you learned from this conversation into your memory."
The agent will update its long-term instructions based on the feedback received, just as a colleague would take notes after a productive work session. This results in fewer corrections and better results from the start.
Use skills for specialized contexts
Skills are a form of long-term memory, but with a fundamental difference: they are only loaded when the task requires it. It's like providing the agent with a reference library instead of making it memorize everything in advance. The agent sees the titles on the shelves and only picks up a book when it's relevant.
Having too much context is not always positive. An agent trying to memorize everything at once can lose focus on what matters for the current task, leading to inaccurate results.
You can ask the agent to create a skill at any time: "Create a skill for [topic] that includes [the context the agent needs]."
Directly edit the agent's memory
The agent's instructions and configuration files are accessible and directly editable. Agent Builder automatically updates its instructions based on feedback, but there are two valid reasons to consider direct editing:
- It helps you understand how the agent thinks. Reading the agent's instructions is like reviewing a colleague's project plan. You can see how the agent approaches the problem, what it prioritizes, and where its assumptions might not match your own. If something is wrong, such as an unnecessary step or a wrong assumption, you can correct it directly.
- Sometimes it's faster. If you want to change how often a scheduled task is run or edit a single line in the instructions, direct editing takes seconds. Asking the agent to make the change works, but for small, precise updates, editing the file yourself can be the quickest solution.
๐ฌ Comments (0)
๐ Log in or register to comment on articles.
No comments yet. Be the first to comment!