← 返回
AI智能 Key 中文

Zettel Link

This skill maintains the Note Embeddings for Zettelkasten, to search notes, retrieve notes, and discover connections between notes.
此技能维护Zettelkasten的笔记嵌入,用于搜索、检索笔记并发现笔记之间的关联。
hxy9243
AI智能 clawhub v1.1.3 1 版本 99890.7 Key: 需要
★ 0
Stars
📥 914
下载
💾 21
安装
1
版本
#latest

概述

Zettel Link Skill

This skill provides a suite of idempotent Python scripts to embed, search, and link notes in an Obsidian vault using semantic similarity. All scripts live in scripts/ and support multiple embedding providers.

The skill should be triggered when the user wants to search notes, retrieve notes, or discover connections between notes.

If the search directory is indexed with embeddings, the skill should prompt the user if they want to create new embeddings.

Dependencies

  • uv 0.10.0+
  • Python 3.10+
  • One of the following embedding providers:
  • Ollama with mxbai-embed-large (local, default)
  • OpenAI API with text-embedding-3-small
  • Google Gemini API with text-embedding-004

Overview of Commands

  • uv run scripts/config.py: Configure the embedding model and other settings.
  • uv run scripts/embed.py: Embed notes and cache to .embeddings/embeddings.json
  • uv run scripts/search.py: Semantic search over embedded notes
  • uv run scripts/link.py: Discover semantic connections, output to .embeddings/links.json

Workflow

Step 0 — Setup and Config

If the config/config.json file does not exist, create it:

uv run scripts/config.py

This creates config/config.json with defaults:

{
    "model": "mxbai-embed-large",
    "provider": {
        "name": "ollama",
        "url": "http://localhost:11434"
    },
    "max_input_length": 8192,
    "cache_dir": ".embeddings",
    "default_threshold": 0.65,
    "top_k": 5,
    "skip_dirs": [".obsidian", ".trash", ".embeddings", "Spaces", "templates"],
    "skip_files": ["CLAUDE.md", "Vault.md", "Dashboard.md", "templates.md"]
}

To use a remote provider:

# OpenAI
uv run scripts/config.py --provider openai

# Gemini
uv run scripts/config.py --provider gemini

# Custom model
uv run scripts/config.py --provider openai --model text-embedding-3-large

To adjust tuning parameters:

uv run scripts/config.py --top-k 10 --threshold 0.7 --max-input-length 4096

Step 1 — Create Embeddings

uv run scripts/embed.py --input <directory>

This creates /.embeddings/embeddings.json with the embedding cache.

  • Incremental updates: Only re-embeds files that have been modified since the last run (based on file modification time).
  • Text truncation: Automatically truncates text to max_input_length before embedding.
  • Stale pruning: Removes entries for files that no longer exist.
  • Force re-embed: Use --force to re-embed everything.

Step 2 — Semantic Search

uv run scripts/search.py --input <directory> --query "<query>"

This embeds the query using the configured provider and compares it with all cached embeddings, returning the top_k most similar notes.

Results are saved to /.embeddings/search_results.json.

Step 3 — Semantic Connection Discovery

uv run scripts/link.py --input <directory>

This computes cosine similarity for all note pairs and outputs connections above the default_threshold to /.embeddings/links.json.

The output includes:

  • A flat list of all link pairs with scores
  • A per-note grouping for easy lookup

Tuning: Adjust --threshold to widen or narrow the connection discovery.

Cache

  • Format: JSON with metadata envelope (metadata + data)
  • Location: /.embeddings/embeddings.json
  • Metadata: Tracks generation timestamp, model, provider, embedding size
  • Invalidation: Based on file modification time (mtime)
  • Force rebuild: Delete the cache file or use --force flag

Agent Instructions

When using this skill:

  1. Always run config.py first if config/config.json does not exist.
  2. Run embed.py before search.py or link.py — the cache must exist.
  3. For remote providers (openai, gemini), ensure the API key environment variable is set (or provide a local .env file in the skill directory).
  4. All scripts are idempotent and safe to re-run.

版本历史

共 1 个版本

  • v1.1.3 当前
    2026-03-29 11:08 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,362 📥 318,869
ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误和纠正,以实现持续改进。使用时机:(1)命令或操作意外失败;(2)用户纠正……
★ 4,060 📥 798,766
ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 714 📥 244,051