← Back to Skills Marketplace
sebrinass

Diary Search

by sebrinass · GitHub ↗ · v1.1.2 · MIT-0
cross-platform ✓ Security Clean
434
Downloads
1
Stars
2
Active Installs
4
Versions
Install in OpenClaw
/install diary-search
Description
检索日记与会话内容,支持中文分词、BM25搜索、时间衰减排序。可搜索日记、查找历史对话(含归档)、导出会话记录(自动过滤噪音,3天后自动清理)、查询定时任务运行记录。
README (SKILL.md)

Diary Search

日记与会话检索插件,搜索 OpenClaw 记录的日记内容和历史对话。

源代码: GitHub | npm: diary-search

安装步骤

第一步:安装插件

npm install -g diary-search

第二步:更新配置

~/.openclaw/openclaw.jsonplugins.load.paths 中添加:

"~/.npm-global/lib/node_modules/diary-search"

完整示例:

{
  "plugins": {
    "enabled": true,
    "load": {
      "paths": [
        "~/.npm-global/lib/node_modules/diary-search"
      ]
    }
  }
}

第三步:重启 Gateway

openclaw gateway restart

使用方法

安装完成后,直接对我说:

日记搜索

搜索我上周关于"项目架构"的日记
搜索 2026-02 月关于"数据库优化"的讨论
查找昨天提到的"bug"
查看我的日记统计

会话检索

列出昨天的会话
列出 2026-03-03 的会话
搜索我之前说的"webchat"
导出会话 77762d1f 的对话内容

定时任务查询

查看最近 7 天的定时任务运行记录
查看 xiaobu 的定时任务

工具说明

日记工具

diary_search

搜索日记内容。

参数 类型 必填 说明
query string 搜索关键词
limit number 返回条数,默认 5
time_filter string 时间过滤器

time_filter 可选值:

  • today / yesterday / last_week / last_month / this_month
  • YYYY-MM(如 2026-02)
  • YYYY-MM-DD(如 2026-02-28)

diary_stats

获取日记统计信息。

会话工具

session_list_by_date

按日期列出会话文件。

参数 类型 必填 说明
date string 日期(today/yesterday/YYYY-MM-DD/YYYY-MM)
agent string Agent 名称,默认 xiaobu

注意:自动过滤定时任务会话,只显示正常对话。

session_search

搜索会话消息内容。

参数 类型 必填 说明
query string 搜索关键词
date string 日期过滤,默认最近 30 天
limit number 返回条数,默认 5
agent string Agent 名称,默认 xiaobu

特性

  • 默认搜索最近 30 天的会话(包括已归档的会话)
  • 如需搜索更早内容,请指定 date 参数
  • 自动过滤心跳检查消息

session_export

导出会话的纯对话文本(自动过滤噪音,只保留时间+正文)。

参数 类型 必填 说明
session_id string 会话ID(可以是前缀)
agent string Agent 名称,默认 xiaobu
include_thinking boolean 是否包含 AI 思考过程,默认 false

特性

  • 自动过滤心跳检查消息
  • 自动剥离记忆注入块(\x3Crelevant-memories>)、系统元数据、工具输出等噪音
  • 导出文件保存至 {工作区}/memory/exports/ 目录
  • 文件名格式:YYYY-MM-DD-HHmmss-会话导出-标题.md
  • 文件头部含 YAML 元数据(含过期时间,默认 3 天后自动清理)
  • 兼容 memory-lancedb-pro 和 OpenClaw 原版记忆插件

定时任务工具

cron_list_runs

列出定时任务的运行记录。

参数 类型 必填 说明
days number 查询最近多少天,默认 7
agent string 过滤指定 agent 的定时任务

返回内容

  • 运行时间
  • 任务名称
  • 状态(ok/error)
  • 耗时
  • Agent 名称
  • 会话 ID(可直接跳转查看详情)
  • 执行摘要

日记格式

支持 .md.txt.markdown 文件,文件名建议使用 YYYY-MM-DD.md 格式。

清理工具

diary_cleanup

扫描并清理会话目录中的 checkpoint 备份文件。checkpoint 是 OpenClaw 在会话出错/中断时自动创建的快照,内容与原会话完全重复,删除不影响正常对话记录。

参数 类型 必填 说明
agent string Agent 名称,默认 xiaobu
dry_run boolean 仅扫描不删除(默认 true)

使用流程

  1. 先调用 diary_cleanup(dry_run=true) 扫描,查看将删除的文件列表和大小
  2. 向用户确认后,再调用 diary_cleanup(dry_run=false) 执行删除
  3. ⚠️ 删除前必须向用户确认!

自动行为:会话检索时已自动跳过 checkpoint 文件,无需手动排除。

Usage Guidance
This skill is coherent with its stated purpose, but take these precautionary steps before installing: - Inspect the npm package and its GitHub repo (authors, recent commits, install scripts) before running npm install -g. - Prefer a local or isolated install (or review package code) rather than a global install if you have doubts. - Backup ~/.openclaw/agents/*/sessions and ~/.openclaw/memory before enabling the plugin, since it can read and (with cleanup enabled) delete checkpoint files. - Confirm whether you want a plugin that can read all agent session histories and write exports — this exposes conversation data; limit access if needed. - After installation, verify export storage path and automated cleanup policy (3-day expiry) to ensure it matches your expectations. - If you need higher assurance, ask the developer for a signed release or audit the package contents locally before enabling it in your gateway.
Capability Analysis
Type: OpenClaw Skill Name: diary-search Version: 1.1.2 The diary-search skill provides tools for searching and managing OpenClaw diary entries, session histories, and cron job logs. It requests read/write access to specific OpenClaw data directories (~/.openclaw/) to facilitate features like session exporting and the cleanup of redundant checkpoint files. The requested permissions and tool behaviors described in SKILL.md are consistent with the stated purpose, and the documentation includes explicit safety instructions requiring user confirmation before the agent performs any file deletions.
Capability Assessment
Purpose & Capability
The name/description (diary & session search, exports, cron run logs) aligns with the filesystem paths and config it requests: reading diary memory, reading archived sessions, writing export files, and reading cron logs. The install via npm is consistent with a JS-based OpenClaw plugin.
Instruction Scope
SKILL.md instructions stay within the stated purpose (search, list, export, cleanup). It explicitly asks user to add the npm global install path to ~/.openclaw/openclaw.json and restart the gateway — a normal install step but one that changes agent configuration. It also documents deletion (diary_cleanup) and states a confirm/ dry-run workflow, which is good. Minor inconsistency: export path is described as {工作区}/memory/exports in the prose while metadata lists ~/.openclaw/memory/exports.
Install Mechanism
Install spec uses npm package 'diary-search' (and a ClawHub slug). Installing an npm package globally (npm install -g) may run package install scripts and places code on disk; this is expected for a plugin but carries the usual npm risk—inspect the package and maintainers before global install. No obscure download URLs are used.
Credentials
No environment variables or external credentials are requested (good). However the plugin requests read access to all agent session directories (~/.openclaw/agents/*/sessions) and read-write access there to perform checkpoint cleanup. That level of access is functionally justified by a cross-agent search/cleanup tool but is sensitive (can read full conversation history and delete backups). Confirm you want a plugin to access all agents' histories.
Persistence & Privilege
always is false and autonomous invocation is allowed (platform default). The install modifies OpenClaw plugin load paths per instructions — this is normal for adding a plugin. The skill does not request global 'always' or system-wide privileged settings beyond updating OpenClaw's plugin paths.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install diary-search
  3. After installation, invoke the skill by name or use /diary-search
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.1.2
新增功能: - diary_cleanup 工具:扫描并清理会话 checkpoint 备份文件(先dry_run预览再删除) - 会话检索自动跳过 checkpoint 文件,提升检索速度 修复了一些问题
v1.1.1
- 新增会话检索与导出功能,支持搜索和导出历史对话内容 - 插件描述和文档更新,覆盖日记与会话两类数据检索场景 - 增加 session_list_by_date、session_search、session_export 等会话相关工具说明 - 原有日记检索、统计功能保持不变
v1.0.1
添加源代码和 npm 链接,解决安全警告
v1.0.0
- Initial release of diary-search! - Provides full-text diary search with Chinese word segmentation, BM25 ranking, and time-decay sorting. - Supports queries filtered by date (e.g., today, yesterday, last week, or specific dates). - Includes diary statistics query. - Compatible with `.md`, `.txt`, `.markdown` diary files. - Easy installation and integration with OpenClaw.
Metadata
Slug diary-search
Version 1.1.2
License MIT-0
All-time Installs 2
Active Installs 2
Total Versions 4
Frequently Asked Questions

What is Diary Search?

检索日记与会话内容,支持中文分词、BM25搜索、时间衰减排序。可搜索日记、查找历史对话(含归档)、导出会话记录(自动过滤噪音,3天后自动清理)、查询定时任务运行记录。 It is an AI Agent Skill for Claude Code / OpenClaw, with 434 downloads so far.

How do I install Diary Search?

Run "/install diary-search" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Diary Search free?

Yes, Diary Search is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Diary Search support?

Diary Search is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Diary Search?

It is built and maintained by sebrinass (@sebrinass); the current version is v1.1.2.

💬 Comments