hiivmind-corpus
A Claude Code plugin for shareable, linkable LLM knowledge bases. If you have been following Andrej Karpathy's LLM wiki idea or building Obsidian-based PKM setups, hiivmind-corpus is the productised version of that pattern — raw sources compiled into a curated, interlinked index — but any corpus can be published as a plain git repo and registered by anyone else with a single command, queryable remotely via gh api with sparse-cloned embeddings and cross-corpus bridges that link concepts across independently maintained knowledge bases. Every other tool in this space (ObsidianRAG, Neural Composer, obsidian-notes-rag, Karpathy's LLM wiki) is single-user, single-vault, local-only; this one enables your knowledge base to become a public library, not just a personal notebook.
Quick links: Using a Corpus | Building a Corpus | Semantic Search | Published Corpora
The Idea
Without structured indexing, Claude investigates libraries by relying on training data (outdated), web searching (hit-or-miss), or fetching URLs one at a time (no context). Every session rediscovers the same things.
A corpus solves this. You build a curated index once — collaboratively, around your actual use case — and Claude searches it across sessions. The index tracks where everything came from, how fresh it is, and uses semantic search to find relevant entries even when queries don't match exact keywords.
This follows the "just in time" context pattern from Anthropic: maintain lightweight identifiers, dynamically load content at runtime.
Getting Started
/hiivmind-corpus
One command, natural language:
| You say... | What happens |
|---|
| "Create a corpus for Polars" | Scaffolds a new corpus, clones docs |
| "What corpora do I have?" | Discovers all installed corpora |
| "How do lazy frames work?" | Searches your corpora with semantic + keyword matching |
| "Refresh my React corpus" | Checks for upstream changes, updates stale entries |
| "Add the TanStack Query docs" | Extends an existing corpus with new sources |
Installation
From the command line:
claude plugin marketplace add hiivmind/hiivmind-corpus
claude plugin add hiivmind-corpus@hiivmind
From within a Claude Code session:
/plugin marketplace add hiivmind/hiivmind-corpus
/plugin install hiivmind-corpus@hiivmind
Or use /plugin to browse and install interactively.
Using a Corpus
Most users start here — someone else built the corpus, you just want to query it.
1. Register a corpus with your project
/hiivmind-corpus register github:hiivmind/hiivmind-corpus-data/hiivmind-corpus-polars
This adds the corpus to your project's registry (.hiivmind/corpus/registry.yaml). Register as many as you need — they're lightweight references, not copies.
2. Ask questions
Just ask naturally. Claude routes your question to the right corpus:
"How do I filter rows in Polars?"
"What's the difference between select and with_columns?"
"Show me lazy frame optimization techniques"
Or be explicit: /hiivmind-corpus navigate polars "group by aggregations"
How navigation works
When you ask a question, the navigate skill:
- Routes to the right corpus — matches your query against registered corpora using semantic similarity (if embeddings are cached) or keyword matching
- Finds relevant entries — searches the corpus index using vector search with optional SQL filtering, boosted by concept graph relationships
- Fetches documentation — retrieves the actual content from the source repo via
gh api
- Presents the answer — with source citations and related doc suggestions
For remote GitHub corpora, embeddings are automatically cached locally on first query (~5 seconds, then instant on subsequent queries).
Check what you have
/hiivmind-corpus discover # List all available corpora
/hiivmind-corpus status # Check freshness and health
Cross-corpus queries
With 2+ corpora registered, you can create bridges — links between related concepts across corpora:
/hiivmind-corpus bridge # Detect and create cross-corpus links
Navigate then uses bridges and aliases to route queries that span multiple documentation sets. Search for "lazy evaluation" and it finds relevant entries in both Polars and Ibis.
Building a Corpus
If you want to create a new corpus from scratch — for a library, framework, or internal project.
Quick start
/hiivmind-corpus init # Scaffold from a GitHub repo
/hiivmind-corpus add-source # Add git repos, local files, web pages, PDFs
/hiivmind-corpus build # Scan sources, build index collaboratively