Give your agent a knowledge graph that compounds.
Project description
Lacuna is a single MCP tool — wiki — that you plug into your existing agent harness (Claude Code, Hermes, OpenClaw) to give it a searchable, compounding personal research graph. Feed it a YouTube URL, an arXiv link, or a downloaded PDF. Your agent runs the structured extraction. The knowledge accumulates across every session.
It is the lacuna — the missing link between your raw inputs and your second brain.
Quick Start
pip install lacuna-wiki
lacuna init ~/my-vault
init creates your vault directory structure, sets up the DuckDB index in ~/.lacuna/, and asks whether to wire the MCP server into Claude Code and/or Hermes automatically. Takes about 10 seconds.
Then wire it into your agent harness manually if needed:
Claude Desktop / Claude Code (~/.claude/mcp.json)
{
"mcpServers": {
"lacuna": {
"command": "lacuna",
"args": ["mcp"],
"env": { "LACUNA_VAULT": "/path/to/my-vault" }
}
}
}
Hermes (~/.hermes/config.yaml)
mcp_servers:
lacuna:
command: lacuna
args: [mcp]
env:
LACUNA_VAULT: /path/to/my-vault
OpenClaw
openclaw mcp set lacuna '{"command":"lacuna","args":["mcp"],"env":{"LACUNA_VAULT":"/path/to/my-vault"}}'
lacuna initdetects Claude Code, Hermes, and OpenClaw and offers to wire this config automatically.
What Your Agent Unlocks
Once connected, your agent gets one composable tool:
wiki(q="attention mechanisms") # hybrid semantic + keyword search
wiki(page="transformer-architecture") # navigate to a specific page
wiki(pages=["sdpa", "flash-attn"]) # pull multiple pages in one shot
wiki(q="...", scope="sources") # search raw source chunks directly
That's it. One tool. Your entire research graph.
Omnivorous Inputs
Feed Lacuna anything — it knows what to do:
| Source | Command |
|---|---|
| 📺 YouTube URL | lacuna add-source https://youtube.com/watch?v=... |
| 📄 arXiv link | lacuna add-source https://arxiv.org/abs/2310.06825 |
| 📑 Local PDF | lacuna add-source ~/papers/my-paper.pdf |
| 🌐 Any URL | lacuna add-source https://example.com/blogpost |
The Structured Skills
This is where Lacuna is different from dropping a folder of PDFs into a vector store.
Lacuna ships with agent skills for Claude Code and Hermes that encode a structured, multi-turn extraction workflow — not "summarize this" but a disciplined process that produces tagged, wikilinked pages with full citations. When your agent ingests a paper, it follows the skill's protocol: pulling core concepts, mapping relationships to your existing graph, and flagging gaps.
Install them into your harness:
lacuna install-skills --claude-global # → ~/.claude/skills/
lacuna install-skills --hermes-global # → ~/.hermes/skills/
lacuna install-skills --openclaw-global # → ~/.openclaw/skills/
lacuna install-skills --hermes PATH # custom Hermes skills directory
Skills included:
- ingest — structured multi-turn knowledge extraction from a source
- query — cited, honest answers from your graph (flags what's missing)
- adversary — re-verifies old claims against their cited sources
The Compounding Graph
Lacuna outputs aren't isolated notes. Each extraction is structured to deliberately compound — new pages wikilink to existing ones, concepts accumulate across sessions, and the graph gets richer with every source you add.
Under the hood: hybrid BM25 + vector search over a DuckDB store, with plain markdown files in your vault that Obsidian can read directly. No format lock-in. Your vault is just a folder.
my-vault/
├── wiki/ # compiled knowledge pages (Obsidian-readable)
│ ├── attention.md
│ ├── transformer-architecture.md
│ └── ...
├── raw/ # original sources
│ ├── vaswani2017/
│ └── ...
└── .lacuna.toml # vault config
Embedding Backend
Lacuna needs an OpenAI-compatible embeddings endpoint. The easiest path is Ollama:
# Install Ollama: https://ollama.com/download
ollama pull nomic-embed-text:v1.5
Then set your vault's .lacuna.toml (created by lacuna init):
[embed]
url = "http://localhost:11434" # Ollama's default port
model = "nomic-embed-text:v1.5" # default — can omit
dim = 768 # default — can omit
LACUNA_EMBED_URL, LACUNA_EMBED_MODEL, and LACUNA_EMBED_DIM env vars also work for one-off overrides.
Changing models? Set
embed.dimin.lacuna.tomlbefore runninglacuna init— the schema is created from that value. Changing the model or dim after ingesting sources will invalidate existing embeddings. Alacuna reindexcommand to re-embed everything in place is planned; for now, delete~/.lacuna/vaults/<your-vault>/and re-runlacuna initto start fresh.
Requirements
- Python 3.11+
pdftotext(poppler-utils) for PDF extraction:apt install poppler-utils/brew install poppler- An embedding server (Ollama, OpenAI, or any OpenAI-compatible endpoint)
Status
Early release. The core loop — add source → agent ingests → agent queries — is solid. The structured skills are where the value is; treat them as opinionated defaults you can adapt.
Windows support is in progress (Linux/macOS fully supported today).
License
MIT © Markus Williams, 2026
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lacuna_wiki-2.0.2.tar.gz.
File metadata
- Download URL: lacuna_wiki-2.0.2.tar.gz
- Upload date:
- Size: 9.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3729829f58dd7b126c97def89d43df02b782947a64c6cd135c528ecd5d5b09d5
|
|
| MD5 |
99667b297112ef7ba72234ebb454d930
|
|
| BLAKE2b-256 |
c058d3431de2cba2d6a955596355170bd2ffc8f2a02fedb807a7c8eb6a1cbcf6
|
File details
Details for the file lacuna_wiki-2.0.2-py3-none-any.whl.
File metadata
- Download URL: lacuna_wiki-2.0.2-py3-none-any.whl
- Upload date:
- Size: 62.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d916ef60416b0bb2507f9af273c786aafcd4916f28637bfabef14ef0bc66f6dd
|
|
| MD5 |
fd364fc8133dab375f360eee93a364ec
|
|
| BLAKE2b-256 |
81867896049865da402f9e68946e46e4d385e13c96fc5ccdbb75bf3a7eeb6aa7
|