大家都尝试用向量和图来做 AI 记忆。我们又回到了 SQL。
2 分•作者: Arindam1729•8 个月前
当我们最初开始使用大型语言模型(LLM)时,差距显而易见:它们在当下可以很好地推理,但一旦对话继续进行,就会忘记一切。
你可以告诉一个智能体,“我不喜欢咖啡”,但三步之后它又会建议喝意式浓缩咖啡。这并非逻辑错误,而是缺少记忆。
在过去的几年里,人们尝试了许多方法来解决这个问题:
1. 提示词填充/微调——不断预先添加历史记录。适用于简短的聊天,但token数量和成本会迅速增加。
2. 向量数据库(RAG)——将嵌入存储在Pinecone/Weaviate中。召回是语义的,但检索会产生噪声并失去结构。
3. 图数据库——构建实体关系图。非常适合推理,但难以扩展和维护。
4. 混合系统——混合使用向量、图、键值和关系数据库。灵活但复杂。
然后是意想不到的转折:
关系数据库!是的,这项运行银行和社交媒体数十年的技术,现在看起来是为人工智能提供持久记忆的最实用方法之一。
与其使用那些花哨的存储方式,不如:
* 在SQL表中保存短期和长期记忆
* 将实体、规则和偏好存储为结构化记录
* 将重要事实提升到永久记忆中
* 使用连接和索引进行检索
这是我们在Gibson一直在研究的方法。我们构建了一个名为Memori(https://memori.gibsonai.com/)的开源项目,这是一个多智能体记忆引擎,赋予你的人工智能智能体类似人类的记忆。
这有点讽刺,在围绕向量和图的炒作之后,人工智能记忆的最佳答案之一可能就是我们已经信赖了50多年的技术。
我很想知道你对我们方法的看法!
查看原文
When we first started building with LLMs, the gap was obvious: they could reason well in the moment, but forgot everything as soon as the conversation moved on.<p>You could tell an agent, “I don’t like coffee,” and three steps later it would suggest espresso again. It wasn’t broken logic, it was missing memory.<p>Over the past few years, people have tried a bunch of ways to fix it:<p>1. Prompt stuffing / fine-tuning – Keep prepending history. Works for short chats, but tokens and cost explode fast.<p>2. Vector databases (RAG) – Store embeddings in Pinecone/Weaviate. Recall is semantic, but retrieval is noisy and loses structure.<p>3. Graph databases – Build entity-relationship graphs. Great for reasoning, but hard to scale and maintain.<p>4. Hybrid systems – Mix vectors, graphs, key-value, and relational DBs. Flexible but complex.<p>And then there’s the twist:
Relational databases! Yes, the tech that’s been running banks and social media for decades is looking like one of the most practical ways to give AI persistent memory.<p>Instead of exotic stores, you can:<p>- Keep short-term vs long-term memory in SQL tables<p>- Store entities, rules, and preferences as structured records<p>- Promote important facts into permanent memory<p>- Use joins and indexes for retrieval<p>This is the approach we’ve been working on at Gibson. We built an open-source project called Memori (https://memori.gibsonai.com/), a multi-agent memory engine that gives your AI agents human-like memory.<p>It’s kind of ironic, after all the hype around vectors and graphs, one of the best answers to AI memory might be the tech we’ve trusted for 50+ years.<p>I would love to know your thoughts about our approach!