网淘吧来吧,欢迎您!

Jasper Recall技能使用说明

2026-03-30 新闻来源:网淘吧 围观:8
电脑广告
手机广告

Jasper Recall v0.2.3

面向AI智能体的本地RAG(检索增强生成)记忆系统。赋予您的智能体记忆和搜索过往对话的能力。

v0.2.2 版本新增:共享ChromaDB集合 — 为私有内容、共享内容和学习内容提供独立的集合。为多智能体设置提供更好的隔离性。

Jasper Recall

v0.2.1 版本新增:Recall 服务器 — 为无法直接运行CLI的Docker隔离智能体提供HTTP API。

v0.2.0 版本新增:共享智能体记忆 — 主智能体与沙盒智能体之间通过隐私控制实现双向学习。

适用场景

  • 记忆检索:在回答前搜索过往会话以获取上下文
  • 持续学习:索引每日笔记和决策以供未来参考
  • 会话连续性:记住跨重启发生的事件
  • 知识库:根据您智能体的经验构建可搜索的文档

快速开始

安装

一条命令即可安装所有内容:

npx jasper-recall setup

这将创建:

  • 位于以下位置的Python虚拟环境~/.openclaw/rag-env
  • 位于以下位置的ChromaDB数据库~/.openclaw/chroma-db
  • 位于以下位置的CLI脚本~/.local/bin/
  • 位于以下位置的OpenClaw插件配置openclaw.json

为什么使用Python?

核心搜索和嵌入功能使用Python库:

  • ChromaDB— 用于语义搜索的向量数据库
  • sentence-transformers— 本地嵌入模型(无需API)

这些是本地RAG的黄金标准。目前没有功能完备、可完全离线的Node.js等效方案。

为什么使用独立的虚拟环境?

位于以下位置的虚拟环境~/.openclaw/rag-env提供了:

好处为何重要
隔离性不会与你的其他Python项目冲突
无需sudo权限安装至你的主目录,无需root权限
干净卸载删除文件夹即可完全移除
可复现性各处版本一致

依赖项较重(包含嵌入模型总计约200MB),但这是一次性下载,完全在本地运行。

基本用法

搜索你的记忆:

recall "what did we decide about the API design"
recall "hopeIDS patterns" --limit 10
recall "meeting notes" --json

为你的文件建立索引:

index-digests  # Index memory files into ChromaDB

创建会话摘要:

digest-sessions          # Process new sessions
digest-sessions --dry-run  # Preview what would be processed

工作原理

三大组件

  1. digest-sessions— 从会话日志中提取关键信息(主题、使用的工具)
  2. index-digests— 将Markdown文件分块并嵌入到ChromaDB中
  3. recall— 对已索引记忆进行语义搜索

索引内容

默认索引以下目录中的文件~/.openclaw/workspace/memory/

  • *.md— 每日笔记、MEMORY.md
  • session-digests/*.md— 会话摘要
  • repos/*.md— 项目文档
  • founder-logs/*.md— 开发日志(如存在)

嵌入模型

使用sentence-transformers/all-MiniLM-L6-v2

  • 384维嵌入
  • 首次运行时下载约80MB
  • 本地运行,无需API

智能体集成

记忆增强响应

# Before answering questions about past work
results = exec("recall 'project setup decisions' --json")
# Include relevant context in your response

自动索引(心跳机制)

添加到 HEARTBEAT.md:

## Memory Maintenance
- [ ] New session logs? → `digest-sessions`
- [ ] Memory files updated? → `index-digests`

定时任务

安排定期索引:

{
  "schedule": { "kind": "cron", "expr": "0 */6 * * *" },
  "payload": {
    "kind": "agentTurn",
    "message": "Run index-digests to update the memory index"
  },
  "sessionTarget": "isolated"
}

共享代理记忆(v0.2.0+)

适用于需要访问某些记忆的沙盒化多代理设置:

记忆标记

在每日笔记中标记条目:

## 2026-02-05 [public] - Feature shipped
This is visible to all agents.

## 2026-02-05 [private] - Personal note
This is main agent only (default if untagged).

## 2026-02-05 [learning] - Pattern discovered
Learnings shared bidirectionally between agents.

ChromaDB 集合(v0.2.2+)

记忆存储在独立的集合中以实现隔离:

集合用途访问者
private_memories主代理的私有内容仅主代理
shared_memories[public] 标记的内容沙盒化代理
agent_learnings来自任何代理的学习内容所有代理
jasper_memory旧版统一集合(向后兼容)备用方案

集合选择:

# Main agent (default) - searches private_memories
recall "api design"

# Sandboxed agents - searches shared_memories only
recall "product info" --public-only

# Search learnings only
recall "patterns" --learnings

# Search all collections (merged results)
recall "everything" --all

# Specific collection
recall "something" --collection private_memories

# Legacy mode (single collection)
recall "old way" --legacy

沙盒化代理访问

# Sandboxed agents use --public-only
recall "product info" --public-only

# Main agent can see everything
recall "product info"

Moltbook 代理设置(v0.4.0+)

对于 moltbook-scanner(或任何沙盒化代理),使用内置设置:

# Configure sandboxed agent with --public-only restriction
npx jasper-recall moltbook-setup

# Verify the setup is correct
npx jasper-recall moltbook-verify

这将创建:

  • ~/bin/recall—— 一个强制使用--public-only标志的包装器
  • shared/—— 指向主工作空间共享内存的符号链接

然后沙盒化代理可以使用:

~/bin/recall "query"  # Automatically restricted to public memories

隐私模型:

  1. 主代理在每日笔记中将记忆标记为[public][private]sync-shared
  2. 提取[public]内容到memory/shared/memory/shared/
  3. 沙盒化代理仅能搜索共享集合

隐私工作流

# Check for sensitive data before sharing
privacy-check "text to scan"
privacy-check --file notes.md

# Extract [public] entries to shared directory
sync-shared
sync-shared --dry-run  # Preview first

CLI参考

召回

recall "query" [OPTIONS]

Options:
  -n, --limit N     Number of results (default: 5)
  --json            Output as JSON
  -v, --verbose     Show similarity scores and collection source
  --public-only     Search shared_memories only (sandboxed agents)
  --learnings       Search agent_learnings only
  --all             Search all collections (merged results)
  --collection X    Search specific collection by name
  --legacy          Use legacy jasper_memory collection

服务 (v0.2.1+)

npx jasper-recall serve [OPTIONS]

Options:
  --port, -p N    Port to listen on (default: 3458)
  --host, -h H    Host to bind (default: 127.0.0.1)

Starts HTTP API server for Docker-isolated agents.

Endpoints:
  GET /recall?q=query&limit=5    Search memories
  GET /health                    Health check

Security: public_only=true enforced by default.
Set RECALL_ALLOW_PRIVATE=true to allow private queries.

示例 (来自Docker容器):

curl "http://host.docker.internal:3458/recall?q=product+info"

隐私检查 (v0.2.0+)

privacy-check "text"     # Scan inline text
privacy-check --file X   # Scan a file

Detects: emails, API keys, internal IPs, home paths, credentials.
Returns: CLEAN or list of violations.

同步共享 (v0.2.0+)

sync-shared [OPTIONS]

Options:
  --dry-run    Preview without writing
  --all        Process all daily notes

Extracts [public] tagged entries to memory/shared/.

索引摘要

index-digests

Indexes markdown files from:
  ~/.openclaw/workspace/memory/*.md
  ~/.openclaw/workspace/memory/session-digests/*.md
  ~/.openclaw/workspace/memory/repos/*.md
  ~/.openclaw/workspace/memory/founder-logs/*.md

Skips files that haven't changed (content hash check).

摘要会话

digest-sessions [OPTIONS]

Options:
  --dry-run    Preview without writing
  --all        Process all sessions (not just new)
  --recent N   Process only N most recent sessions

配置

自定义路径

设置环境变量:

export RECALL_WORKSPACE=~/.openclaw/workspace
export RECALL_CHROMA_DB=~/.openclaw/chroma-db
export RECALL_SESSIONS_DIR=~/.openclaw/agents/main/sessions

分块

索引摘要中的默认设置:

  • 分块大小: 500字符
  • 重叠: 100字符

安全注意事项

⚠️在生产环境中启用前请审查这些设置:

服务器绑定

服务命令默认监听127.0.0.1(仅限本地主机)。不要使用--host 0.0.0.0除非你明确打算将API对外暴露并且已经采取了适当的安全措施。

私有记忆访问

服务器默认强制设置public_only=true。环境变量RECALL_ALLOW_PRIVATE=true可以绕过此限制。切勿在公共/共享主机上设置此变量——这会将你的私有记忆暴露给任何客户端。

autoRecall 插件

当OpenClaw插件配置中设置autoRecall: true时,记忆会在每条代理消息前自动注入。请考虑:

  • 在插件配置中为沙箱化代理设置publicOnly: true
  • 检查哪些集合将被搜索
  • 使用最小分数过滤低相关性的注入内容

自动跳过(不触发召回)的内容:

  • 心跳轮询(心跳阅读HEARTBEAT.md心跳正常
  • 包含无需回复
  • 的消息
  • 字符数少于10的消息
  • 代理间消息(定时任务、工作进程、派生的代理)自动化报告(📋 PR审查🤖 Codex监控公告_*
  • 来自发件人名称以工作者-

针对不可信环境的安全配置:

"jasper-recall": {
  "enabled": true,
  "config": {
    "autoRecall": true,
    "publicOnly": true,
    "minScore": 0.5
  }
}

环境变量

以下环境变量会影响行为——请明确设置它们,而不是依赖默认值:

变量默认值用途
RECALL_WORKSPACE~/.openclaw/workspace记忆文件位置
RECALL_CHROMA_DB~/.openclaw/chroma-db向量数据库路径
RECALL_SESSIONS_DIR~/.openclaw/agents/main/sessions会话日志
RECALL_ALLOW_PRIVATEfalse服务器私有访问权限
RECALL_PORT3458服务器端口
RECALL_HOST127.0.0.1服务器绑定地址

首次试运行

在分享或同步之前,使用试运行选项预览将要暴露的内容:

privacy-check --file notes.md     # Scan for sensitive data
sync-shared --dry-run             # Preview public extraction
digest-sessions --dry-run         # Preview session processing

沙箱环境

为了获得最大程度的隔离,请在容器或专用账户中运行 jasper-recall:

  • 降低意外数据暴露的风险
  • 将私有内存与共享上下文分离
  • 推荐用于涉及不可信代理的多代理设置

故障排除

"未找到索引"

index-digests  # Create the index first

"未找到集合"

rm -rf ~/.openclaw/chroma-db  # Clear and rebuild
index-digests

模型下载缓慢首次运行会下载约80MB的模型。后续运行是即时的。

链接

免责申明
部分文章来自各大搜索引擎,如有侵权,请与我联系删除。
打赏
文章底部电脑广告
手机广告位-内容正文底部

相关文章

您是本站第349351名访客 今日有175篇新文章/评论