TypedMemory: Persistent Memory and Reflection for AI Agents
TypedMem is a long-term memory library for AI agents that structures and filters memories with types, avoiding the noise typical of vector-based solutions.
One of the most persistent problems when building AI agents with persistent memory isn't storing information: it's knowing what to forget. Most current solutions dump text into vector databases and let semantic similarity decide what to retrieve, with results that can be imprecise or outright irrelevant depending on context. TypedMem, released this week on GitHub and featured on Hacker News, proposes a different approach: structure memories with explicit types and add a reflection mechanism that allows the agent to consolidate, discard, or update what it has stored.
The project is in an early stage, with limited activity and few comments on HN at the time of publication, but the technical proposal deserves attention, especially for those working with Claude Code and its subagent and skill capabilities.
What TypedMem actually does
Instead of treating memory as a continuous stream of text, TypedMem defines typed categories: facts about the user, preferences, past events, pending tasks, conclusions from previous sessions. Each category has its own schema, which enables more precise searches and prevents a memory of type "format preference" from contaminating a query about "decisions made on project X".
The second pillar is periodic reflection: the agent can execute a consolidation step where it reviews its accumulated memory, detects contradictions, groups redundant entries, and updates the status of memories that have become obsolete. This pattern isn't new in research (it appears in work like MemGPT and similar), but TypedMem implements it as an independent Python library, without tying it to any model provider or specific framework.
Why it matters in the context of Claude Code
Those of us using Claude Code to build custom agents quickly hit the same ceiling: Claude Opus 4.7's context window, while reaching a million tokens, isn't the right solution for persistent memory between sessions. Putting the entire history in context is expensive, slow, and above a certain volume, counterproductive.
Claude Code hooks, especially the `Stop` and `PostToolUse` events, allow execution of external logic when a session ends or after each tool call. TypedMem fits well in that gap: it could be invoked from a `Stop` hook to save a typed summary of the session, and from a retrieval skill to inject relevant context at the start of the next one. It's not an official or documented integration yet, but the architecture makes it feasible with minimal glue code.
Similarly, in environments with custom MCP servers, TypedMem could be exposed as a memory tool accessible from any agent connected to the same server, allowing different subagents to share and update the same typed memory store.
Who it's useful for right now
In its current state, TypedMem is more of a starting point than a production-ready solution. It's useful for:
- Teams designing the memory layer of their own agent and wanting a structured foundation rather than starting from scratch with a vector store.
- Developers working with Claude Code who need persistence between sessions without relying on third-party solutions like Mem0 or Zep.
- Researchers or enthusiasts who want to explore the reflection pattern in an open-source context with minimal dependencies.
Our take
The typed approach to agent memory is sensible and points in the right direction: explicit structure usually beats blind semantic search when the domain is bounded. It's worth following the repository's evolution, though for now it's best treated as technical inspiration rather than a production dependency.
Sources
Read next
MCP is becoming the default standard for building agents
HackerNoon argues the Model Context Protocol is now the default starting point for any agent. We look at what changes in practice, why it matters and who benefits.
AI Toolbox touts support for a Claude Opus version not in the catalog
A Show HN presents AI Toolbox claiming support for a Claude Opus version missing from Anthropic's public catalog. Why it pays to verify the model list of any third party tool.
One Click in the Browser, Context for Any Agent
A VS Code extension borrows Copilot's trick of picking web page elements and pasting them into any AI chat. What it solves and what it leaves out.