/zotero-rag:zotero-ragfrom zotero-rag
Semantic search across local markdown papers using sentence-transformers and ChromaDB. Index, search by meaning, find similar passages, and expand context.
Ships in zotero-rag. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Script paths below are relative to this skill's base directory ($SKILL_DIR), which Claude Code reports when the skill loads.
Semantic search over your local library of markdown-converted papers using sentence-transformers embeddings and ChromaDB.
ingest.py (which converts to markdown, organizes files, and adds metadata to references.bib)references.bib with md_path fields linking citation keys to markdown filesImportant: Only files registered in references.bib are indexed. Loose markdown files in library/markdown/ without a bib entry will be flagged as "unlinked" during indexing. Run ingest.py to register them.
# Index your library (first time or after adding papers)
uv run "$SKILL_DIR"/scripts/rag.py index
# Search by meaning
uv run "$SKILL_DIR"/scripts/rag.py search "cultural capital and educational attainment"
All commands use:
uv run "$SKILL_DIR"/scripts/rag.py <command>
Dependencies (sentence-transformers, chromadb) are auto-installed by uv on first run via PEP 723 inline metadata. No manual installation needed.
Build or update the vector index from library/markdown/ files.
# Index all markdown files (incremental — skips unchanged files)
uv run "$SKILL_DIR"/scripts/rag.py index
# Index specific citation keys only
uv run "$SKILL_DIR"/scripts/rag.py index --keys Smith2020_Cultural Jones2019_Institutional
The index is stored at library/.rag-index/. First run downloads the all-MiniLM-L6-v2 embedding model (~80MB, cached by sentence-transformers).
Run this after adding new papers to keep the index current.
Semantic search across all indexed documents. Returns JSON lines ranked by similarity.
uv run "$SKILL_DIR"/scripts/rag.py search "social movements and collective identity"
uv run "$SKILL_DIR"/scripts/rag.py search "interview methodology" --top-k 5
uv run "$SKILL_DIR"/scripts/rag.py search "Bourdieu field theory" --min-score 0.3
Each result includes: chunk_id, citation_key, section_title, score, text (truncated), plus title, author, year from references.bib.
Find passages similar to a given chunk (from search results).
uv run "$SKILL_DIR"/scripts/rag.py similar <chunk_id>
uv run "$SKILL_DIR"/scripts/rag.py similar abc123def456 --top-k 5
Use this to explore thematic connections: find a relevant passage via search, then use similar to discover related content across other papers.
Show the full context around a chunk — the target chunk plus surrounding chunks from the same document.
uv run "$SKILL_DIR"/scripts/rag.py context <chunk_id>
uv run "$SKILL_DIR"/scripts/rag.py context abc123def456 --window 3
Returns the target chunk and neighboring chunks (default: 2 on each side), so you can read the passage in its original context.
Show index statistics: number of documents, chunks, and last modified time.
uv run "$SKILL_DIR"/scripts/rag.py status
List all indexed documents with chunk counts.
uv run "$SKILL_DIR"/scripts/rag.py list
Remove a document from the index by citation key.
uv run "$SKILL_DIR"/scripts/rag.py remove Smith2020_Cultural
library/markdown/ (run ingest.py for each PDF/EPUB)uv run rag.py index to build the indexuv run rag.py search "your topic"uv run "$SKILL_DIR"/scripts/ingest.py --file paper.pdfuv run "$SKILL_DIR"/scripts/rag.py indexuv run "$SKILL_DIR"/scripts/ingest.py --file paper.pdf --citekey ExistingKey2022 --updateuv run "$SKILL_DIR"/scripts/rag.py indexsearch "concept or question"context <chunk_id>similar <chunk_id>source_file path from results| Need | Tool |
|---|---|
| Conceptual/semantic search (find passages about a concept even if they don't use the exact words) | rag.py search |
| Exact keyword/phrase search (find specific terms, author names, method names) | grep library/markdown/ |
| Metadata search (by author, year, journal) | grep references.bib |
Both approaches complement each other. Use semantic search for exploratory discovery and grep for precise retrieval.
all-MiniLM-L6-v2 (384 dimensions, same as old Zotero RAG)library/.rag-index/## headers (section-level); fallback to ~512-token fixed chunks for headerless documentsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
rag, semantic-search, chromadb, sentence-transformers, paper-indexing
npx claudepluginhub nealcaren/social-data-analysis --plugin zotero-ragOther plugins' skills for the same job