返回顶部
z

zotero-vectorizeZotero向量化

Build and maintain a cross-platform local Zotero semantic index using metadata embeddings and PDF full-text chunk embeddings. Use when the user asks to vectorize a Zotero library, create or refresh metadata_vectors.json or fulltext_vectors.json, check for new Zotero items missing from the vector store, incrementally update a Zotero semantic/RAG index, verify vector store counts and sizes, or reproduce this workflow on Windows, macOS, or Linux.

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

zotero-vectorize

Zotero 向量化

构建并维护一个本地优先、跨平台的 Zotero 向量存储,用于对文献元数据和 PDF 全文进行语义搜索和 RAG。

保持 SKILL.md 专注于工作流程。仅在需要时读取参考文件:

  • - references/config.md — 路径、环境变量、输出布局
  • references/data-format.md — JSON 模式和文件命名规则
  • references/windows.md / macos.md / linux.md — 特定平台的路径默认值和说明
  • references/troubleshooting.md — 常见故障和恢复方法

核心规则

  • - 将 Zotero 视为只读输入。切勿修改用户的 Zotero 数据库或附件存储。
  • 在读取前,优先创建数据库快照
  • 对于增量更新:先检查,报告缺失条目,等待用户确认,再执行
  • 在任何会重写存储文件的更新之前:先备份,再写入
  • 本技能的备份保留策略固定:每个文件仅保留最新和上一个备份
  • 默认输出文件名:
- metadata_vectors.json - fulltext_vectors.json - vectorstoremetadata.json

工作流程决策树

1) 检测或确认路径

如果 Zotero 数据目录、数据库路径或存储路径未知:

  1. 1. 读取 references/config.md
  2. 读取特定平台的参考文件(windows.md、macos.md 或 linux.md)
  3. 运行:

bash
python scripts/detectzoteropaths.py

如果检测到的路径错误,请让用户打开 Zotero 并使用显示数据目录功能,然后使用显式的 --data-dir、--db 或 --storage-dir 参数重新运行。

2) 创建数据库快照

在完整构建或增量检查之前,创建 Zotero 数据库的快照:

bash
python scripts/snapshotzoterodb.py --output-dir

如果由于 SQLite 被锁定而导致快照失败,请让用户关闭 Zotero 并重试。

3) 构建元数据向量存储

当用户要求为 Zotero 库创建或重建元数据嵌入时使用此步骤。

bash
python scripts/buildmetadatavectors.py --output-dir

此操作会写入 metadatavectors.json,并刷新 vectorstore_metadata.json 和 README.md。

4) 构建全文向量存储

当用户要求创建或重建 PDF 全文嵌入时使用此步骤。

bash
python scripts/buildfulltextvectors.py --output-dir

此操作会扫描 Zotero PDF 附件,提取文本,进行分块,对每个块进行嵌入,并写入 fulltext_vectors.json。

5) 检查增量更新

当用户询问 Zotero 是否包含尚未添加到向量存储的新条目时使用此步骤。

bash
python scripts/checkincrementalupdates.py --output-dir

报告:

  • - Zotero 顶层条目总数
  • 包含 PDF 的父条目总数
  • 当前元数据/全文向量数量
  • 缺失的元数据条目
  • 缺失的全文条目

不要更新存储。

6) 执行增量更新

仅在用户确认更新后运行此步骤。

bash
python scripts/applyincrementalupdates.py --output-dir

此脚本会:

  1. 1. 创建数据库快照
  2. 备份存储文件
  3. 追加缺失的元数据/全文条目
  4. 每个文件仅保留最新和上一个备份
  5. 更新存储元数据和 README

如果用户希望部分应用,可使用 --item-id 将更新限制为特定条目。

7) 验证完成的存储

在任何构建或增量更新之后,验证数量和大小:

bash
python scripts/verifyvectorstore.py --output-dir

始终报告:

  • - 元数据条目数量
  • 全文条目数量
  • 全文块数量
  • 元数据文件大小
  • 全文文件大小

脚本

  • - scripts/detectzoteropaths.py — 解析默认/当前的 Zotero 路径
  • scripts/snapshotzoterodb.py — 创建安全的 SQLite 快照
  • scripts/buildmetadatavectors.py — 完整重建元数据向量
  • scripts/buildfulltextvectors.py — 完整重建 PDF 全文向量
  • scripts/checkincrementalupdates.py — 比较 Zotero 与当前向量存储
  • scripts/applyincrementalupdates.py — 在用户确认后追加缺失条目
  • scripts/backupwithretention.py — 备份存储文件,仅保留最新的两个状态
  • scripts/verifyvectorstore.py — 报告数量、大小和存储元数据

输出预期

成功使用此技能时,返回简洁的操作摘要,例如:

  • - 检测到的路径
  • 使用的快照路径
  • 写入的条目/块数量
  • 当前文件大小
  • 是否有缺失的条目
  • 增量更新期间追加了哪些 itemID

升级说明

在以下情况读取 references/troubleshooting.md:

  • - SQLite 快照失败
  • HuggingFace/模型下载或本地模型加载失败
  • PDF 缺失或无法读取
  • 全文提取不完整
  • 文件路径与当前操作系统的默认值不同

标签

skill ai

通过对话安装

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

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 zotero-vectorize-1776184563 技能

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

设置 SkillHub 为我的优先技能安装源,然后帮我安装 zotero-vectorize-1776184563 技能

通过命令行安装

skillhub install zotero-vectorize-1776184563

下载

⬇ 下载 zotero-vectorize v0.1.0(免费)

文件大小: 21.25 KB | 发布时间: 2026-4-15 12:35

v0.1.0 最新 2026-4-15 12:35
- Initial release of zotero-vectorize.
- Build and maintain a local, cross-platform Zotero semantic index using embeddings for metadata and PDF full-text chunks.
- Strictly read-only input from Zotero; no modifications to user data.
- Comprehensive, step-by-step workflow for builds, incremental updates, backups, and verification.
- Detailed integration with reference files per platform and troubleshooting guidance.
- Automated reporting of counts, file sizes, and operational summaries after actions.

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

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

p2p_official_large
返回顶部