{
  "$type": "site.standard.document",
  "canonicalUrl": "https://rickymoorhouse.uk/blog/drafts/2026-04-25-agent-memory",
  "path": "/blog/drafts/2026-04-25-agent-memory",
  "publishedAt": "2026-04-25T00:00:00.000Z",
  "site": "at://did:plc:r53zv4vpzeihop3aliwyejlu/site.standard.publication/3mos5q3a7jf2w",
  "tags": [
    "ai",
    "architecture"
  ],
  "textContent": "I've continued to build on my experiment into agent building and the next thing I decided to look at is a system for memory.  The initial version used local markdown files but as I was exploring I decided that I wanted them to be more structured. This allows me to store metadata along with the memory as well to assist in retrieval algorithms. \n\nHaving called the agent Crow, it got me thinking about how crows and other corvids remember, so used this as inspiration for the memory tooling. The key areas of influence are:\n\n- Episodic Context (\"What, Where, When\") - Memories without context on who created them and in what situation are harder to retrieve reliably. This enables memories to be distinguished by source - identifying those from the internal system logic and those specifically stored by the agents decision.\n\n- Access Tracking & Retrieval Reinforcement - Caches that are successfully retrieved become stronger in memory. Rarely-retrieved caches are forgotten. This was added through access counts and last accessed time added to the memories so can use this in prioritisation in the retreival algorithm.\n\n- Decay-Weighted Ranking - Memory strength decays with time unless reinforced. A memory 9 months old with no retrieval is much weaker than a fresh one. This was also built into the retreival prioritisation so that a high-priority memory that hasn't been accessed in months naturally sinks below a medium-priority one that's been retrieved repeatedly.\n\n- Perishability-Aware Surfacing - Crows retrieve perishable food first, independent of priority. Storing expiry times for memories means that items that will no longer be useful after a particular time or are more urgent can be retrieved easily until they expire.  This means that when the agent is working proactively it can review urgent memories independently to see what if any action needs to be taken.\n\n- Supersession / Re-caching- When a crow is observed hiding a cache, it returns later to move it -- the old location becomes invalid, the new one is authoritative. Added link types for memories that supersede or contradict one another to build chains. \n\n- Semantic Search - Corvids use rich spatial cues for retrieval, not random guessing. Instead of just searching for substrings being present in the memory I added vector embedding and built semantic search to use them.\n\n- Chain traversal - This lets us return a chain of related memories starting from a given one, inspired by New Caledonian crow multi-step tool use — chaining known associations to reach novel conclusions.\n\n- Consolidation (deduplicate) - Sleep consolidation doesn't just store memories — it reorganises them. Redundant information is merged. Overlapping experiences are synthesised into generalised knowledge. The result is a cleaner, more useful knowledge store that supports flexible retrieval. This runs as part of the idle time of the agent so that it can improve it's memory store when not busy.\n\n- Source confidence - Observer credibility - Corvids don't treat all sources of competition (or information) as equivalent — they track specific individuals, remember past interactions, and weight their behaviour accordingly. Therefore information from a verified user instruction is more reliable than a web search snippet, and the system will track which sources tend to be contradicted or superseded over time.\n\n- Prospective retrieval - Prospective memory is memory stored for a specific future context, not just about the past. This enables us to trigger particular memories through context.\n\n- Category clustering - Corvids don't just remember individual instances — they extract abstract categories and rules from experience and apply them to novel situations. They generalise. \n\n- Merge/Summarize consolidation - A crow that finds an old cache next to a new one doesn't just discard the old — it reassesses both and re-caches the integrated knowledge in a better location. The agent memory system should do the same: when fragmented memories describe overlapping truths, synthesise them rather than just marking the weaker ones redundant.\n\n- Pagination, export, import - Nutcracker cache portability\n- Human browser UI - so I can see what is going on",
  "title": "Agent Memory - into the crows nest"
}