Crucible: LLM-Compiled Knowledge Base
Overview
Crucible is a personal knowledge base system where primary sources (papers, notebooks, data) are ingested and distilled by an LLM into a structured, interlinked org-mode wiki. The wiki is the LLM's domain: you rarely edit it directly. Instead, you converse with Claude, and it reads, writes, and maintains the wiki on your behalf.
The core idea, inspired by Andrej Karpathy's LLM knowledge base pattern, is that raw data from various sources is collected, then compiled by an LLM into a wiki of org-mode files, then operated on by various CLI commands to do Q&A and to incrementally enhance the wiki. Everything is viewable in Emacs via scimax.
Key design principles:
- Separation of concerns: primary sources (which may be copyrighted) are kept separate from distilled content (which is shareable).
- Org-mode native: all wiki articles use org-mode with scimax conventions, org-ref citations, properties drawers, and filetags.
- Graph database: a SQLite database tracks the relationships between sources, articles, concepts, and links, enabling structured queries that grep cannot do.
- Hybrid search: combines FTS5 keyword search with ollama vector embeddings for meaning-based retrieval, merged via reciprocal rank fusion.
- Interoperability: every crucible on a machine is listed in a global registry, so one can search the others (
search --all), and one crucible can be merged into another (crucible merge). - Knowledge evolution: derivation chains track how articles are synthesized from other articles over time.
Installation
From PyPI:
pip install crucible-llm
crucible --version
Or from source for development:
git clone https://github.com/jkitchin/crucible.git
cd crucible
pip install -e .
Then initialize a new crucible project and wire it into Claude Code:
cd /path/to/your/project
crucible init --root .
crucible install # installs Claude Code skill + CLAUDE.md directive
The install command does three things:
- Copies the skill into
~/.claude/skills/crucible/ - Generates a manifest summarizing the knowledge base contents
- Adds a directive to
~/.claude/CLAUDE.mdso agents know to check the crucible before answering domain-specific questions
init registers the project and installs the skill, but only install writes the ~/.claude/CLAUDE.md directive. There is one directive, so a new crucible does not take it over until you run install in it.
Re-running install (or update) keeps a copy of a skill file you have edited as SKILL.md.bak. To remove: crucible uninstall, which deletes only the files crucible installed.
Installing the skill with knowhow
The skill lives in skills/crucible/SKILL.md and follows the Agent Skills specification, so it can also be installed with knowhow (or npx skills) for Claude Code and other agents (VS Code, Codex, OpenCode, Gemini CLI, Cursor):
uvx knowhow add jkitchin/crucible --skill crucible # this project
uvx knowhow add jkitchin/crucible --skill crucible -g # global
# or: npx skills add jkitchin/crucible --skill crucible
The skill still needs the crucible CLI on your PATH. Installing it this way does not generate the manifest or the ~/.claude/CLAUDE.md directive, so run crucible install inside your project if you want those too. Contributors can check the skill with uvx knowhow validate ..
For semantic search, you also need ollama running with an embedding model:
ollama pull nomic-embed-text
crucible embed
Directory Layout
A crucible project keeps everything in a .crucible/ directory at its root:
your-project/
CLAUDE.md Conventions for agents working in the project
.gitignore Excludes crucible.db and sources/external/
.crucible/
crucible.db Wiki graph database (SQLite, regenerable)
references.bib Bibliography of ingested sources
sources/
external/ Copyrighted material (gitignored)
pdfs/ Academic papers, reports
web/ Web clippings
notebooks/ Your own ELN entries (shareable)
data/ Your own experimental data (shareable)
wiki/
index.org Auto-generated master index
MANIFEST.md Summary for agent discovery
concepts/ One topic per file
summaries/ One per ingested source
comparisons/ Cross-source analysis
methods/ Technique and methodology articles
The global registry of all crucibles on the machine is ~/.crucible/registry.json. Because ~/.crucible/ is the registry, the home directory itself cannot be a crucible project.
This repository holds the Python package (src/crucible/), the agent skill (skills/crucible/SKILL.md, Agent Skills spec), the documentation (docs/) and the tests (tests/).
Quick Start
See the tutorial for a complete walkthrough. The short version:
# Ingest a source
crucible ingest paper.pdf
# Or from the web
curl -sL "URL" | pandoc -f html -t org | crucible ingest - -t "Title" --type web
# Or a batch
crucible ingest "papers/*.pdf"
# Ask Claude to distill it
# (Claude reads the source, proposes articles, you approve, it writes them)
# Sync the database
crucible sync
# Generate embeddings for semantic search
crucible embed
# Search
crucible search "activation energy" # hybrid (auto)
crucible search "how does temperature affect rate" # finds by meaning
crucible search "catalyst" --mode fts # keyword only
# Navigate
crucible concepts # list all topics
crucible concept thermodynamics # articles on a topic
crucible backlinks concepts/activation-energy.org # paths: wiki-, root- or cwd-relative
crucible related concepts/activation-energy.org
crucible history comparisons/synthesis.org # derivation chain
# Maintain
crucible lint # find problems; exits 1 on errors (--strict: warnings too)
crucible suggest # find opportunities
crucible index # regenerate index
crucible publish # export as HTML site
crucible delete wiki/concepts/old.org # remove an article or source
crucible merge other-crucible # fold another crucible into this one
Documentation
The documentation is published at https://kitchingroup.cheme.cmu.edu/crucible/.
- Tutorial: step-by-step guide to ingesting your first source and building a wiki
- Command Reference: complete documentation for every CLI command
- Architecture: database schema, search algorithms, and design decisions
- Skill Guide: how the Claude Code skill works and how to customize it
Using Crucible with Claude Code
Crucible is designed to be used through Claude Code. After installation, Claude automatically knows about your knowledge base and uses it to answer questions, distill sources, and maintain the wiki.
Setup
Running crucible install does three things that wire crucible into Claude Code:
- Copies the crucible skill into
~/.claude/skills/crucible/, which teaches Claude how to ingest sources, write wiki articles, and navigate the graph database. - Generates
MANIFEST.md, a summary of the knowledge base contents that Claude reads to decide when the wiki is relevant. - Adds a directive to
~/.claude/CLAUDE.mdthat tells Claude to check the crucible before answering domain-specific questions.
The skill triggers automatically when you say things like "ingest this", "what do we know about", "search the wiki", "add to crucible", or "distill this source". You do not need to invoke it explicitly.
Typical Session
A typical conversation looks like this:
You: What do we know about activation energies on platinum surfaces?
Claude: [searches the wiki, reads relevant articles]
Based on the wiki, there are three articles covering this topic...
[synthesized answer with citations to wiki articles]
You: Ingest this new paper [attaches PDF]
Claude: [registers the source, reads it, proposes articles]
I found three key findings. I propose:
- Update the activation-energy concept article with the new data
- Create a summary article for this paper
Shall I proceed?
You: Yes
Claude: [writes the articles, runs crucible sync]
Done. Created wiki/summaries/smith2026.org and updated
wiki/concepts/activation-energy.org with the new measurements.
You: That comparison you just made between the two papers is interesting.
Capture that as an article.
Claude: [writes a comparison article with DERIVED_FROM properties]
The key insight is that your explorations accumulate. Every question you ask, every source you ingest, and every insight you capture makes the knowledge base richer for next time.
Browsing Outside Claude Code
You can also browse the wiki in a web browser:
crucible browse
This launches a local HTTP server that renders org-mode articles as HTML with working cross-links, citation tooltips, and a navigable sidebar. The about page (/_about) shows project paths, statistics, and the global registry.
Use Cases
Literature Review for a Proposal
When preparing a grant proposal or review paper, you typically need to digest dozens of papers and synthesize them into a coherent narrative. Start by ingesting a batch of PDFs with crucible ingest "papers/*.pdf", then ask Claude to distill each one into summary and concept articles. As the wiki grows, crucible suggest identifies comparison opportunities where multiple summaries share concepts but no cross-source analysis exists yet. You can then ask Claude to write comparison articles that synthesize findings across papers, and use crucible search to quickly find what the wiki knows about specific topics. The result is a structured, citation-backed knowledge base you can query as you write, rather than a stack of annotated PDFs you have to re-read.
Lab Notebook as Living Knowledge
Experimental notebook entries often contain insights that only become valuable months later when a new experiment connects to an old one. By ingesting notebook entries with crucible ingest entry.org --type notebook, each experiment gets linked to concepts and cross-referenced with prior work. Over time, crucible related surfaces connections you might not have noticed: two experiments six months apart that share a concept, or a measurement that contradicts an earlier assumption. Running crucible viz produces a force-directed graph of your experimental knowledge, making clusters and gaps visible at a glance. When you synthesize insights across experiments, crucible history traces the derivation chain so you can always find which raw observations led to which conclusions.
Research Group Cross-Pollination
In a research group, each member works on their own project but the work often overlaps in ways nobody tracks. With crucible, each group member maintains their own instance on their own project directory. The PI registers all of them with crucible registry add student-name /path/to/their/crucible, and can then run crucible search "keyword" --all to query across every group member's knowledge base simultaneously. The results show which crucible each hit came from, making it easy to say "talk to Alex, they have three articles on that catalyst." Copyrighted sources stay local to each instance (they are gitignored), so only the distilled wiki content is visible to others.
Preparing for a Student Meeting
Before a one-on-one meeting with a student, a PI can use the student's crucible to quickly build context. Running crucible concepts shows what topics the student has been working on, while crucible orphans reveals articles that lack connections to the broader knowledge base, often a sign of under-explored directions. crucible lint flags undigested sources (papers the student ingested but never distilled), missing cross-links, and articles without proper metadata. crucible suggest goes further, recommending new concept articles for topics that appear across multiple summaries and identifying potential comparison articles. Together, these commands give the PI a structured picture of where the student's knowledge base is strong, where it has gaps, and what questions to ask.
How It Works
The Distillation Loop
The fundamental workflow is a loop:
- Ingest: bring in a primary source (PDF, web article, notebook entry, data)
- Distill: Claude reads the source and writes org-mode wiki articles
- Sync: the database is updated from the wiki files
- Query: search, navigate, and ask questions against the wiki
- Capture: conversation insights are written back as new articles
- Maintain: lint, suggest, and index to keep the wiki healthy
Each pass through the loop enriches the knowledge base. Your explorations and queries always "add up" in the crucible.
Source Types
| Type | Storage | Gitignored | Examples |
|---|---|---|---|
| sources/external/pdfs/ | Yes | Papers, reports | |
| web | sources/external/web/ | Yes | Blog posts, documentation |
| notebook | sources/notebooks/ | No | Your own ELN entries |
| data | sources/data/ | No | CSV, JSON, HDF5, images |
Article Types
| Type | Directory | Purpose |
|---|---|---|
| concept | wiki/concepts/ | Single topic or idea |
| summary | wiki/summaries/ | Distillation of one source |
| comparison | wiki/comparisons/ | Cross-source analysis |
| method | wiki/methods/ | Technique or methodology |
Each article has a properties drawer on its top heading with :ARTICLE_TYPE:, :SOURCE_KEYS: (the cite keys of its sources), :STATUS:, :CREATED: and :MODIFIED: (updated on every substantive edit). The database takes an article's dates from :CREATED: and :MODIFIED:, so a rebuild reproduces them.
Search Modes
Crucible offers three search modes, with auto (hybrid when embeddings exist, FTS otherwise) as the default:
- FTS: keyword search using SQLite FTS5 with porter stemming. Fast, exact.
- Semantic: vector similarity using ollama embeddings. Finds conceptually related content even without keyword overlap.
- Hybrid: combines both using Reciprocal Rank Fusion (RRF). Articles found by both methods rank highest. This is the default when embeddings exist.
Multiple Crucibles
Every crucible on the machine is recorded in the global registry (~/.crucible/registry.json), which crucible init and crucible sync keep up to date. Others can be added by hand and queried together:
crucible registry add lab-shared /path/to/shared/crucible
crucible registry add student /path/to/student/crucible
crucible registry list
crucible search "catalyst design" --all # searches everywhere
crucible concepts --all # unified concept list
Each crucible retains full independence. Queries run against separate database connections, so there is no risk of corrupting another crucible's data. To combine two crucibles for good, crucible merge copies another crucible's sources, articles and bibliography into this one; it refuses a crucible whose sources or bibliography entries repeat a cite key, which crucible lint reports so you can fix them first.
Knowledge Evolution
When Claude synthesizes insights from existing wiki articles during a conversation and you say "capture this as an article", the new article includes a :DERIVED_FROM: property listing the source articles. This creates a derivation chain in the database:
crucible history comparisons/my-synthesis.org
# Derived from:
# [concept] Activation Energy (wiki/concepts/activation-energy.org)
# [summary] Smith 2024 Results (wiki/summaries/smith2024.org)
You can also trace forward: "what has been derived from this article?"
Version Control
A crucible knowledge base is git-friendly. Commit .crucible/wiki/, .crucible/references.bib, .crucible/sources/notebooks/, and .crucible/sources/data/. crucible init writes this .gitignore at the project root (if there is none):
# Crucible: external sources (copyrighted, not shareable)
.crucible/sources/external/
# Crucible: database (regenerable from wiki via auto-rebuild)
.crucible/crucible.db
.crucible/crucible.db-wal
.crucible/crucible.db-shm
.crucible/crucible.db-journal
.crucible/.crucible.db.rebuild-*.tmp
# Crucible: lock file for references.bib
.crucible/references.bib.lock
# Crucible: publish output
.crucible/wiki/_build/
# Crucible: left behind only if a merge is killed
.crucible/.merge-staging-*/
Rebuild on clone
The database is regenerable from the committed wiki files and references.bib. After cloning a repo that contains a crucible, the first command that needs the database rebuilds it automatically:
git clone <repo>
cd <repo>
crucible search "some term"
# crucible: database missing, rebuilding from wiki...
# <search results>
No crucible init is needed on clone. The rebuild creates the schema, populates articles and their cross-links from wiki/*.org, creates sources rows from the references.bib entries whose file field names a stored file (which crucible ingest writes), adds a row for each file in sources/notebooks/ and sources/data/ that no entry claims (a disk scan), and regenerates MANIFEST.md and index.org. references.bib may use braces or parentheses around entries and compact one-line entries (as doi.org returns them); @comment, @string and @preamble blocks are ignored.
Because the rebuild reads only committed files, deleting a source with crucible delete also removes the file field from its bibliography entry (the entry is kept), so the source does not come back on the next sync.
Embeddings are a separate step
Semantic embeddings are not auto-regenerated (they require a local ollama server). If you want crucible related and semantic search to work after a clone, run:
crucible embed
Full-text search (FTS5) and everything else works without embeddings.
Dropbox + git
If your crucible lives in Dropbox and is a git repo, pick one machine as the authoritative sync point. SQLite's WAL files do not play well with simultaneous access across Dropbox; running crucible sync from two machines at once can produce .db conflict files. Git itself is fine in Dropbox.
Acknowledgments
Crucible draws on several sources of inspiration:
-
Andrej Karpathy's LLM Wiki pattern, which articulated the idea that an LLM should incrementally build and maintain a persistent, interlinked wiki rather than re-synthesizing knowledge from scratch on every query. Crucible implements this pattern with org-mode, a graph database, and hybrid search.
-
scimax, an Emacs starterkit for scientists and engineers built on org-mode. Crucible inherits scimax conventions for org-mode formatting, org-ref citations, and HTML publishing, and uses scimax as a primary viewing and editing environment for the wiki.
-
litdb, an earlier project for managing a literature database with org-mode and SQLite. Crucible extends the ideas in litdb (structured citation management, full-text search over scientific literature) into a broader knowledge base system where the LLM handles the synthesis and cross-linking that was previously manual.
License
MIT. See LICENSE for details.
Metadata
Release files for crucible-llm 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| crucible_llm-0.2.0.tar.gz | 3.3 MB | With provenance | Details for crucible_llm-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| crucible_llm-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for crucible_llm-0.2.0-py3-none-any.whl |
Total release size: 3.5 MB
Release files / crucible_llm-0.2.0.tar.gz
| Download URL | crucible_llm-0.2.0.tar.gz |
|---|---|
| Size | 3.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ab0bd1ba80fd10cbba4bf464477ed2e17db9b77c824b0589b82346045dc8d698
|
|
BLAKE2b-256 checksum How to use checksums |
0add5f37e7892b6131b26f8e051a7ac2e6485f57bb1a7cc0dfb3600284bdefd5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logRelease files / crucible_llm-0.2.0-py3-none-any.whl
| Download URL | crucible_llm-0.2.0-py3-none-any.whl |
|---|---|
| Size | 160.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
89f84a6b252447c1ba981ae9c0f6e2c5218229799611dd9c609733fda4bdd8bc
|
|
BLAKE2b-256 checksum How to use checksums |
cbe23f8f6ce887f3bd6b46c78994786439de52941bbf3eba128717149433d49b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logSecurity for crucible-llm 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for crucible_llm-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.