quarry
Quarry is a local semantic search and knowledge-capture server for indexing content and recalling it through MCP tools.
Search indexed content with hybrid semantic + BM25/RRF retrieval, filtered by document, collection, page type, source format, agent handle, or memory type.
Ingest web URLs into the knowledge base with optional overwrite and collection selection; indexing runs in the background.
Save durable facts, observations, opinions, and procedures with
remember, including agent-scoped memories and secret/PII scrubbing.Save short distilled lessons with
learnso they get preferential retrieval for related queries.Inspect database status and local recall/search telemetry via
statusandinsights.Switch between named local databases with
use.List documents, collections, databases, and directory registrations; show document metadata or page text; delete documents or collections.
Register and deregister local directories for automatic indexing/sync, and trigger sync-all-registrations.
Sync completed ethos mission rounds into worker-agent memory with
missions_sync.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@quarry find "what were the Q3 revenue figures""
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
punt-quarry
Local semantic search for AI agents and humans.
Quarry indexes documents in 20+ formats, embeds them with a local ONNX model (snowflake-arctic-embed-m-v1.5), stores the vectors in LanceDB, and serves semantic search to Claude Code, Claude Desktop, and the command line. Everything runs locally — no API keys, no cloud accounts. One quarryd daemon per machine loads the model once; the CLI, the MCP (Model Context Protocol) server, and the Claude Code hooks are thin clients that send requests to it. Scripts can also call its HTTP API directly.
Platforms: macOS (Apple Silicon), Linux
Intel macOS is not supported by any install path: two of quarry's dependencies (lancedb and onnxruntime) publish no Intel macOS wheel.
Quick Start
Install the CLI, the daemon, the MCP server, and the Claude Code plugin:
curl -fsSL https://raw.githubusercontent.com/punt-labs/quarry/6a4b2c1/install.sh | shRestart Claude Code. At each session start, quarry registers your current project and starts indexing it in the background. See What It Looks Like for example searches.
Install the package:
uv tool install punt-quarrySet up the daemon, TLS certificates, and MCP config:
quarry installCheck health:
quarry doctorInstall the formula. It puts the quarry, quarryd, and quarry-hook commands on PATH:
brew install punt-labs/tap/quarryDownload the model and set up the TLS certificates and the daemon service:
quarry installTo add the Claude Code plugin too, add the Punt Labs marketplace:
claude plugin marketplace add punt-labs/claude-pluginsThen install the plugin:
claude plugin install quarry@punt-labsUse one install method per machine. Mixing Homebrew with the curl | sh installer puts two copies of quarry on PATH, and whichever comes first wins. Run which quarry (or command -v quarry) to see which one that is.
For other coding agents (Codex, Cursor), a plain terminal, or Claude Code setups where policy blocks plugin installs, --no-plugin installs everything except the Claude Code marketplace and plugin:
curl -fsSL https://raw.githubusercontent.com/punt-labs/quarry/6a4b2c1/install.sh | sh -s -- --no-pluginWhere a flag cannot be passed (CI templating a bare curl … | sh), set QUARRY_NO_PLUGIN=1 — honored only when exactly 1:
curl -fsSL https://raw.githubusercontent.com/punt-labs/quarry/6a4b2c1/install.sh | QUARRY_NO_PLUGIN=1 shEverything else runs unchanged. Use the CLI, or point your tool at the quarry mcp server (MCP over standard input/output); both talk to the quarryd daemon. Re-run the installer without --no-plugin to add the plugin later.
Download the installer:
curl -fsSL https://raw.githubusercontent.com/punt-labs/quarry/6a4b2c1/install.sh -o install.shCheck its digest (shasum -a 256 install.sh on macOS):
sha256sum install.shRead it:
cat install.shRun it:
sh install.shRelated MCP server: claude-context-local
Features
20+ formats — PDFs (with OCR for scanned pages), source code (AST-aware splitting), spreadsheets, presentations, HTML, Markdown, LaTeX, DOCX, images.
Semantic search — retrieval is by meaning, not keyword. A query about "margins" finds passages about profitability even if they never use that word.
One daemon, thin clients — a single
quarrydprocess loads the embedding model once and serves the CLI, the MCP server, and the Claude Code hooks over a versioned REST API. It caps its embedding and database compute threads at two each to limit CPU load.Automatic knowledge capture —
quarry enablesets up per-project file sync, web-fetch and session-transcript capture, and per-agent memory. Secrets and personal information are scrubbed from captures before they are stored, and captures are kept separate from the code index. See Knowledge Capture.Named databases — separate databases, each with its own index and directory registrations, for example to keep work and personal documents apart.
quarry use <name>sets the default database and--db <name>picks one for a single command. Each daemon serves one database, and the installed service serves the default; see Managing the Daemon to run another.Remote server — run the daemon on a GPU host and connect from any Mac or Linux client over TLS. See ADVANCED-SETUP.md.
What It Looks Like
Sync a folder:
> /ingest ~/Documents/research
▶ Registering /Users/you/Documents/research as 'research' (task a1b2c3)
▶ Syncing all registrations (task d4e5f6)Search by meaning:
> /find "what were the Q3 revenue figures"
▶ [report.pdf p.12 | text/.pdf] (similarity: 0.4521)
Third quarter revenue reached $142M, up 18% year-over-year,
driven primarily by expansion in the enterprise segment.
Gross margins improved to 71% from 68% in Q2.Commands
Slash Commands (Claude Code)
Command | What it does |
| Ingest a URL, or register and sync a local file or directory |
| Ingest inline text under a document name |
| Save a short lesson (up to 500 characters) that ranks higher in search results |
| Semantic search; questions get answers with citations, keywords get raw results |
| Search and write an explanation of a document or topic |
| Find which document a claim comes from |
| Manage: |
| List quarry's slash commands |
MCP Tools
Tool | Purpose |
| Semantic search with filters |
| Document metadata or page text |
| Documents, collections, databases, registrations |
| Database statistics |
| Local search statistics: query volume, latency, empty-result rate, and result breakdowns |
| Index a URL, or inline text |
| Save a short lesson that ranks higher in search results |
| Manage a synced directory |
| Re-index all registered directories |
| Remove a document or collection |
| Switch the active database |
| Save each completed ethos mission round to the worker agent's memory |
CLI
Command | What it does |
| Hybrid search (meaning plus keywords) |
| Index a webpage (for local files and directories, use |
| Index text read from standard input |
| Save a short lesson (up to 500 characters) that ranks higher in search results |
| Show a document's metadata, or one page's text with |
| List indexed documents (also |
| Delete a document, or a collection with |
| Watch a directory and keep its index current |
| Stop watching a directory and remove its data ( |
| Re-index registered directories |
| Turn project indexing and capture on or off for a repo |
| Save each completed ethos mission round to |
| Set the default database |
| Show document and chunk counts, storage size, and model |
| Local search statistics: query volume, latency, empty-result rate, and result breakdowns |
| Compact the database and rebuild its indexes |
| Health check |
| Set up the daemon service, TLS certificates, and MCP config |
| Remove the daemon service (its launchd or systemd unit) |
| Connect to a remote server; the server's certificate is pinned on first connection |
| Disconnect and go back to the local daemon |
| Print the installed version |
Run quarry --help for the full list, including captures, skills,
backfill-sessions, remote, and mcp, and quarry <command> --help for
each command's options.
ethos is the Punt Labs tool that gives
agents named identities and runs delegated tasks ("missions"); the
missions sync commands only matter if you use it.
A registered directory is indexed automatically: quarry watches it for changes
and re-indexes as you work (honoring .gitignore and a root-level
.quarryignore, so directories such as node_modules or .venv are skipped),
with a periodic sweep that catches anything the live watch misses. You rarely
need quarry sync. quarry list registrations shows each directory's watch
state (watched, degraded, or scan-only); a scan-only directory still
stays current through the sweep.
To set up a repo, run quarry enable in it. No other setup is needed.
quarry enable also lets Claude call quarry without asking each time: it adds
quarry's allow rules to that project's .claude/settings.json (admin and
destructive commands still prompt), and quarry disable removes them.
Driving quarry from an agent — memory tagging and agent handles — is covered in
AGENTS.md.
Upgrading from an older version? Earlier quarry wrote the same allow rules to your user-global
~/.claude/settings.jsonat session start;quarry disabledoes not remove those. Delete them by hand if you want quarry to prompt again everywhere.
Setup
Quarry works with zero configuration. For environment variables and running the daemon on a remote or GPU host, see ADVANCED-SETUP.md.
Claude Desktop
The .mcpb bundle connects Claude Desktop to the same local index that the CLI and Claude Code use. It contains no search engine of its own: it registers the quarry mcp client, which talks to the same quarryd daemon. Install quarry first; the bundle does not work on its own.
quarry install configures Claude Desktop automatically. To add it by hand instead, download punt-quarry.mcpb and double-click it.
Uploaded files in Claude Desktop live in a sandbox quarry cannot read — use remember for that content, or give ingest a local path.
Knowledge Capture
The Claude Code plugin runs hooks (commands Claude Code runs on session events) that capture knowledge automatically:
Hook | What it captures |
| Registers the current project and starts indexing it in the background |
| Ingests URLs Claude fetches during research. If the URL was already captured, the hook tells Claude to use |
| Files a scrubbed digest of search results under |
| Opt-in (off by default): captures prose files Claude reads from outside any registered directory, skipping likely secret files, non-prose file types, and large files |
| Captures the session transcript before context compaction discards it |
| Captures the full session transcript on every close, even a short session that never compacts |
| Captures a subagent's transcript separately from the parent session's. If the subagent has an ethos identity, its final report is also saved to that agent's memory ( |
If a hook fails, Claude Code continues normally. Each hook is
independently toggleable in .punt-labs/quarry/config.md.
Captures are scrubbed (secrets, paths, emails, hostnames) before they are
written to disk. The scrub matches known patterns and may miss some secrets.
If the scrubber itself fails, the capture is not written. Content you add
yourself with ingest or remember is not scrubbed. See DES-036 in
DESIGN.md.
Private capture repo. Scrubbed session capture files live in the checkout's
ignored .punt-labs/local/quarry/captures/ directory (PLD-2, PLD-4). You can
opt in to a private companion repo per
project (<repo> → private <repo>-quarry) so that scrubbed captures are
pushed there instead of living in the public repo's history. Set it up with
quarry captures init. See DES-039 in DESIGN.md and
AGENTS.md.
Search telemetry. The daemon uses punt-observe to record typed search
statistics to the private local file ~/.punt-labs/quarry/telemetry.db.
Search text, result content, and filters are not stored. Insights groups
empty queries, agents, and collections by per-install salted hashes and shows
aggregate latency, counts, and hit-age bands. The shared store retains 90 days
across all Quarry databases; the old per-database retention setting no longer
applies. Set PUNT_TELEMETRY=off, QUARRY_TELEMETRY=off, or
TELEMETRY_ENABLED=false in the daemon's environment and restart it to disable
capture. Quarry does not opt in to network export.
Upgrading starts a fresh recall history. Quarry never reads or migrates
the old per-database telemetry.db under the data root. Old files may contain
scrubbed query text and are not automatically deleted. To discard them, stop
any older Quarry daemons, then delete only the old per-database
data/<db>/telemetry.db and its -wal and -shm sidecars for each affected
database. If you set a custom data root, look there instead. The new
installation-wide ~/.punt-labs/quarry/telemetry.db is separate.
Managing the Daemon
The CLI, MCP server, hooks, daemon, and detached sync dispatcher write diagnostics
to ~/.punt-labs/quarry/logs/quarry.log. The shared sink redacts and rotates that
private file. QUARRY_LOG_LEVEL adjusts terminal verbosity, not the file threshold.
If the daemon cannot open its private log and you are using launchd or
Homebrew services, stop the service and run quarryd in a terminal to see
the startup diagnostic.
quarry install registers quarryd as a per-user service that starts at login and restarts if it crashes (launchd on macOS, systemd on Linux).
To upgrade, re-run the Quick Start installer. It installs the tested dependency versions, runs quarry install, restarts the daemon, and fails if the new daemon does not start and report ready. ADVANCED-SETUP.md lists the steps.
After upgrading some other way (for example uv tool install --force), restart the service yourself. A running daemon keeps using the old version until it restarts.
macOS:
launchctl kickstart -k gui/$(id -u)/com.punt-labs.quarryLinux:
systemctl --user restart quarryquarry doctor confirms the daemon is running and ready.
To use a second named database while the service runs, start another daemon
for it in the foreground. --port 0 picks a free port, and --tls matches
the installed service:
quarryd --db work --port 0 --tlsThen pass the same name to each command, for example quarry --db work find "<query>".
quarryd also serves a REST API for scripts and other integrations. See ADVANCED-SETUP.md.
Documentation
Architecture (PDF) | Advanced Setup | Design (ADR log) | Agents | Changelog | Contributing
License
MIT
Available Tools
14 toolsdeleteA
Use to remove stale or wrong content before re-ingesting it.
Returns immediately — the daemon removes chunks in the background.
Args: name: Document filename or collection name to delete. kind: What to delete — "document" or "collection". collection: Optional collection scope (only for kind="document").
Returns: A deletion task identifier, not confirmation that the data is gone. Input refusals, daemon errors, and unexpected failures return Error: ... text. Connection failures include recovery guidance.
Inputs: name (required), kind, collection. Returns: result
deregister_directoryA
Use to stop tracking a directory and optionally retain indexed data.
Use to stop tracking a directory — keep its indexed data with
keep_data=True, or purge it.
Returns the removed-file count synchronously; the chunk purge runs as a background task. An unknown collection surfaces as an error, not a removal confirmation.
Args: collection: Collection name to deregister. keep_data: If true, keep indexed data in LanceDB.
Returns: The removed registry-file count and the accepted chunk-purge task ID; the purge may still be running. Input refusals, daemon errors, and unexpected failures return Error: ... text. Connection failures include recovery guidance.
Inputs: collection (required), keep_data. Returns: result
findA
Use find before web research or answering rationale questions.
Use find before WebSearch or WebFetch for research, or before answering a why/how/what-did-we-decide question. Prefer grep for symbol and value lookups; prefer find for meaning.
Combines vector similarity and BM25 full-text search via Reciprocal Rank Fusion (RRF) for better recall on both meaning and exact terms.
Args: query: Natural language search query. limit: Maximum number of results (default 10, max 50). document_filter: Optional exact document name to filter by. collection: Optional collection name to search within. page_type: Optional content type filter (text, code, spreadsheet, etc.). source_format: Optional source format filter (.pdf, .py, .xlsx, etc.). agent_handle: Your own handle to recall only your memories (e.g. "rmh"); leave empty to search everything. memory_type: Optional memory type filter (fact, observation, lesson, etc.).
Returns: Ranked excerpts with document, page, collection, and relevance metadata; an empty result report means no indexed content matched. Input refusals, daemon errors, and unexpected failures return Error: ... text. Connection failures include recovery guidance.
Inputs: query (required), limit, page_type, collection, +4 more. Returns: result
ingestA
Use when you have a URL to add to the knowledge base.
Use when you have a URL to add to the knowledge base — a doc, an article, a spec.
remember = a specific durable fact, ingest = a URL, learn = a distilled lesson that gets retrieval preference.
Fetches a URL with smart sitemap discovery and single-page fallback. For
local files and directories, use register_directory +
sync_all_registrations — the daemon owns the filesystem, so there is no
in-process file loader here.
Returns immediately — the daemon indexes in the background.
Args: source: HTTP(S) URL to ingest. overwrite: If true, replace a stored URL; if false, skip it. collection: Collection name. Auto-derived if empty.
Returns: An accepted ingest task ID, not a completed indexing report. Input refusals, daemon errors, and unexpected failures return Error: ... text. Connection failures include recovery guidance.
Inputs: source (required), overwrite, collection. Returns: result
insightsA
Use to read your own recall stats: query volume, latency, recall mix.
Returns: Formatted query volume, latency, and recall-mix statistics. Input refusals, daemon errors, and unexpected failures return Error: ... text. Connection failures include recovery guidance.
Inputs: no named parameters. Returns: result
learnA
Use learn to save a distilled lesson for preferential retrieval.
Use learn to save a distilled lesson that should outrank ordinary results for related queries -- a rule, a convention, a "do it this way" insight, not a one-off fact.
remember = a specific durable fact, ingest = a URL, learn = a distilled lesson that gets retrieval preference.
The daemon scrubs secrets/PII before indexing, same as remember. Lessons are capped at 500 characters -- use remember for anything longer. Returns immediately -- the daemon indexes in the background.
Args: lesson: The distilled lesson text (<= 500 chars). topic: Optional domain tag (e.g. "testing", "release-process"). name: Optional user-visible slug for later reference.
Returns: The admission status and task ID; lesson indexing runs in the background. Input refusals, daemon errors, and unexpected failures return Error: ... text. Connection failures include recovery guidance.
Inputs: lesson (required), name, topic. Returns: result
listA
Use to see what's already indexed before ingesting it again.
Args: kind: What to list — "documents", "collections", "databases", or "registrations". collection: Optional collection filter (only for kind="documents").
Returns: A formatted catalog of the selected kind, optionally collection-filtered. Input refusals, daemon errors, and unexpected failures return Error: ... text. Connection failures include recovery guidance.
Inputs: kind (required), collection. Returns: result
missions_syncA
Use after ethos mission close to file frozen rounds as memory.
Use after ethos mission close to file each frozen round into the
worker's memory (memory-<worker>, type observation).
Reads this repo's .punt-labs/ethos/missions/ tree; safe to re-run — a
round already filed is skipped, and a name held by another checkout is
reported as an error, never overwritten.
Args: mission: Sync one mission id only; empty means every mission. dry_run: List what would be filed and post nothing. force: Re-file rounds the daemon already holds (matching key only).
Returns: A report of filed/skipped rounds, scan errors (including missing missions), and per-round daemon failures; dry-run reports proposed writes only. Uncaught errors return Error: ...; connection errors add recovery guidance.
Inputs: force, dry_run, mission. Returns: result
register_directoryA
Use to track a local directory so future changes sync automatically.
Returns immediately — the daemon records the registration in the background.
Args: directory: Absolute path to the directory. collection: Collection name. Uses the directory name, sanitized, if empty.
Returns: The resolved registration directory, collection, and accepted task ID; indexing continues in the background. Input refusals, daemon errors, and unexpected failures return Error: ... text. Connection failures include recovery guidance.
Inputs: directory (required), collection. Returns: result
rememberA
Use remember to save durable facts and observations across sessions.
Use remember when you learn something durable — a decision, a gotcha, a non-obvious fact, a procedure — so it survives context compaction.
remember = a specific durable fact, ingest = a URL, learn = a distilled lesson that gets retrieval preference.
Call it at these five moments, not at the end and not never: a non-obvious root cause or gotcha (fact); a ratified design decision with its reason (fact); a repeatable how-to (procedure); a judgement you will revisit (opinion); and once before submitting a mission result (observation). Always pass your own agent_handle — the daemon cannot infer it, and a subagent's working directory resolves to the repo's leader, not to you.
The daemon scrubs secrets/PII before indexing. Returns immediately — the daemon indexes in the background.
Args:
content: The text content to remember.
document_name: Name for the document (e.g., 'notes.md').
overwrite: If true, replace existing data for this document. If
false, an existing document of this name is left untouched.
collection: Collection name. Leave empty to route by agent_handle —
memory-<handle> when a handle is given, else default.
format_hint: Format hint: 'auto', 'plain', 'markdown', 'latex'.
agent_handle: Your own handle (e.g. "rmh") — the memory is filed
under it and recalled by it.
memory_type: Memory classification: fact, observation, opinion,
procedure. 'lesson' is reserved for the learn tool.
summary: One-line summary of the content.
Returns: The document name and accepted task ID; indexing runs in the background. Input refusals, daemon errors, and unexpected failures return Error: ... text. Connection failures include recovery guidance.
Inputs: content (required), document_name (required), summary, overwrite, +4 more. Returns: result
showA
Use to read a specific page, or to check whether a document is indexed.
Use to read a specific page, or to check whether a document is already indexed.
Without page_number: shows document metadata (pages, chunks, collection). With page_number: shows the full text for that page.
Args: document_name: Document filename (e.g., 'report.pdf'). page_number: Page number (1-indexed); nonpositive means metadata only. collection: Optional collection scope.
Returns: Document metadata (nonpositive page_number) or full page text. Missing documents/pages return ordinary not-found text, not an Error: result. Other failures return Error: ...; connection errors add recovery guidance.
Inputs: document_name (required), collection, page_number. Returns: result
statusA
Use to check how much is indexed before you search or ingest.
Returns: Formatted counts, storage size, and engine/model status for the target. Input refusals, daemon errors, and unexpected failures return Error: ... text. Connection failures include recovery guidance.
Inputs: no named parameters. Returns: result
sync_all_registrationsA
Use after registering a new directory or changing tracked files.
Use after registering a new directory, or when tracked files changed outside quarry's own writes.
Returns immediately — the daemon runs the sync in the background.
Returns: An accepted sync task ID, not a completed synchronization report. Input refusals, daemon errors, and unexpected failures return Error: ... text. Connection failures include recovery guidance.
Inputs: no named parameters. Returns: result
useA
Use to point every other tool at a different named database.
All tools (find, ingest, sync, etc.) will target the selected database's daemon until changed again. Use list(kind="databases") to see the database the daemon is fixed to.
Only selects among LOCAL databases: while a remote target (QUARRY_URL or a 'quarry login') is active, the remote daemon is fixed to its own database and this has no effect.
Args: name: Database name (e.g., 'coding', 'work'). Use 'default' for the default database.
Returns: The prior and selected local database and its resolved storage path; the selection affects only this MCP process, not the persisted default. Input refusals, daemon errors, and unexpected failures return Error: ... text. Connection failures include recovery guidance.
Inputs: name (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
The write-side trio (remember/learn/ingest) is explicitly disambiguated in each description, and find vs show vs list vs status are separated by purpose. Residual overlap: delete(kind="collection") and deregister_directory(keep_data=False) both purge a collection, and list/status both surface catalog state.
Mostly a verb-first convention (remember, find, show, ingest, learn, delete, list, use) with compound verb_noun snake_case for the directory lifecycle tools. Minor deviations: missions_sync puts the noun first, and status/insights are noun-named admin tools.
14 tools sits comfortably in the healthy band and each maps to a real operation in a memory/knowledge-base lifecycle. Slightly heavy at the margins: insights adds little beyond status, and missions_sync is a narrow, environment-specific workflow tool.
Strong lifecycle coverage: write (remember/learn), ingest, search/read (find/show), catalog (list/status), removal (delete), directory registration and sync, plus database selection. Minor gaps: no collection create/rename, no document update short of overwrite-and-reingest, and no reindex/export path.
Maintenance
Related MCP Connectors
Persistent memory for Claude Code and Cursor. Stop re-explaining your project every session.
Private persistent memory for Claude, ChatGPT & Gemini via MCP - semantic search, zero-code setup.
Your versioned prompt library: search, read, save and version prompts from Claude Code.
Shared work memory for Claude Code, Codex, Cursor and chat, scoped to each repository.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables Claude Desktop to search and query personal document collections (PDF, Word, Markdown, text) using semantic search and conversational AI with full context preservation across exchanges.MIT
- AlicenseNot gradedqualityDmaintenanceProvides Claude Code with local semantic search and indexing of your codebase using AST-aware chunking and hybrid search, enabling deep code understanding without sending data to the cloud.56 PyPIMIT
- FlicenseNot gradedqualityDmaintenanceEnables semantic code search across codebases using AI embeddings and vector similarity, integrated with Claude Desktop and Cursor.-
- AlicenseNot gradedqualityDmaintenanceProvides local-first, cross-session memory for Claude Code, enabling semantic search across past sessions to retrieve procedures, decisions, or answers without exposing secrets.Apache 2.0