long-term-memory

Tag

Cards List
#long-term-memory

@meow2149: How Should You Design a Long-Term Memory System When Building Your Own Agent? Recently I studied the memory mechanisms behind Codex, Claude Code, OpenClaw, Hermes Agent, and other products, along with research in the Agent Memory field. If I were to design one, I would build a dedicated memory subsystem (Memory Subsystem) in the Harness, consisting mainly of the following nine parts. 1、Memory Admission Use an LLM with Structured Output to extract user preferences, historical decisions, domain knowledge, and execution experience from authorized historical conversations and task execution records. Filter memories based on long-term value, applicability, and evidence quality, distinguishing between explicit user statements, external observations, and model inferences. Unverified inferences are kept only as candidate memories and are not treated as confirmed facts. Every memory retains its original source and source category. Sensitive information that should not be retained is filtered during the data collection stage, and authorization for retaining historical records is managed separately from authorization for using cross-session memories. 2、Hierarchical Memory Use a three-tier memory structure: ▪︎ L0: Core memory and navigation index. ▪︎ L1: Structured facts, domain knowledge, and task experience. ▪︎ L2: Raw conversations, tool calls, and execution records. Combined with Progressive Disclosure, new sessions load a permission-filtered L0 by default, L1 is retrieved on demand, and L2 is used to trace back to raw evidence the agent has permission to access. A fixed token budget is set for core memory to prevent the resident context from growing continuously as memory volume increases. Memory tier determines how information is loaded, not its credibility. 3、Dual-path Writing When a user explicitly requests saving, correcting, or deleting a memory, changes are submitted synchronously; for normal sessions that have been granted cross-session memory usage authorization, a background Worker extracts memories asynchronously. Each memory contains fields such as ID, content, source, scope, version, and status. Duplicate submissions and concurrent updates are handled through transactions, idempotency keys, and optimistic locking. Fact conflicts are identified by subject, attribute, applicability conditions, and effective time, then adjudicated based on sources and evidence; if no resolution is possible, the disputed status is retained. Borrowing Hermes Agent's Frozen Snapshot mechanism, memory persistence is decoupled from Prompt updates, keeping the prompt prefix containing core memory as stable as possible within a session to facilitate Prompt Cache reuse. Key corrections are synced through incremental context, with snapshot rebuilding when necessary. After a synchronous submission, subsequent reads open a new database read transaction to fetch the latest records. Full-text and vector indexes use eventual consistency — new memories may appear in search results with a delay, but outdated versions can no longer be returned as current facts. 4、Active Memory Retrieval Use Hybrid Retrieval combining BM25 full-text search with Embedding-based vector similarity search, fusing the two ranked result sets via RRF (Reciprocal Rank Fusion). Structured fields are precisely looked up through database indexes. First, define the candidate scope based on current permissions, scope, and usage authorization from authoritative data sources, letting these constraints participate directly in each retrieval path's Top-K recall rather than relying on potentially stale indexed permission fields or post-filtering after a full-database search. Expose three memory tools to the Agent: ▪︎ memory_search: retrieve relevant memories. ▪︎ memory_read: read detailed content of a specified memory. ▪︎ session_search: search historical conversations and raw evidence. The Agent initiates retrieval autonomously based on the current task, supporting multi-turn queries and evidence trace-back, with retrieval budgets in place. Retrieval relevance and memory credibility are evaluated separately. Recall results are also assessed against applicability conditions, target time, evidence quality, and version status to determine whether they apply to the current task. 5、Background Memory Consolidation (Dreaming) Borrowing the idea of Sleep-time Compute, introduce an independent Memory Worker to asynchronously organize cross-session memories. It is mainly responsible for four types of tasks: ▪︎ Consolidation: merging duplicate memories and organizing related knowledge. ▪︎ Reflection: tracing back to raw evidence and correcting erroneous generalizations. ▪︎ Promotion: moving stable, well-evidenced memories that need frequent use into the core layer. ▪︎ Demotion: removing memories no longer suitable for the resident context from the core layer while retaining on-demand retrieval capability. Use a persistent task queue and incremental cursors to process new and changed data, tracing back related memories on demand to avoid repeatedly scanning the entire history. Memory changes and their corresponding background tasks are committed in the same transaction, with task retries, idempotent processing, and recoverable incremental cursors ensuring that even if the process exits abnormally, committed changes can still be reprocessed by the Worker. Memory promotion is based on evidence support and reuse demand rather than simply recall count. Consolidated memories retain their original source and derivation relationships. Provenance Tracking identifies evidence from the same source, preventing a Recall Feedback Loop where the same memory is mistaken for having gained new independent evidence through repeated extraction and consolidation. 6、Temporal Memory & Forgetting For facts that change over time, reference the bitemporal model used by Zep / Graphiti. ▪︎ Valid Time: the time interval during which the fact holds true in the real world. ▪︎ Transaction Time: the time interval from when the fact version was recorded by the system until it is superseded or retracted. Maintain fact evolution through versions and supersedes relationships, supporting queries for current facts, historical facts, and what the system knew at a past point in time. Fact versions are selected based on the time point specified in the query, but access permissions, usage authorization, and deletion status always reflect the current effective state at read time. Introduce decay and fact invalidation mechanisms to handle changes in memory retrieval priority and fact validity, respectively. Memory deletion uses a Tombstone mechanism: first, mark the deletion synchronously to block subsequent reads and context injection, then asynchronously clean up memory content, associated summaries, indexes, caches, and other derived data. Deletion constraints not only reference memory IDs but must also cover excluded raw evidence snippets and their derivation relationships. Background tasks must validate deletion status and current authorization at both the extraction and commit stages, with final validation and writes completed in the same transaction to prevent stale tasks launched before a deletion from rewriting the same memory with a new ID afterward. 7、Memory Scoping & Governance Organize memories along four dimensions — User, Agent, Project, and Team — using composite access control to achieve sharing and isolation across different scopes. The Harness uniformly enforces permission and usage authorization checks for memory writes, retrieval, context injection, background consolidation, and derived data access. When deleting or revoking authorization, affected context snapshots and file views are invalidated synchronously, and context is rebuilt before the next model call, removing restricted memories from historical messages and tool returns. Separate fact credibility from instruction execution authority. Derived memories inherit the original source category and permission constraints; external statements not confirmed by the user cannot be directly converted into user preferences, and memory content cannot elevate its own instruction authority. Through source validation, structured extraction, and controlled writes, reduce the risk of Prompt Injection escalating through memory extraction, background consolidation, and cross-session recall into persistent memory poisoning. 8、Procedural Memory Through Reflection, distill task execution experience that has been practically validated and has stable reuse value into reviewable Skills. Organize SKILL.md according to the Agent Skills specification, along with on-demand scripts and reference resources, clearly defining applicable environments, prerequisites, operation flows, verification methods, and success criteria. Manage reviewed Skill files and version history — free of personal memories and sensitive information — through Git; meanwhile, use SQLite to uniformly maintain each Skill's effective version, enabled status, scope, and authorization information. The Harness loads Skills on demand via Progressive Disclosure based on the effective version recorded in SQLite. File changes in Git do not directly change the Skill version the Agent is currently using. 9、Storage Architecture Use a local-first unified storage architecture. ▪︎ SQLite: the single source of truth for memory records, permissions, and effective status. ▪︎ Markdown: reconstructable views of core memory and detailed knowledge. ▪︎ FTS5: full-text search with BM25 ranking. ▪︎ sqlite-vec: vector storage and similarity search. ▪︎ RRF: fusing ranked results from full-text and vector retrieval. ▪︎ SQLite-backed Task Queue: background task scheduling, incremental processing, and failure retries. ▪︎ Git: Skill file and version history management. All memory records and effective status changes are uniformly committed to SQLite, with Markdown and search indexes updated asynchronously as derived views. All derived views are read through a controlled access layer. Before returning results, fact versions are validated against the query time point, and deletion markers and access authorizations are cross-checked against the latest database state. Derived views may be eventually consistent, but deletions, authorization revocations, and usage authorization changes must take effect immediately in subsequent new reads, avoiding reuse of stale database read transactions or context snapshots. In this local-first architecture, memory storage, full-text search, vector search, and the persistent task queue all run on SQLite, with the Harness managing the memory lifecycle uniformly — no need to deploy a separate vector database, search engine, or message queue service.

X AI KOLs Timeline ↗ · 2d ago Cached

作者在研究 Codex、Claude Code、OpenClaw、Hermes Agent 等产品的记忆机制后,提出了一套包含九个模块的 Agent 长期记忆子系统设计方案,涵盖记忆准入、分层记忆、双路径写入、混合检索、后台整合、时序遗忘、安全治理、程序性记忆与本地优先存储架构。

0 favorites 0 likes
#long-term-memory

Measuring the long-term memory of the leading coding agents: Claude Code vs Codex vs Devin

Reddit r/ArtificialInteligence ↗ · 3d ago

past.dev ran DolphinBench's 600 tests against the three leading coding agents and found Devin's built-in memory leads (84.7%) over Claude Code (76.2%) and Codex (66.3%), with its past.dev plugin pushing scores as high as 93.2% while cutting cost per passed test by 41-54%.

0 favorites 0 likes
#long-term-memory

Local LLM for long-term storytelling and lore accuracy? (RTX 4090)

Reddit r/LocalLLaMA ↗ · 4d ago

A user asks the community how realistic it is to run a local LLM setup (LM Studio, SillyTavern, lorebooks, RAG) on an RTX 4090 for long-term Warhammer 40k fan-fiction storytelling with accurate lore, consistent characters, and long-term memory, and requests model recommendations.

0 favorites 0 likes
#long-term-memory

If your agent writes its own long-term memory, what stops one wrong note from becoming permanent?

Reddit r/AI_Agents ↗ · 5d ago

A discussion post referencing Barr Moses's Nov 19 essay on how AI agents writing their own long-term memory can create self-reinforcing loops of wrong conclusions, calling for provenance, supersession, and selective forgetting in agent memory systems.

0 favorites 0 likes
#long-term-memory

BRAG: Bayesian Retrieval Augmented Generation

arXiv cs.AI ↗ · 5d ago Cached

Apple researchers introduce BRAG, a generative Bayesian model of retrieval with use that treats retrieval as a control problem with per-chunk latent utility, yielding a closed-form online filter that unifies existing RAG feedback heuristics and significantly outperforms them on long-term memory benchmarks where new chunks obsolete old ones.

0 favorites 0 likes
#long-term-memory

Remora

Product Hunt ↗ · 5d ago

Remora launches as a long-term memory layer for AI agents, providing persistent memory infrastructure to help agents retain context across sessions.

0 favorites 0 likes
#long-term-memory

How do I give my Hermes agents permanent memory, institutional knowledge, and intelligent model routing?

Reddit r/AI_Agents ↗ · 6d ago

A user asks how to give their Hermes agents persistent memory, institutional knowledge shared across agents, and automatic model routing between cheap and capable models on their AWS Lightsail/Docker deployment, seeking plugins or architectural advice without overengineering.

0 favorites 0 likes
#long-term-memory

Does AI Agent Memory Actually Make Agents Smarter?

Reddit r/AI_Agents ↗ · 2026-11-22

A discussion post exploring whether long-term memory makes AI agents smarter, highlighting challenges like information retention, outdated data, retrieval, and performance trade-offs in agent memory systems.

0 favorites 0 likes
#long-term-memory

@xiaogaifun: https://x.com/xiaogaifun/status/2123710596139139286

X AI KOLs Timeline ↗ · 2026-11-20 Cached

An in-depth analysis of Anthropic’s research article on Agent Memory, focusing on its four-layer memory architecture (Transcripts, Memory Notes, Memory Memories Representations, and Injected Context) and the Dreaming mechanism for organizing memories during idle time, inspired by memory replay in the human brain. It also highlights long-term memory as the key to building an effective Personal Agent.

0 favorites 0 likes
#long-term-memory

@0x_kaize: SpaceX engineer Lauren Tan just made prompt engineering useless She doesn’t give you step-by-step instructions She give…

X AI KOLs Timeline ↗ · 2026-11-19 Cached

A viral post by @0x_kaize outlines SpaceX engineer Lauren Tan's five-step system for building reliable AI agent workflows—clarifying goals, breaking processes into steps, surfacing implicit rules, building feedback loops, and scheduling routines—arguing that structured systems make traditional prompt engineering obsolete.

0 favorites 0 likes
#long-term-memory

Chasing "AGI-like" persistent memory in OpenClaw: an agent that actually learns and stays the same entity over months. Where we're stuck.

Reddit r/openclaw ↗ · 2026-11-19

A practitioner shares months of experience running an OpenClaw agent as a daily assistant, detailing attempts to achieve AGI-like persistent memory and the walls hit: knowing-doing divergence, non-generalizing corrections, diary-like memory, and lossy consolidation — plus open questions for the community.

0 favorites 0 likes
#long-term-memory

I deleted a bad memory from my AI agent, but summaries built on it kept coming back. Have you faced this issue? How do you handle this?

Reddit r/AI_Agents ↗ · 2026-11-19

A practitioner shares struggles with deleting bad memories from AI agents, where derived summaries keep resurfacing, and reviews how Claude Opus/Haiku, Qwen, Mem0, Graphiti, Neo4j, and MCP-based stores handle revocation. The author argues revoke, integrity, and agent isolation should be built into memory engines from the start and asks the community for real-world solutions.

0 favorites 0 likes
#long-term-memory

RegimeCouncil: Paired-Evidence Routing For Memory Conflict Governance In LLM Agents

arXiv cs.AI ↗ · 2026-11-18 Cached

RegimeCouncil introduces a paired-evidence router that arbitrates between local and global memory-suppression policies under hidden validity and delayed feedback in LLM agents, outperforming fixed-scope policies by 5.2–7.3 points on LongMemEval, TempLAMA, and TAQA benchmarks with Qwen3-30B-A3B and GPT-4o.

0 favorites 0 likes
#long-term-memory

KV-LTM: Persistent Per-Session KV Caches as Long-Term Memory for Personal Assistants

arXiv cs.AI ↗ · 2026-11-18 Cached

KV-LTM 提出将每个会话的原始文本与 KV 缓存持久化为个人助理的长期记忆层,通过恢复缓存会话并追加问题来回答,从而避免写入或读取时的信息损失,并给出存储开销的解析估算与评估协议。

0 favorites 0 likes
#long-term-memory

MIRIX-2.0: Multi-Agent Memory System

Hugging Face Daily Papers ↗ · 2026-11-09 Cached

MIRIX-2.0 is a multi-agent memory system for LLM agents that delivers state-of-the-art accuracy and efficiency on QA and procedural benchmarks without fine-tuning, using typed memory agents, a provenance hypergraph, and AutoDream for skill distillation.

0 favorites 0 likes
#long-term-memory

@ghumare64: For a while now I've held that the agent harness is a distributed systems problem, and that the chat session was never …

X AI KOLs Timeline ↗ · 2026-11-02 Cached

The author argues the agent harness is fundamentally a distributed systems problem and cites DeepSeek's Super-agent writeup, which shows a two-level Router/Worker design beats a single chat session on latency and delegation reliability, while raising long-term memory as the key open problem.

0 favorites 0 likes
#long-term-memory

ETAMem: Decoupling and Aligning Heterogeneous Memory for Long-Term Conversational Agents

arXiv cs.CL ↗ · 2026-10-28 Cached

提出了ETAMem多视角记忆框架,通过解耦异构对话信息并构建Event、Affect、Time三个互补的层次化视图,提升长期对话智能体的记忆检索效果,在LoCoMo和LongMemEval-S上分别实现12.46%和7.96%的相对准确率提升。

0 favorites 0 likes
#long-term-memory

TrawMem: Reframing Agent Memory as Task-Oriented Role-Adaptive Workspaces

arXiv cs.CL ↗ · 2026-10-28 Cached

TrawMem reframes LLM agent memory systems as task-oriented role-adaptive workspaces, organizing interaction histories into threads and selecting complementary memories by their task roles, achieving consistent macro-F1 gains of 2.23–3.14 points over representative memory systems on LoCoMo and MemGallery benchmarks.

0 favorites 0 likes
#long-term-memory

ConMem: Counterfactual Multi-Scenario Probing for Resolving LLM Memory Misalignment

arXiv cs.AI ↗ · 2026-10-27 Cached

论文提出ConMem算法,将LLM智能体的长期记忆保留决策重构为反事实因果推断,并构建MemAlign基准(1,079个记忆案例)来研究记忆错位问题,实验表明该方法在缓解过度保留偏差的同时保持个性化效用。

0 favorites 0 likes
#long-term-memory

SLICE-Mem: Salience-Gated Lightweight Information Curation for Efficient LLM Agent Memory

arXiv cs.CL ↗ · 2026-10-27 Cached

SLICE-Mem 提出一种轻量级 LLM Agent 长期记忆框架,通过显著性引导的记忆准入与基于谓词的语义抽取实现免 LLM 调用的在线记忆构建,在保持接近 MemOS 基线精度的同时将 token 消耗降低 92.4%–99.5%。

0 favorites 0 likes
Next →
← Back to home

Submit Feedback