Pattern Vault
Turn real code into a local, searchable library of reusable engineering patterns.
Pattern Vault scans your repositories, parses their source files into AST symbols using tree-sitter, classifies which components represent reusable software patterns using a large language model, and compiles them into a highly searchable local SQLite FTS5 database.
Once stored, you can query, inspect, and retrieve these patterns from your terminal (CLI), a custom React web dashboard, or directly within your IDE (like Cursor or Claude Code) via the Model Context Protocol (MCP).
Key Features
Architecture Overview
Pattern Vault is structured into decoupled, robust layers:
flowchart TB
user["Developer / Claude Code / Browser UI"]
subgraph access["Access Layer"]
cli["CLI\nindex / search / stats / chat / serve"]
mcp["FastMCP Server\n8 vault tools"]
web["React Dashboard\nVite + TanStack Query + Zustand"]
api["FastAPI BFF\nchat / patterns / workspace / usage"]
end
subgraph agent["Agent Layer"]
orchestrator["Claude Tool-Use Orchestrator\nscan -> read -> parse -> save"]
tools["Agent Tools\nscan_directory / read_file / parse_symbols / save_pattern"]
end
subgraph indexing["Indexing Layer"]
scanner["Repo Scanner\nlanguage + path filters"]
chunker["Tree-sitter Chunker\nsymbols and fallback chunks"]
extractor["Pattern Extractor\nmodel classification + quality score"]
profiles["Indexing Profiles\ncurated / balanced / comprehensive"]
end
subgraph storage["Storage Layer"]
sqlite["SQLite + FTS5\npatterns / chunks / insights / jobs / usage"]
end
user --> cli
user --> mcp
user --> web
web --> api
cli --> orchestrator
api --> orchestrator
mcp --> sqlite
orchestrator --> tools
tools --> scanner
tools --> chunker
tools --> sqlite
cli --> scanner
api --> scanner
mcp --> scanner
scanner --> chunker
chunker --> profiles
profiles --> extractor
extractor --> sqlite
In Action
1. Ingest Patterns via CLI
uv run pv index /path/to/my-project --profile curated
2. Search Intent from Terminal
uv run pv search "retry with exponential backoff" --language python
3. Retrieve inside IDE using Claude Code
User: "Search my pattern vault for auth middleware."
Claude: "I found a pattern: JWT Auth Middleware (FastAPI, Quality: 0.92) in repo backend-services..."
Getting Started
Ready to build your personal codebase memory? Proceed to the Getting Started Guide to set up your environment, install dependencies, and run your first indexing job in under five minutes!