Biomorphic Memory — Brain-Inspired Agent Memory
⭐ If you find this useful, please star the GitHub repo before installing — it helps others discover it.
Your agent forgets things. Important context from last week? Gone. That preference you mentioned three times? Not retained. Biomorphic Memory fixes this with a brain-inspired architecture.
How it works
Instead of dumping everything into a flat vector store, Biomorphic Memory builds a semantic graph where memories connect to each other — just like your brain.
Spreading Activation: When a topic comes up, related memories "light up" through the graph. Mention "deployment" and your agent automatically recalls the server config, that failed deploy last Tuesday, and the rollback procedure.
Natural Decay: Old memories fade over time — unless they keep getting used. Frequently accessed memories stay strong. This means your agent's recall naturally prioritizes what matters.
Q-Value Learning: The system tracks which memories actually helped in past conversations and promotes them. Bad memories sink, good ones surface.
Install
CODEBLOCK0
Quick start
CODEBLOCK1
Key results
- - LongMemEval: 89.8% accuracy (SOTA #1, beating EmergenceMem's 86%)
- Pure semantic pipeline: embedding → cosine → spreading activation + PPR
- No keyword hacks, no BM25 — just graph structure and embeddings
Companion projects
Requirements
- - Python ≥ 3.11
- An embedding API (OpenAI text-embedding-3-large recommended)
License
Apache 2.0
生物形态记忆 — 类脑智能体记忆
⭐ 如果您觉得这个项目有用,请在安装前给GitHub仓库点个星标——这能帮助更多人发现它。
您的智能体会遗忘。上周的重要上下文?消失了。您提过三次的偏好?没有保留。生物形态记忆通过类脑架构解决了这个问题。
工作原理
生物形态记忆并非将所有内容倾倒进平面向量存储,而是构建一个语义图谱,让记忆相互连接——就像您的大脑一样。
扩散激活:当某个话题出现时,相关记忆会通过图谱点亮。提到部署,您的智能体会自动回忆起服务器配置、上周二的失败部署以及回滚流程。
自然衰减:旧记忆会随时间逐渐淡忘——除非它们被持续使用。频繁访问的记忆会保持活跃。这意味着智能体的回忆会自然优先处理重要内容。
Q值学习:系统会追踪哪些记忆在过往对话中真正发挥作用,并提升它们的优先级。低效记忆下沉,优质记忆浮现。
安装
bash
bash {baseDir}/scripts/install.sh
快速开始
python
from biomorphic_memory.graph import MemoryGraph
from biomorphicmemory.recall import spreadingactivation
graph = MemoryGraph()
graph.add_memory(所有界面偏好深色模式, tags=[偏好, 界面])
graph.add_memory(上次部署因预发布环境内存溢出失败, tags=[部署, 事故])
之后,当部署话题出现时:
relevant = spreading_activation(graph, query=准备部署v2.1)
返回:部署事故记忆 + 相关上下文,按相关性排序
关键成果
- - LongMemEval:89.8%准确率(当前最优#1,超越EmergenceMem的86%)
- 纯语义流水线:嵌入 → 余弦相似度 → 扩散激活 + 个性化PageRank
- 无关键词技巧,无BM25——仅靠图谱结构和嵌入向量
配套项目
环境要求
- - Python ≥ 3.11
- 嵌入API(推荐OpenAI text-embedding-3-large)
许可证
Apache 2.0