apache / apache/maka

Title: feat(memory): add an automatic long-term memory lifecycle

Open
#1,615 13 comments 0 reactions 1 assignee Claimed by @YayoiNanoka View on GitHub
enhancement
Dominant language
TypeScript
Stars
5.4k
Forks
502
Avg merge
1d 2h
Merged PRs (30d)
715

Description

## Problem

Maka currently provides a local `MEMORY.md` / `PENDING.md` workflow for storing and injecting approved memory entries.

This provides basic persistent memory, but it still requires explicit maintenance and does not form a complete long-term memory lifecycle. In particular, Maka cannot yet automatically:

- extract durable information from completed sessions;
- consolidate related information across sessions;
- recall more detailed memory when `MEMORY.md` is insufficient;
- collect feedback about whether recalled memory was useful or incorrect;
- correct or forget outdated memory at a sufficiently fine granularity.

Treating an entire session as the smallest memory unit would also be too coarse. A session may contain several independent memory points, and invalidating one point should not remove everything learned from that session.

## Desired outcome

Maka should have an automatic background memory pipeline that:

- extracts durable information from eligible sessions;
- stores independently manageable memory points;
- maintains `MEMORY.md` and `memory_summary.md`;
- supports keyword-based recall;
- records recall feedback;
- corrects or forgets individual memory points without deleting unrelated memories;
- keeps existing `RuntimeEvent` data as the original evidence source.

The first implementation should focus on the memory lifecycle itself. Embedding-based or vector retrieval can be considered separately.

## Alternatives or workarounds

The existing `MEMORY.md` / `PENDING.md` workflow can continue to support manually reviewed memory entries, but it requires explicit user maintenance and does not provide automatic extraction, consolidation, feedback, or forgetting.

中文翻译

## 问题

Maka 当前提供了基于 `MEMORY.md` 和 `PENDING.md` 的本地记忆流程,用于保存并注入经过批准的记忆。

这已经提供了基础的持久化记忆能力,但仍然需要显式维护,尚未形成完整的长期记忆生命周期。Maka 目前还不能自动完成:

- 从已结束的 Session 中提取具有长期价值的信息;
- 跨 Session 整理和合并相关信息;
- 当 `MEMORY.md` 信息不足时读取更详细的记忆;
- 记录召回的记忆是否有用或存在错误;
- 以足够细的粒度修正或遗忘过时记忆。

如果把整个 Session 作为最小记忆单位,粒度也会过粗。一个 Session 可能包含多个独立记忆点,其中一条失效时,不应该删除这个 Session 中的所有记忆。

## 期望结果

Maka 应当具有自动运行的后台记忆流程,能够:

- 从符合条件的 Session 中提取长期信息;
- 保存可以独立管理的记忆点;
- 维护 `MEMORY.md` 和 `memory_summary.md`;
- 支持关键词召回;
- 记录记忆使用反馈;
- 独立修正或遗忘某个记忆点;
- 保留现有 `RuntimeEvent` 作为原始证据来源。

第一版应优先实现完整的记忆生命周期。Embedding 或向量检索可以作为独立功能后续考虑。

## 替代方案或临时做法

当前 `MEMORY.md` / `PENDING.md` 流程仍然可以支持人工审核的记忆,但需要用户显式维护,也不能自动完成提取、整理、反馈和遗忘。

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.