Developer Reports Recursive Memory in Pure-Python Observer-RAG
In a 掘金·人工智能 first-person post, a developer describes and open-sources Observer-RAG, a compact local RAG implementation using pure Python, apsw, sqlite-vec, and a local BGE-M3 model. The developer reports that a retrieved chunk containing a preserved citation tag led the model to reference a different memory chunk that was not included in that round’s retrieval set. The “emergent recursive memory” explanation remains an unreplicated personal observation rather than a validated result.
Observer-RAG provides a compact reference implementation for testing locally stored personal memory, while its citation-chain behavior offers an intriguing case to examine in RAG architecture research.
大家好,我是一名非计算机专业的大一学生。平时对 AI 比较感兴趣,因为受够了市面上一些臃肿的黑盒 RAG 软件,决定自己动手用纯 Python 从零手搓一套完全本地化的系统。
我的目标是构建一个纯粹的个人记忆库。目前库里存了大概 60 万字的日常随笔与思考。为了极简和隐私,我没有用任何第三方 AI 框架,所有依赖锁死。
先简单汇报一下我的架构设计:
• 存储:用 apsw 绕开系统阉割,采用 sqlite-vec 做单文件单库,绝对私有。
• 性能:手搓 JSON 倒排索引解决中文分词死穴,用 O(1) 查表实现极速降噪;设计了定期后台静默重算机制,防并发不卡顿。
• 时间感知:每次对话时,强行将当前真实的系统时间(精确到时分)注入到 Prompt 的最前端,并在底层用 XML 标签进行严格的物理隔离(区分“历史语料”与“当前提问”),防止大模型时空错乱。