Zing 论坛

正文

GoodMemory:为 AI 应用打造可插拔的用户记忆层

GoodMemory 是一个面向 AI 应用的可插拔用户记忆层,解决如何让 AI 真正"记住用户"的问题。它不替代 LLM、向量数据库或 RAG 系统,而是专注于记忆的生命周期管理:记什么、何时更新、如何检索、如何压缩、为什么引用、如何删除。

AI记忆Memory LayerLLMAgent上下文管理RAG用户记忆
发布时间 2026/04/12 12:44最近活动 2026/04/12 12:48预计阅读 7 分钟
GoodMemory:为 AI 应用打造可插拔的用户记忆层
1

章节 01

GoodMemory: A Pluggable User Memory Layer for AI Applications (导读/主楼)

GoodMemory is a pluggable user memory layer designed for AI applications, addressing the problem of how AI can truly 'remember users'. It does not replace LLMs, vector databases, or RAG systems; instead, it focuses on memory lifecycle management: what to remember, when to update, how to retrieve, how to compress, why to cite, and how to delete. Its goal is to enable any chatbox, copilot, agent, or workflow assistant to remember users without retraining the underlying model.

2

章节 02

Background: The Memory Dilemma of AI

Current large language models (LLMs) excel in reasoning and generation but lack true 'memory'—each conversation starts fresh, and they cannot recall user preferences, historical context, or long-term interaction patterns. While RAG and vector databases can supplement context, they only solve the 'what to retrieve' problem and ignore memory lifecycle management. This gap led to the creation of GoodMemory, a dedicated user memory layer for AI applications.

3

章节 03

Positioning & Core Focus of GoodMemory

GoodMemory is designed to complement existing tech stacks rather than replace components like LLMs, agent frameworks, vector databases, or RAG systems. It acts as a Personal Context Engine, focusing on memory lifecycle management by answering six key questions: 1) What to remember? 2) When to update? 3) How to retrieve? 4) How to compress? 5) Why to cite? 6) How to delete? It also controls memory boundaries across agents, projects, and tenants to ensure proper scope.

4

章节 04

Core API Design: Five Closed-Loop Operations

GoodMemory's API围绕 memory lifecycle includes five core operations:

  1. remember(): Stores key information with scopes like user ID or session ID.
  2. recall(): Retrieves relevant memory based on queries and retrieval profiles (e.g., general chat, code assistant).
  3. buildContext(): Converts recalled memory into LLM-friendly formats (e.g., Markdown) with compression and priority sorting.
  4. feedback(): Optimizes retrieval quality via feedback on useful memories.
  5. forget(): Manages memory deletion via policies (expiration, user request, or relevance-based cleanup).
5

章节 05

Memory Classification & Architecture

GoodMemory classifies memory into four types based on cognitive science:

  1. Semantic Memory: Facts/concepts (e.g., user's profession, interests).
  2. Episodic Memory: Specific events (e.g., past conversations, completed tasks).
  3. Procedural Memory: 'How-to' knowledge (e.g., user's preferred workflows).
  4. Runtime Memory: Temporary context in current sessions (e.g., ongoing task status). Different storage, retrieval, and compression strategies are applied to each type.
6

章节 06

Evaluation & Observability

GoodMemory includes built-in evaluation tools: Persona datasets (real user profiles), replay fixtures (reproducible test scenarios), A/B comparisons (baseline vs GoodMemory), and structured outputs (for manual/automated assessment). CLI tools are available for:

  • Inspecting runs: bun run cli -- inspect --run-dir reports/eval/live/<run-id> --case-id <case-id>
  • Tracing: bun run cli -- trace --run-dir reports/eval/live/<run-id> --case-id <case-id>
  • Exporting data: bun run cli -- export --run-dir reports/eval/live/<run-id> --case-id <case-id> --output /tmp/case.json
7

章节 07

Application Scenarios

GoodMemory provides out-of-the-box memory capabilities for AI apps without building complex systems from scratch. Key scenarios include:

  • Personal assistants (remember preferences/long-term goals)
  • Code assistants (remember project structure/development habits)
  • Customer service (remember historical issues/solutions)
  • Workflow automation (remember cross-session task states). Developers can integrate it without modifying existing architectures.
8

章节 08

Summary & Future Outlook

GoodMemory proposes a layered approach: instead of making LLMs larger to hold more context, build an intelligent memory management system at the application layer. This approach offers advantages: model-agnostic (works with any LLM), scenario-customizable (tailored memory strategies), observable/evaluable (full tools for assessment), and privacy-controllable (fine-grained scope management). As AI shifts from one-time conversations to long-term companionship, user memory will become a core capability—GoodMemory provides a practical,落地 solution for this trend.