From grimoire
Builds or rebuilds a semantic search index over registered libraries using local vector embeddings (FastEmbed) and Qdrant. Useful for making library content searchable by meaning, not just exact text matches.
How this skill is triggered — by the user, by Claude, or both
Slash command
/grimoire:librarian-indexThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Build or rebuild the semantic search index over all registered libraries.
Build or rebuild the semantic search index over all registered libraries.
Text-based grep finds exact strings. Vector search finds meaning. When a
researcher asks "how does reentrancy work in pull-payment patterns?" a grep
for reentrancy may miss a file that discusses it under a different term. By
storing library content as vector embeddings, the librarian can retrieve
relevant chunks even when the exact words don't match.
The indexing pipeline is a single Python script (scripts/index.py) that:
~/.grimoire/librarian/library/libraries.yaml~/.grimoire/librarian/qdrant/Chunks get deterministic IDs derived from their content hash, so re-running the index overwrites rather than duplicates. This makes the skill fully idempotent.
Dependencies are declared inline in the script via PEP 723 metadata. Running
with uv run handles everything automatically — no manual pip install
needed. Since the plugin already requires uvx (for MCP servers), uv is
guaranteed to be available.
When this skill is activated, create a todo list from the following steps:
- [ ] 1. Run the indexer — execute index.py via uv run
- [ ] 2. Report — relay the script's output to the user
The script is located at skills/librarian-index/scripts/index.py inside the
plugin directory.
Index all libraries (default):
uv run /path/to/grimoire/skills/librarian-index/scripts/index.py index
Index a single library:
uv run /path/to/grimoire/skills/librarian-index/scripts/index.py index_library \
<library_dir> <library_name> <source_url>
Optional flags (apply to both commands):
| Flag | Default | Description |
|---|---|---|
--qdrant_path | ~/.grimoire/librarian/qdrant | Path to local Qdrant database |
--collection | grimoire-library | Qdrant collection name |
--embedding_model | sentence-transformers/all-MiniLM-L6-v2 | FastEmbed model |
--extensions | .md,.sol,.py,.js,.ts,.rs,.go,.txt | File extensions to include |
--max_file_size_kb | 200 | Skip files larger than this |
The first run will download the embedding model (~80 MB). Subsequent runs reuse the cached model.
Relay the script's stdout to the user. The script prints a per-library summary and a total chunk count. If errors occurred (missing directories, unknown library types), they appear at the bottom.
Remind the user to run librarian-index again after adding or updating
libraries with modify-library.
libraries.yaml or any file inside the libraries.[library-name] path/to/file so search results
self-identify their origin.npx claudepluginhub joranhonig/grimoireSemantic search across indexed knowledge bases using Qdrant vector similarity. Returns ranked results with source metadata for citation. Used by librarian agent for research queries.
Initializes qmd semantic search in existing secondbrain projects by validating setup, creating config and index directory, updating gitignore, and building document embeddings.
Searches documents, codebases, and knowledge bases using BM25 keyword, semantic vector, hybrid, graph, and multi retrieval modes for dependencies, relationships, and references.