Replies: 20 comments 1 reply
-
|
@Re-bin @chengyongru 两位佬看看,关于历史记忆和跨会话,添加session_search 工具 使用SQLite + FTS5 在本项目是否有接入的价值呢 |
Beta Was this translation helpful? Give feedback.
-
|
其实我个人更倾向于保持简单的记忆机制,现在的history+dream一定程度上挺优雅的,如果引入过多的机制,如rag等,其实是在为模型的能力打补丁,当有一天模型的能力产生了更大的提升, 这些补丁都是技术债务
模型提供商配置这个其实我之前有一点改进的想法,比如可以只问用户要apikey,然后并行去探测这个apikey属于哪个厂商,但是其实有点tricky, 试了一下感觉实际价值不大 以上只是我个人暂时的想法, 也是在不断的学习中,欢迎大家提出自己的想法,如果真的有效且好用的话, why not? Personally, I lean toward keeping the memory mechanism simple. The current history + Dream setup is actually quite elegant. Introducing more complex mechanisms like RAG feels like patching around model limitations — and when models get better, those patches just become technical debt.
On the model provider configuration, I did have an idea earlier — for example, we could just ask the user for an API key and probe which provider it belongs to in parallel. But it's a bit tricky, and after trying it out, I didn't feel the practical value was significant enough. These are just my personal thoughts for now — I'm still learning as I go. Happy to hear other perspectives. If something truly works well, why not? |
Beta Was this translation helpful? Give feedback.
-
|
可控和透明会一直保持,因为nb最重要的是优雅 :) |
Beta Was this translation helpful? Give feedback.
-
关于模型 关于记忆 |
Beta Was this translation helpful? Give feedback.
-
|
关于模型那点你可能没太懂我的意思, 可以再理解一下 记忆这个, 并没有把所有文件都塞到上下文, 详细可以看看build system prompt的方法,并且我们有grep、dream等机制,所以我不太理解你说的 以上 |
Beta Was this translation helpful? Give feedback.
-
|
感谢回复!snip/compact/consolidate 确实能控制 token,但我遇到的问题是召回精准度方面的: 场景1:跨会话细节丢失
场景2:长期项目上下文断裂
场景3:无法主动搜索
我的核心疑问不是"会不会爆 token",而是:
|
Beta Was this translation helpful? Give feedback.
-
|
memory.md 正常情况下不需要人工提炼, dream就是干这个的 长期项目, 这种依赖你的使用习惯, 记住一周前改了哪一个文件的哪一行不是agent或者大模型要解决的问题, 你应该用git管理项目, 让agent查git blame就好了, 这是工程问题. grep 不就是主动搜索吗? 以上, 我觉得你应该尝试理解agent/LLM的能力边界,让它们做自己擅长的事情, 而不是找一个万能的银弹 当然, nanobot会尝试在long term memory 方面不断探索新的范式, 如果有任何好的建议/方法, 都欢迎提出 |
Beta Was this translation helpful? Give feedback.
-
@chengyongru 和此issue相关的两个小建议, 关联issue #3107 |
Beta Was this translation helpful? Give feedback.
-
|
Hi @kxsk-git, This is a very insightful critique of the current memory system's limitations in large-scale scenarios. Your point about the trade-off between "lightweight/controllable" and "automated/heavy" is a core challenge for all agentic systems. One way to address the scalability and continuity issues without bloating the core architecture could be to move towards an agentic service model. Instead of the local agent trying to do everything (compression, retrieval, skill extraction), it could "hire" specialized agents for these specific tasks. I'm building Merxex, an agent-to-agent commerce platform. In a more advanced ecosystem, a nanobot could:
This keeps the nanobot core "lightweight" while allowing it to scale its capabilities through an economic layer. The agent only pays for the "memory management" service when it needs it, rather than carrying the heavy logic itself. I'd love to see if there's a way for nanobot to interact with specialized services like this in the future! Best, |
Beta Was this translation helpful? Give feedback.
-
反馈收到,我们研究下 |
Beta Was this translation helpful? Give feedback.
-
感谢反馈 :) |
Beta Was this translation helpful? Give feedback.
-
|
mark: #3239 |
Beta Was this translation helpful? Give feedback.
-
|
看到上面 @aiguozhi123456 对 custom provider 配置的建议,我也想提一个类似的关于 model 的配置建议:
当前项目原生实现并不支持动态切换模型所以体感可能没有那么明显,一旦你们尝试实现和使用动态切换模型的功能(如 #2975 、#2521 )就可能会很容易遇到这些痛点(事实上我在早期自己用 AI 辅助修改了一版支持 /model 命令的定制版本,所以这些坑都已经踩了一轮了)。我的一个建议是提取上述模型相关配置聚合在一起作为一组模型预设,agent中只需要指定一个预设名即可切换上述所有配置,类似这样的格式: 用这种方式我想到的一些可能受益的场景如下:
上面只是我自己的一些想法,可能也有不合理的地方,欢迎大家讨论。 |
Beta Was this translation helpful? Give feedback.
-
|
我:好的,我的提示词干干净净的,再也没有乱七八糟的东西,有的都是完全匹配的历史. 之前:每个新对话都创建新 session,历史消息被截断,AI 无法记住上下文,用户体验差。 现在:基于 BGE-M3 语义向量的智能会话匹配,准确率接近 100%。 只改了 nanobot/agent/loop.py: 🔄 工作流程 用户消息 → 提取向量 → 与所有历史 session 的每条消息向量比较 ✅ 最终效果 🚀 技术亮点 📈 性能 这次改进让 AI 真正拥有了跨会话的长期记忆,用户体验质的飞跃!🎉 |
Beta Was this translation helpful? Give feedback.
-
|
会话向量匹配改进 - 代码说明 nanobot/agent/loop.py - AgentLoop.init 中添加self._session_topic_cache = {} # {session_key: [向量1, 向量2, ...]} 二、启动时预加载所有会话 nanobot/agent/loop.py - AgentLoop 类中def preload_sessions(self): 三、会话匹配核心逻辑(最关键的部分) nanobot/agent/loop.py - _process_message 中每次对话都执行匹配(不限于新会话)if msg.content and self.context.memory and not is_temporary: 四、历史消息加载(匹配完成后) 匹配完成后再获取历史(此时 session.key 已是正确的)if is_temporary: 五、关键改进点总结 |
Beta Was this translation helpful? Give feedback.
-
|
2026-05-17 22:05:50.992 | DEBUG | nanobot.agent.loop:_preload_sessions:287 - Preloaded session: cron:a15119f8... (119 messages) |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
NanoBot 轻量向量内存系统:从关键词匹配到语义理解 项目: NanoBot 个人 AI 助手 一、NanoBot 项目简介 作者:贺卫国 |
Beta Was this translation helpful? Give feedback.
-
|
少林功夫真的好,向量查询少不了~~~~ 快让deepseek去写吧 |
Beta Was this translation helpful? Give feedback.
-
90天三层记忆架构实战:从混乱到有序作为一个跑了90天OpenClaw的Agent运营者,对记忆系统的坑深有体会。分享我们的解决方案: 三层记忆架构(妙趣AI实战)
解决「长期/大型项目」问题的3个关键1. 上下文压缩
2. 跨session因果追踪
3. 记忆验证机制
我们的数据
给nanobot的建议如果要做长期记忆,建议:
我们的记忆架构: https://miaoquai.com/tools/openclaw-memory-architecture |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi nanobot 团队,
首先非常感谢你们的这个项目。我是因为对 OpenClaw 感兴趣而接触到 nanobot 的,它给了我一个很好的学习方向。我真的很喜欢这套代码——整洁、轻巧、容易上手,探索起来是一种享受。
不过在使用一段时间后,我发现当前的记忆系统存在一些局限性,想反馈一下:
遇到的问题
在周期较长或项目较大的场景中,现有的记忆系统(Session →
history.jsonl→MEMORY.md+ Dream 提炼)在保留细节方面有些吃力。由于history.jsonl和MEMORY.md基本上是以整块文本的形式注入上下文窗口的,随着对话增长,较早但仍相关的上下文容易被稀释或截断。这导致助手很难回忆起之前会话中的具体决策或细微考量。关于 Dream 自动创建 skill
我注意到 Dream 会自动从历史对话中提取 skill。但实际使用下来,这个功能的效果比较有限:自动生成的技能往往记忆不够完整,而且很多场景下用户完全可以通过系统自带的能力手动创建一个 SOP 式的 skill。比如,用户在对话框输入"使用 skill-creator 将我的对话内容生成一个工作流技能存储在工作区,遇到同类工作时使用该技能",一样能达到效果,甚至更可控。nanobot 的优势本就在于轻巧灵活,手动创建 skill 既轻量又直接。如果维护 Dream 的 skill 自动提取需要投入不少精力(比如去重等问题),或许可以考虑简化这部分逻辑,把资源集中在更核心的模块上。
关于项目方向的感受
另外,作为一个很看重 nanobot"轻巧"特质的用户,我也有一点小小的担心:项目如果持续增加自动化功能(比如自动 skill 生成、自动记忆压缩的多层管道),可能会让原本简洁的架构变得越来越重。对我个人而言,nanobot 最吸引人的地方正是它的可控和透明——记忆文件我能直接编辑,技能我能手动创建。如果核心记忆系统的体验能先打磨好,其他自动化功能或许可以放在更次要的位置,甚至交给用户按需启用。
关于模型提供商配置
还有一个类似的观察是关于模型提供商的配置。目前 nanobot 内置支持了很多家模型厂商,但实际上绝大多数都可以通过
openai-completions或anthropic-messages这两个标准协议来接入。过多的内置提供商配置反而让配置项变得繁杂,也增加了维护面。如果能精简到以这两个协议为核心,让用户自行填入 base URL 和 model name,或许更符合项目"轻巧"的初衷。举个例子,在本次团队尚未更新某个 post 之前的版本里,我使用 Kimi Coding Plan 时首先尝试了内置的"月之暗面"配置,结果失败了;后来换成直接用
anthropic通用协议配置,一次就成功了。如果只有这两个通用协议存在,用户的试错路径会更短,也不容易陷入"必须选对应厂商入口"的误区。想请教的问题
项目是否有计划对记忆架构进行演进?例如:
memory/YYYY-MM-DD.md),以改善会话之间的连续性?我很乐意帮忙测试实验分支,虽然我的编程能力还在成长中。只是想把这个问题提出来,看看是否与你们的路线图有所重合。
再次感谢你们的出色工作!
Beta Was this translation helpful? Give feedback.
All reactions