惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
Recent Announcements
Recent Announcements
雷峰网
雷峰网
The GitHub Blog
The GitHub Blog
罗磊的独立博客
月光博客
月光博客
J
Java Code Geeks
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
D
Docker
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
F
Fortinet All Blogs
U
Unit 42
C
Check Point Blog
Martin Fowler
Martin Fowler
有赞技术团队
有赞技术团队
博客园 - 叶小钗
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
酷 壳 – CoolShell
酷 壳 – CoolShell
Blog — PlanetScale
Blog — PlanetScale
大猫的无限游戏
大猫的无限游戏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
阮一峰的网络日志
阮一峰的网络日志
MyScale Blog
MyScale Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
知识采集不是存文档,是给 AI 喂「可检索的记忆」
Manoir Yantai · 2026-06-21 · via DEV Community

Manoir Yantai

我写过一个开源项目,叫 Knowledge-and-Memory-Management,v0.0.2。

它的定位很简单:帮 AI Agent 解决知识从哪来、怎么存、如何用的问题。 底座是一个叫 hermes-memory-installer 的记忆体系统,负责「记住」;KMM 在上面做了一层知识采集层——把碎片化的网页、视频、文档、公众号文章变成结构化的、可检索的知识节点。

说人话:你给 Agent 喂了一篇文章,它不只是读完就忘,而是自动生成笔记、录入知识图谱、同步到云盘,下次搜同类问题直接从本地命中。

三层降级采集,不装死

项目里有个 AugmentedSearch 类,核心逻辑就一个 if:

class AugmentedSearch:
    def search(self, query, domain=""):
        local = self._search_local(query)
        weight = self._score_local(local)

        # 本地笔记分够了就直接返回
        if weight >= self.cfg.fallback_threshold:
            return {"source": "local", "results": local}

        # 分不够 → AnySearch 垂直搜索自动补全
        web = self._search_web(query, domain)
        return {"source": "hybrid", "results": local + web}

本地优先:先查 gbrain 语义搜索 + ripgrep 本地笔记全文。你之前读过的文章、写过的笔记,都在索引范围内,秒级命中就直接返回。

自动回落:本地权重不够(比如搜一个你完全没接触过的新话题),自动走 AnySearch 垂直搜索——分 finance、academic、code 等域,结果自动标来源 web,可一键导入笔记库。

不装死:gbrain 不可用就静默降级,ripgrep 找不到就跳过,AnySearch 超时就返回空。每个环节都 try/except,不会因为一个组件挂了整个搜索就崩。

别自己写轮子

这套设计的关键洞察是:Agent 的知识管理≈搜索系统 + 采集管线 + 持久化层。

大部分人在做 Agent 时只关注 prompt 和 tool calling,忽略了长期记忆的价值。KMM 把这三点串起来了——采集管线的 40+ 工具(从 Scrapling 反爬到 SenseNova 文档分析),覆盖了网页、视频(带 OCR+ASR)、公众号、PDF/PPT/Word、甚至书籍精炼。采集完自动触发笔记生成→gbrain 入库→云盘同步,形成一个闭环:

采集 → 处理 → 笔记 → 知识图谱 → 云盘双向同步
  │                                │
  └────────── 下次采集先去重 ──────┘

v0.0.2 还加了个知识发现模块——每周日自动扫描 OneDrive 里的新笔记,识别后自动录入 gbrain。你不需要手动告诉 Agent「我存了一篇新文章」,它自己会去翻。

给你的建议

如果你也在搭 Agent 知识底座,不要只想着 RAG + 向量数据库。先把「采集→去重→结构化→持久化」这条链路走通。没有好的输入,再强的检索也是对着垃圾箱翻。