I kept losing agent memory between sessions, so I built a memory broker that isolates per-agent and survives restarts

Reddit r/AI_Agents Tools

Summary

The author built HeurChain, a memory broker that provides agent-specific, persistent memory storage for AI agents, surviving restarts and supporting structured and semantic retrieval.

Every time I restarted my agent or spun up a new session, the context was gone. No recall of previous conversations, no learned preferences, no project state. Just... blank. So I built HeurChain — a memory broker that sits between your agents and long-term storage. What it does: Agent-isolated memory — each agent gets its own namespace. Agent A can't see Agent B's memory., Survives restarts — memory persists to disk/DB. Kill the process, restart, memory is still there., LLM-agnostic — works with Claude, GPT, local models. The broker handles the storage layer., Structured + semantic — stores both key-value facts and vector embeddings. Query by key or by meaning., The architecture is pretty simple: agents write to the broker via a thin client library. The broker handles deduplication, compression, and persistence. On restart, agents request their memory back. What I learned: Most memory systems are either per-session (context window) or global (shared RAG). The middle ground — agent-specific persistence — is underserved., Deduplication is tricky when agents rephrase the same fact differently. I use both hash-based matching and semantic similarity., Local model users want local-only. The broker can run entirely on-prem., Would love feedback from anyone who's built agent memory systems. What tradeoffs did you hit?
Original Article

Similar Articles

rohitg00/agentmemory

GitHub Trending (daily)

agentmemory is an open-source persistent memory layer for AI coding agents (Claude Code, Cursor, Gemini CLI, Codex CLI, etc.) that uses knowledge graphs, confidence scoring, and hybrid search to give agents long-term memory across sessions via MCP, hooks, or REST API. Built on the iii engine, it requires no external databases and exposes 51 MCP tools.

How AI agent memory works (28 minute read)

TLDR AI

The article provides a comprehensive technical overview of how AI agent memory works, distinguishing between working and long-term memory mechanisms, and discussing strategies for context management, embedding-based retrieval, and data lifecycle governance.