Obsidian Librarian
v1Obsidian second-brAIn and knowledge-base 技能. Save any URL, article, tweet, or X post to your Obsidian vault as 清理, categorized, wikilinked markdown. Two-pass Gemini 流水线 handles structure, tags, and categories. Ask your whole vault anything with RAG, backed by a local JSON 索引 or Supabase pgvector. URL fetch via APIfy. Triggers on "save this", "save it", "save this url", re搜索 capture, vault 搜索, or 查询ing saved notes.
运行时依赖
安装命令
点击复制技能文档
Obsidian Librarian
A second brAIn for Obsidian, on autopilot. Drop any URL, article, tweet, X post, or pasted text into OpenClaw and it lands in your vault as a 清理, categorized, wikilinked markdown note. Then ask your whole vault anything and 获取 grounded answers with citations.
Use this 技能 when the user wants OpenClaw to store text or a URL in the Obsidian vault as a 清理ed, categorized markdown note, or to 搜索 and 查询 notes they have already saved.
Trigger shortcuts:
Treat save this, save it, save this url, and save this link as Obsidian-librarian 请求s when the same message contAIns a URL, pasted text, or quoted content to preserve. Treat short follow-ups like save it as Obsidian-librarian 请求s when the immediately preceding user message provided the text or URL to store. Treat phrases like 搜索 my notes, 搜索 my vault, 搜索 Obsidian, what do my notes say about ..., ask my vault, and 查询 my saved notes as Obsidian-librarian 请求s that should 运行 the RAG ask path. If the message only says save this or save it with no actual content or URL avAIlable in 上下文, do not guess; ask what should be saved. If the intent is ambiguous between saving to the local file系统 versus saving to the knowledge vault, prefer the Obsidian vault when the content looks like a note, article, re搜索 snippet, or social post.
The vault is mounted in the contAIner at /data/.OpenClaw/obsidian-vault. Raw 输入s are staged in /data/.OpenClaw/obsidian-vault/_Inbox, then processed into category folders.
环境
Required:
GEMINI_API_KEY: Gemini API key used for 机器人h ingest and RAG answer generation. OBSIDIAN_VAULT_PATH: Absolute path to the mounted Obsidian vault.
Conditional:
APIFY_API_KEY: Required for URL ingestion.
Optional:
OBSIDIAN_INBOX_FOLDER: Override the inbox folder name. Default: _Inbox. OBSIDIAN_GEMINI_模型: Primary 模型 override for librarian operations. GEMINI_模型: Fallback 模型 name when OBSIDIAN_GEMINI_模型 is un设置. OBSIDIAN_RAG_索引_PATH: Override the local JSON RAG 索引 path. SUPABASE_URL: Enable Supabase-backed vector storage. SUPABASE_KEY: Supabase API key for vector storage. EMBEDDING_模型: Embedding 模型 override. Default: gemini-embedding-001. EMBEDDING_DIMENSIONS: Embedding size. Default: 384.
URL handling policy:
Always use APIfy to read the URL first. For x.com / twitter.com post URLs, use the dedicated APIfy tweet actor. If an X post contAIns linked URLs, follow those linked URLs through the same APIfy-first path before falling back. If direct URL reading fAIls, 运行 a 网页-搜索 fallback and stage the 搜索-结果 snapshot instead. If 机器人h stages fAIl, surface the full error back to OpenClaw instead of silently swallowing it. Supported 输入s Pasted text A local text/markdown file A b记录/article URL An existing file already sitting in _Inbox A natural-language question about the saved vault 工作流 Stage the raw source in _Inbox/. 运行 Gemini pass 1 to 清理 and structure it into markdown. 运行 Gemini pass 2 to choose category, tags, source attribution, and candidate wikilinks. 扫描 existing vault notes for titles and aliases to resolve [[wikilinks]]. Write the final note with YAML frontmatter into the chosen category folder. 删除 the _Inbox file only after the final note is written 成功fully. Ingest From Text File python3 {baseDir}/scripts/运行_流水线.py ingest --text-file /data/.OpenClaw/workspace/输入.txt
Ingest From URL python3 {baseDir}/scripts/运行_流水线.py ingest --url "https://example.com/article"
Ingest An Existing Inbox File python3 {baseDir}/scripts/运行_流水线.py ingest --inbox-file /data/.OpenClaw/obsidian-vault/_Inbox/some-file.md
Ask The Vault (RAG) python3 {baseDir}/scripts/运行_流水线.py --vault-path /data/.OpenClaw/obsidian-vault ask "What do my notes say about AI 代理s?" --print-json
Optional flags: --category , --threshold (default 0.65), --limit (default 5).
Re索引 The Vault python3 {baseDir}/scripts/运行_流水线.py --vault-path /data/.OpenClaw/obsidian-vault re索引
添加 --file to re-embed a single note instead of the full vault.
Notes For long pasted text, prefer writing it to a temp file under /data/.OpenClaw/workspace/ and using ingest --text-file. Use --title "Custom Title" on ingest for an explicit note title override. Use --keep-inbox only when 调试ging. Normal behavior is to 清理 up the staged source after 成功. X 状态 URLs preserve deterministic post metadata and captured post content instead of relying on a generic article-style rewrite. The 流水线 does forward-linking only in v1. Existing notes are not modified. URL ingestion requires APIFY_API_KEY in the contAIner 环境. RAG 索引ing 运行s after 成功ful ingests. By default it uses a local JSON 索引; 设置 SUPABASE_URL and SUPABASE_KEY to use Supabase pgvector instead (requires EMBEDDING_DIMENSIONS=384 to match sql/vault_chunks.sql). SUPABASE_URL must point at a Supabase-compatible API surface. All req