返回顶部
h

hawk-bridge鹰桥记忆引擎

OpenClaw Hook Bridge + context-hawk Python Memory Engine. Auto-capture memories on every reply, auto-inject relevant memories before each response. Supports 4-tier decay, hybrid vector + BM25 search, and Markdown import.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.2.1
安全检测
已通过
175
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

hawk-bridge

hawk-bridge — OpenClaw 记忆系统 Skill

OpenClaw Hook Bridge + context-hawk Python 记忆引擎
单一 Skill,同时解决:自动记忆捕获 + 自动记忆检索 + 四层衰减 + 向量搜索 + Markdown兼容


核心能力

能力说明
autoCapture Hook每次回复后,自动用 LLM 提取对话内容 → 存入 LanceDB
autoRecall Hook
每次回复前,自动检索相关记忆 → 注入上下文 | | 四层记忆衰减 | Working → Short → Long → Archive,自动淘汰低价值记忆 | | 混合检索 | 向量 + BM25 + RRF融合 + 噪声过滤 + 交叉编码重排 | | 6大检索优化 | Query扩展 · MMR多样性 · 置信度过滤 · 分域加权BM25 · 会话感知 · 结果压缩 | | Markdown兼容 | 一键导入用户已有 .md 记忆文件 | | 零配置 | 默认 Jina 免费 Embedding API,装完就能用,无需任何 API Key | | 28条文本清洗 | Markdown/URL/标点/时间戳/Emoji/HTML/调试日志等自动清理 | | 敏感信息安全 | API Key/电话/邮箱/身份证/信用卡自动脱敏后存储 | | TTL 过期 | 记忆默认30天自动过期,节省存储空间 | | Recall 阈值门控 | relevance score < minScore 的记忆不注入上下文 | | 审计日志 | 所有 capture/skip/reject/recall 事件记录到 ~/.hawk/audit.log | | 有害内容过滤 | 暴力/欺诈/黑客/CSAM 等内容在 capture 阶段直接拒绝 | | 多模态记忆 | 支持 text / audio / video 三种来源,统一存储统一检索 |

多模态记忆

hawk-bridge v1.2+ 支持多模态记忆,统一存储 text、audio、video 类型的记忆。

记忆来源类型

source_type说明典型场景
text文本对话(默认)聊天记录、文档内容
audio
音频记忆 | 通话录音、会议录音、语音消息 | | video | 视频记忆 | 会议录像、课程视频、演示文稿 |

数据模型

所有记忆统一存储在 hawkmemories 表,通过 sourcetype 字段区分:

typescript
interface MemoryEntry {
id: string;
text: string; // ASR 转录文本 / 视频描述
vector: number[]; // 文本嵌入向量
category: string; // fact | preference | decision | entity
scope: string;
importance: number;
timestamp: number;
expiresAt: number;
metadata: Record; // 类型特有元数据
source_type: text | audio | video; // 记忆来源
}

metadata 结构

typescript
// audio 记忆
metadata: {
audio: {
path: /path/to/audio.mp3,
duration_ms: 180000, // 180秒
speaker: 张三,
emotion: neutral,
transcript_segments: [
{ start: 0, end: 5000, text: 大家好... },
{ start: 5000, end: 12000, text: 今天讨论... }
]
}
}

// video 记忆
metadata: {
video: {
path: /path/to/video.mp4,
duration_ms: 300000,
description: 产品发布会演示文稿讲解,
keyframes: [
{ timestamp: 10000, description: 开场白 },
{ timestamp: 60000, description: 产品介绍 }
]
}
}

检索示例

typescript
// 检索所有记忆(默认 text only)
const results = await retriever.search(用户偏好);

// 检索 text + audio
const results = await retriever.search(上周那个客户电话说了什么, 5, undefined, [text, audio]);

// 检索所有类型
const results = await retriever.search(那个演示文稿, 5, undefined, [text, audio, video]);



架构

OpenClaw Gateway (TypeScript Hooks)

├── agent:bootstrap → hawk-recall hook
│ → HybridRetriever
│ ┌─────────────────────────────────────────────────────┐
│ │ 1. Query Expansion (查询扩展成多个相关表述) │
│ │ 2. Multi-query Vector+BM25 (每个查询独立检索) │
│ │ 3. RRF Fusion (结果融合) │
│ │ 4. Noise Filter (去除好的收到等噪声) │
│ │ 5. Cross-encoder Rerank (重排) │
│ │ 6. Confidence Threshold (置信度过滤) │
│ │ 7. MMR Diversity (多样性排序) │
│ │ 8. Layer Penalty (低层级降权) │
│ │ 9. Result Compression (长文本压缩) │
│ └─────────────────────────────────────────────────────┘
│ → 记忆注入上下文 🦅

└── message:sent → hawk-capture hook
→ Python LLM 智能提取(fact/preference/decision/entity/other)
→ 存入 LanceDB
→ Governance 日志

Python Core (hawk_memory/)
├── memory.py — MemoryManager 四层衰减
├── compressor.py — ContextCompressor 上下文压缩
├── self_improving.py — 自我反思学习
├── extractor.py — LLM 6类分类提取
├── governance.py — 系统巡检指标
├── vector_retriever.py — 向量检索
└── markdown_importer.py — .md 文件导入



安装

方式1:OpenClaw Skill(推荐)

bash openclaw skills install https://github.com/relunctance/hawk-bridge

方式2:手动安装

bash git clone git@github.com:relunctance/hawk-bridge.git /path/to/hawk-bridge cd /path/to/hawk-bridge npm install pip install lancedb openai rank_bm25

注册到 openclaw.json

json { plugins: { load: { paths: [/absolute/path/to/hawk-bridge] }, allow: [hawk-bridge] } }

自动配置(零额外Key)

embedding + LLM 默认使用 OpenClaw 已配置的 provider(minimax 等):

配置项来源说明
embedding provideropenclaw.json models.providers自动检测
LLM provider
openclaw.json models.providers | 自动检测 |
| API Key | openclaw.json auth.profiles | 自动透传 |

环境变量覆盖(可选):
bash
export MINIMAXAPIKEY=your-key # Minimax API Key
export MINIMAXBASEURL=https://... # 自定义端点
export MINIMAX_MODEL=MiniMax-M2.7 # 指定模型
export OLLAMABASEURL=http://localhost:11434 # Ollama本地(免费)
export LLM_PROVIDER=groq # 切换LLM后端



配置项(openclaw.json)

大部分情况不需要配置——装完默认 Jina 免费 API 就能跑。

如需定制,在 openclaw.json 的 plugins.entries.hawk-bridge.config 下添加:

json
{
plugins: {
entries: {
hawk-bridge: {
enabled: true,
config: {
embedding: {
provider: jina,
apiKey: , // jina 免费,无需填
model: jina-embeddings-v5-small,
dimensions: 1024
},
llm: {
provider: groq,
apiKey: , // groq 免费,无需填
model: llama-3.3-70b-versatile
},
recall: {
topK: 5,
minScore: 0.6,
injectEmoji: 🦅
},
capture: {
enabled: true,

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 hawk-bridge-1775898912 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 hawk-bridge-1775898912 技能

通过命令行安装

skillhub install hawk-bridge-1775898912

下载

⬇ 下载 hawk-bridge v1.2.1(免费)

文件大小: 109.09 KB | 发布时间: 2026-4-12 10:11

v1.2.1 最新 2026-4-12 10:11
feat: Add 50-year memory architecture roadmap - constitutional memory tiers (L0-L5), DARK archive format, tier promotion engine, cold storage pipeline

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部