AI News HubLIVE
站内改写3 分钟阅读

待翻译:Use Dreams to create memories your AI agent can access

AI 服务暂时不可用,以下为来源摘要,待恢复后补全翻译:Jason Davenport Aug 12, 2026 Philip Dick wrote a short story titled ‘Do robots dream of electric sheep?’. I slightly changed this title for a talk I gave titled ‘Do agents dream of binary sheep?’. What is agentic memory…

来源Hacker News AI作者: davenportjw

AI 服务暂时不可用,以下为来源正文,待恢复后补全翻译。

Jason Davenport Aug 12, 2026 Philip Dick wrote a short story titled ‘Do robots dream of electric sheep?’. I slightly changed this title for a talk I gave titled ‘Do agents dream of binary sheep?’. What is agentic memory? There are different types of memory that an agent creates or has access to. These include short term or working memories (think of storing things in a session), and long term memories (things the agent learns about a task or a user over time). Both are important, but both also require different management methods. I talk about managing short term memory in a separate blog I’ll be publishing later this week. For long term memory, a critical component, like in humans, is the ability to reflect over a session and store the relevant information. In humans, this often happens in ‘dreams’ where our memory systems are reorganizing and compacting. Agent dreams are also this process of reflection to create memories about sessions and information that happened. Why does creating and using memory make an agent better? Agents without memory are only as good as the model and instructions we’ve given them. In many cases, agents see a similar problem many times, in particular for coding examples. Without understanding the prior sessions, agents will take a fresh approach to solving the problem, increasing non-determinism, and also maxing the amount of tokens used to solve the problem. Memory helps to provide agents context on specific problems or users that inform how an agent may decide to take a next action. For example, if an agent sees a specific problem multiple times, and has ‘dreamed’ and stored that there is a specific way to solve the problem, this can dramatically reduce the time to solve the problem and tokens. In addition, this helps reduce variability over time. The simplest adage I can give is for learning something like addition. In memories, you learn both methods and rote ways to accomplish work. We did so many addition tables growing up that you can solve 2+2 without thinking about the process of addition. But you also know how to add when the rote methods do not work. In dreams, we can use LLM prompts to give agents access to both sides of learning. How memory and RAG work well with agents In many cases, current dreaming or analysis scenarios focus on improving the agent’s code: that is the instructions, skills, and tools the agent has access to. This is highly valuable for many companies; I often say that if you aren’t harvesting every token your company is spending, you’re burning money. This is extreme but there is no way to improve agentic flows if you don’t have access to the session data. Another access method for dreams uses RAG (retrieval augmented generation). We can store information about an intent, a user, or a task in a database. Then, when an agent is given an intent, it can search using RAG to see if it has discovered the problem before, and get hints on demand. The simplest example is compaction about user information. For example, a user may always ask about Python questions. We can look up the information about the user, inject the Python preference, and get a better search result. We can also use dreams to understand common intents and even pre-seed code that might be relevant, or skill information for a specific function. Simple scenario I built a demonstration using dreams that uses Google ADK as the agent framework, Gemini (although you could pick any model) for inference, and then BigQuery and Cloud Spanner for the memory system. Cloud Run is used for agent deployments, and there are two: one with memory access, and one without. I’ve found that with vibe coding it makes it a lot easier to show demos on the frontend. If you deploy the code, you can follow the UI steps and see each stage much easier than clicking between panes. The memory system works like this: The agent framework logs all the telemetry about the agent sessions to BigQuery. We also call this a trajectory. We use AI functions (LLMs) to summarize information in a session or across sessions in BigQuery as an offline process to create memories. Memories are stored in Spanner as vectors. We may store the same memory with multiple vectors depending on the ways that the agent needs to access it. In the code example, the agent will ask you about your preferences for coding, and other things that you may typically prefer. The ‘dreaming’ takes this information and stores it in a schema that is accessible for Spanner. This pattern is a durable one. By modifying the prompt used for dreaming and the SQL, we could look across sessions for other attributes or preferences, and store them for retrieval, or even use the output to update our agent code. Get started Here’s the code that I created. You can deploy it today, and you can also use a simpler service than Spanner if you are looking to learn but keep your costs down. I’ve included step by step instructions in the UI deployed as a container to Cloud Run. Let me know your thoughts! Hope this is helpful as you build an agent dreaming and memory system for your own agents. How I used AI: All for code in this, the writing is 100% human errors. Generally with AI I’m very in the loop for a coding example like this, and provide pretty heavy direction in the flow for a 0 → 1 project. Share