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

推荐订阅源

Martin Fowler
Martin Fowler
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
雷峰网
雷峰网
J
Java Code Geeks
G
Google Developers Blog
博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
L
LangChain Blog
人人都是产品经理
人人都是产品经理
GbyAI
GbyAI
Vercel News
Vercel News
S
SegmentFault 最新的问题
Engineering at Meta
Engineering at Meta
H
Hackread – Cybersecurity News, Data Breaches, AI and More
云风的 BLOG
云风的 BLOG
F
Fortinet All Blogs
Y
Y Combinator Blog
博客园_首页
Last Week in AI
Last Week in AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
罗磊的独立博客
A
About on SuperTechFans
B
Blog
Microsoft Security Blog
Microsoft Security 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 Agent 如何从「记住」进化到「知道」
Manoir Yantai · 2026-06-24 · via DEV Community

Manoir Yantai

两年前我写第一个 Agent 时,最头疼的问题不是模型不够聪明——而是它每开一个新会话就失忆。后来有了 RAG,有了向量数据库,但新的问题来了:笔记散落在本地,论文在 PDF 里,收藏的网页在书签里,知识图谱自己又建一套。三个库互不打通,召回时各查各的,结果就是 Agent 的「记忆」有缝——同一个话题,FTS5 命中一条,语义检索命中另一条,知识图谱再冒出第三条,没人帮你合并。

Knowledge-and-Memory-Management v0.0.2 的核心理念就一句话:知识的价值不在于存了多少,而在于调用时能一次性拿出全部相关材料。

三层不是三层独立,是一条链

项目实现了 FTS5(SQLite 全文搜索)→ Hindsight(PG16 语义向量)→ gbrain(知识图谱关键词)的链式召回。不是三个接口让 Agent 自己选,是 lightweight_recall.py 一个入口自动走完三级:

用户查询
  → L1: FTS5 全文搜索 (state.db,0.1s)
  → 命中 score ≥ 0.6 直接返回(90% 场景)
  → L2: Hindsight 语义向量 (PG16,<15s)
  → L3: gbrain 关键词搜索 (8787端口,<1s)
  → 三级合并 → RECALL_CONTEXT.md

代码极简:

from knowledge_management.lightweight_recall import recall

result = recall("Agent 记忆系统设计", top_k=10)
print(f"FTS5: {result.fts5_count}, Hindsight: {result.hindsight_count}, gbrain: {result.gbrain_count}")
print(f"最终返回 {len(result.merged)} 条,已去重排序")

比召回更重要的:采集闭环

单纯架个 RAG 谁都会,真正拉开差距的是知识怎么进来的。项目围绕这一点设计了完整的采集管线——网页 9 种引擎(含 Scrapling 反爬)、视频 12 种工具(含抖音批量 ASR)、文档 SenseNova 三件套(PDF/PPT/Word 全量提取)、710+ 本书籍自动精炼管线。采集完,笔记落盘、知识图谱录入、云盘同步一条龙自动跑完,不需要手动搬运。

v0.0.2 还加了知识发现模块——每周日自动扫描 OneDrive 中新笔记、录入 gbrain、修复孤页。你甚至不用主动「保存」,Agent 会自己发现。

开发者视角

这套系统 GitHub 开源(mage0535/Knowledge-and-Memory-Management),基于 hermes-memory-installer 底座,依赖 gbrain + Hindsight。安装就是 bash install.sh 一件事。如果你已经在跑 Hermes Agent,加这个等于给你的 Agent 装上「长期职业记忆」——不是记住聊天历史,是真的能用知识工作。

你甚至可以把它当个人知识库用:采集网页→自动生成笔记→同步到 OneDrive,纯命令行操作,比 Notion 快多了。