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

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
宝玉的分享
宝玉的分享
博客园 - 【当耐特】
有赞技术团队
有赞技术团队
G
Google Developers Blog
Microsoft Security Blog
Microsoft Security Blog
Apple Machine Learning Research
Apple Machine Learning Research
The Cloudflare Blog
Blog — PlanetScale
Blog — PlanetScale
博客园_首页
L
LangChain Blog
Stack Overflow Blog
Stack Overflow Blog
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
罗磊的独立博客
T
Tailwind CSS Blog
博客园 - 叶小钗
T
The Blog of Author Tim Ferriss
Engineering at Meta
Engineering at Meta
博客园 - 聂微东
博客园 - Franky
B
Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
F
Fortinet All Blogs

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
标题还是你得给一个。我来推一个实用方向。往下看。
Manoir Yantai · 2026-06-22 · via DEV Community

Manoir Yantai

标题还是你得给一个。我来推一个实用方向。往下看。


Memory Sidecar v3.5:给AI智能体加个外挂记忆体

智能体的记忆问题是所有重度用户迟早要撞上的墙。当前对话窗口能记住的东西有限,会话一关,之前的上下文就丢了。你能做的就是反复给同一份背景,或者在 system prompt 里塞越来越多东西,直到 token 预算爆炸。

Memory Sidecar 解决的就是这个——它在智能体旁边独立运行,不碰智能体核心代码,只围绕数据目录工作:读会话、沉淀长期知识、在后续任务中把相关记忆重新注入上下文。

架构:四层召回

v3.5 的分层召回设计很直接:

  • 热层(memory tool):当前会话活跃记忆,即时读写
  • 温层(Hindsight):语义搜索 + 事实存储,跨会话持久化
  • 冷层(gbrain):知识图谱关键词检索,适合结构化关联查询
  • 知识层:整理后的 markdown 笔记索引召回

四层独立运作,最终融合输出。即使你不开 embedding 服务(用 intfloat/multilingual-e5-small 做语义召回),FTS5 会话检索、Hindsight 事实召回、gbrain 关键词搜索仍然可用。

安装:三种模式覆盖所有场景

安装器针对不同环境提供了三级降级策略,而不是一个脚本打天下:

# 默认安装——优先尝试全自动依赖引导
./install.sh --install-mode 3

# 半自动——输出推荐命令,用户按步骤走
./install.sh --install-mode 2

# 纯检测——不改系统,只看缺了什么
./install.sh --install-mode 1

同时支持中英文输出,安装器会根据本地环境自动判断语言,也可以用 --lang 强制指定。AGENT_HOME 驱动多智能体安装,不绑死在一个工具上——Hermes、Claude Code、Codex、Cursor 都能用。

安装后跑验收:

python3 "$AGENT_HOME/scripts/sidecar_acceptance_check.py"

10 个脚本做什么

公开安装器部署了 10 个运行入口脚本,覆盖了记忆体全生命周期:

  • 会话归档与摘要(archive_sessions.pyauto_session_summary.py
  • 分层记忆注入(tiered_context_injector.py
  • 维护循环与治理重建(memory_maintenance_cycle.pymemory_governance_rebuild.py
  • 记忆卫士与可观测性报告(memory_guardian.pymemory_observability_report.py

每个脚本职责单一,可以独立执行,也可以通过维护循环统一调度。

跟 Knowledge-and-Memory-Management 组合

如果你需要完整的"知识从哪来→怎么整理→怎么被记忆体消费"链路,KMM 负责上游知识管理和整理,Memory Sidecar 负责把这些知识资产变成智能体可召回的上下文。两者不是替代关系,是上下游。

实用建议

Memory Sidecar 不是那种"装了就立刻变强"的银弹。它是基础建设——装好之后需要跑一段时间,让会话数据积累起来,召回才会越来越准。初期建议每天跑一次维护循环,观察 sidecar_acceptance_check.py 的验证结果,逐步调 embedding 模型和召回权重。