📄
markdown 就是数据库
每个分类一个文件,每个
纯 markdown 之上的 categories + wiki-links。不需要数据库、不需要 embedding 模型、不需要 docker —— pip install wikimem 即可使用。
from wikimem import MemoryIndex, MemoryStore
store = MemoryStore("memory/")
store.add("preferences", "likes-the-sea",
"喜欢海边,提到过想去海边玩。[[daily_life:beach-trip-plan]]",
owner="user:xnne", source_conv="conv_20260710")
store.add("daily_life", "beach-trip-plan", "计划夏天去海边旅行,看日出。")
index = MemoryIndex(store) # 内存 BM25,store 写入后自动重建
result = index.retrieve("想去海边玩", budget_tokens=800)
for entry in result.items:
# 命中条目按分数排序;每个命中后面跟着它一跳展开的 wiki-link 目标
print(entry.source, entry.item.name, entry.score)跑完之后磁盘上有什么?两个任何编辑器都能打开的 markdown 文件,加一份一行一条的 journal。整个系统就这些。