Jasper Recall:AI 智能体本地 RAG 与持久化记忆 - Openclaw Skills

作者:互联网

2026-04-13

AI教程

什么是 Jasper Recall?

Jasper Recall 是一个强大的本地检索增强生成 (RAG) 系统,旨在为 AI 智能体提供功能性记忆。通过利用 ChromaDB 和 sentence-transformers,它使智能体能够索引、存储和检索过往对话、会话日志和 Markdown 笔记中的信息。这确保了智能体能够长期保持上下文,使其成为开发者使用 Openclaw Skills 构建复杂智能体时不可或缺的组件。

该系统完全在本地运行,使用 all-MiniLM-L6-v2 模型生成 384 维嵌入向量。这种架构提供了高性能的语义搜索,无需外部 API 调用,从而确保了数据隐私并降低了智能体交互期间的延迟。

下载入口:https://github.com/openclaw/skills/tree/main/skills/ttboy/ouyang

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install ouyang

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 ouyang。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

Jasper Recall 应用场景

  • 为跨多个会话的 AI 智能体提供持久的上下文检索。
  • 对日常开发者日志和项目文档进行语义搜索。
  • 从智能体活动中自动创建可搜索的知识库。
  • 在长期自主智能体工作流中保持连续性。
Jasper Recall 工作原理
  1. digest-sessions 工具处理原始智能体日志,以提取关键主题和工具使用数据。
  2. index-digests 命令对 Markdown 文件进行切片,并使用本地 transformer 模型生成向量嵌入。
  3. 嵌入向量和元数据存储在位于用户主目录中的本地 ChromaDB 实例中。
  4. recall 命令对向量数据库执行语义相似性搜索,以返回相关的上下文片段。

Jasper Recall 配置指南

要开始将此功能添加到您的 Openclaw Skills 中,请运行自动设置命令:

npx jasper-recall setup

此命令将初始化 Python 虚拟环境,设置 ChromaDB 数据库,并在您的本地路径中安装必要的 CLI 脚本。

Jasper Recall 数据架构与分类体系

Jasper Recall 在 ~/.openclaw/ 目录中组织其数据。索引内容的架构包括:

组件 路径 描述
记忆文件 ~/.openclaw/workspace/memory/*.md 每日笔记和核心记忆文件
会话摘要 ~/.openclaw/workspace/memory/session-digests/ 过往智能体交互的摘要
仓库文档 ~/.openclaw/workspace/memory/repos/ 为 RAG 索引的特定项目文档
向量数据库 ~/.openclaw/chroma-db 保存向量嵌入的 ChromaDB 实例

索引过程使用内容哈希,以确保数据库中仅更新已修改的文件。

name: jasper-recall
description: Local RAG system for agent memory using ChromaDB and sentence-transformers. Provides semantic search over session logs, daily notes, and memory files. Use when you need persistent memory across sessions, want to search past conversations, or build agents that remember context. Commands: recall "query", index-digests, digest-sessions.

Jasper Recall

Local RAG (Retrieval-Augmented Generation) system for AI agent memory. Gives your agent the ability to remember and search past conversations.

When to Use

  • Memory recall: Search past sessions for context before answering
  • Continuous learning: Index daily notes and decisions for future reference
  • Session continuity: Remember what happened across restarts
  • Knowledge base: Build searchable documentation from your agent's experience

Quick Start

Setup

One command installs everything:

npx jasper-recall setup

This creates:

  • Python venv at ~/.openclaw/rag-env
  • ChromaDB database at ~/.openclaw/chroma-db
  • CLI scripts in ~/.local/bin/

Basic Usage

Search your memory:

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

Index your files:

index-digests  # Index memory files into ChromaDB

Create session digests:

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

How It Works

Three Components

  1. digest-sessions — Extracts key info from session logs (topics, tools used)
  2. index-digests — Chunks and embeds markdown files into ChromaDB
  3. recall — Semantic search across your indexed memory

What Gets Indexed

By default, indexes files from ~/.openclaw/workspace/memory/:

  • *.md — Daily notes, MEMORY.md
  • session-digests/*.md — Session summaries
  • repos/*.md — Project documentation
  • founder-logs/*.md — Development logs (if present)

Embedding Model

Uses sentence-transformers/all-MiniLM-L6-v2:

  • 384-dimensional embeddings
  • ~80MB download on first run
  • Runs locally, no API needed

Agent Integration

Memory-Augmented Responses

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

Automated Indexing (Heartbeat)

Add to HEARTBEAT.md:

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

Cron Job

Schedule regular indexing:

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

CLI Reference

recall

recall "query" [OPTIONS]

Options:
  -n, --limit N     Number of results (default: 5)
  --json            Output as JSON
  -v, --verbose     Show similarity scores

index-digests

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

digest-sessions [OPTIONS]

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

Configuration

Custom Paths

Set environment variables:

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

Chunking

Default settings in index-digests:

  • Chunk size: 500 characters
  • Overlap: 100 characters

Troubleshooting

"No index found"

index-digests  # Create the index first

"Collection not found"

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

Model download slow First run downloads ~80MB model. Subsequent runs are instant.

  • GitHub: https://github.com/E-x-O-Entertainment-Studios-Inc/jasper-recall
  • npm: https://www.npmjs.com/package/jasper-recall
  • ClawHub: https://clawhub.ai/skills/jasper-recall

相关推荐