nealcaren/social-data-analysis/zotero-rag
Claude Code and agent skill by nealcaren/social-data-analysis
- community
Checking that the SKILL.md file is still in the repository.
Semantic search across your project's local library (library/markdown/). Index papers, search by meaning, find similar passages, and get expanded context. Replaces the deprecated Zotero RAG integration.
Install
npx vskill@latest install nealcaren/social-data-analysis/zotero-ragSKILL.md
Library RAG: Semantic Search
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.
Prerequisites
- uv installed (standard in this project)
- Papers ingested via
ingest.py(which converts to markdown, organizes files, and adds metadata toreferences.bib) references.bibwithmd_pathfields linking citation keys to markdown files
Important: 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.
Quick Start
Script Location
All commands use:
Dependencies (sentence-transformers, chromadb) are auto-installed by uv on first run via PEP 723 inline metadata. No manual installation needed.
Commands
Index
Build or update the vector index from library/markdown/ files.
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.
Search
Semantic search across all indexed documents. Returns JSON lines ranked by similarity.
Each result includes: chunk_id, citation_key, section_title, score, text (truncated), plus title, author, year from references.bib.
Similar
Find passages similar to a given chunk (from search results).
Use this to explore thematic connections: find a relevant passage via search, then use similar to discover related content across other papers.
Context
Show the full context around a chunk — the target chunk plus surrounding chunks from the same document.
Returns the target chunk and neighboring chunks (default: 2 on each side), so you can read the passage in its original context.
Status
Show index statistics: number of documents, chunks, and last modified time.
List
List all indexed documents with chunk counts.
Remove
Remove a document from the index by citation key.
Typical Workflows
First-time setup
- Ensure papers are in
library/markdown/(runingest.pyfor each PDF/EPUB) - Run
uv run rag.py indexto build the index - Search with
uv run rag.py search "your topic"
Adding new papers
- Ingest the paper:
uv run "$SKILL_DIR"/scripts/ingest.py --file paper.pdf - Update the index:
uv run "$SKILL_DIR"/scripts/rag.py index
Adding a PDF for a paper already in references.bib
- Ingest with update:
uv run "$SKILL_DIR"/scripts/ingest.py --file paper.pdf --citekey ExistingKey2022 --update - Update the index:
uv run "$SKILL_DIR"/scripts/rag.py index
Deep exploration
- Search for a topic:
search "concept or question" - Read context of a promising hit:
context <chunk_id> - Find similar passages across other papers:
similar <chunk_id> - Read the full paper if needed: open the
source_filepath from results
When to Use RAG vs. Grep
| 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.
Technical Details
- Embedding model:
all-MiniLM-L6-v2(384 dimensions, same as old Zotero RAG) - Vector store: ChromaDB with file-based persistence at
library/.rag-index/ - Chunking: Split by
##headers (section-level); fallback to ~512-token fixed chunks for headerless documents - Incremental indexing: Content hashes stored in metadata; unchanged files are skipped on re-index
- Output format: JSON lines for easy parsing by Claude or other tools
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/zotero-rag/skills/zotero-rag/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/nealcaren/social-data-analysis/zotero-rag)