乐于分享
好东西不私藏

本地文档知识查找agent

本地文档知识查找agent

问题由来

平时工作中积累了大量工作场景特异化知识,例如“如何连接音箱debug自己的产品”,“如何迁移未合入的代码提交到其他机器同时完全对齐git状态”。这些文档记录的时候按照当时的思维框架建立的目录存储。但过去一段时间,想再找哪个问题的答案,就不一定记得它是在哪个目录的哪个文件了。

怎么解决

最近火热的openclaw,让agent具备了利用本地文件系统/沙箱,运行shell命令、读写文件的能力。正好适合我这个问题的场景。
在调研过程中发现了LangChain的DeepAgent,工具调用循环一如其他agent,但还具备了其他能力,其中之一便是backend能力,官方描述如下:

Deep Agents expose a filesystem surface to the agent via tools like ls, read_file, write_file, edit_file, glob, and grep. These tools operate through a pluggable backend. The read_file tool natively supports image files (.png, .jpg, .jpeg, .gif, .webp) across all backends, returning them as multimodal content blocks.

动手干

  1. 先直接import sdk,手动搭建运行环境,配置sk&模型id,配置backend,直接跑agent
  2. 用AI生成前端网页,连接后端执行引擎
项目最终效果如下:
github地址:https://github.com/mascure/Alyosha