MIT • Python • CLI + HTTP API

Trailhead

Trailhead parses a source tree into a property graph of modules, classes, functions, and their relationships, then stores it in a single SQLite file. Add vector embeddings for semantic search over your own codebase through a CLI, a warm-model HTTP API, and a browser UI that all run locally.

14 Languages via tree-sitter
SQLite Single-file graph & vectors
MIT Open source license

A Queryable Graph of Your Own Code

Index once, then query it from the CLI, the HTTP API, or a browser UI. Your code stays on your machine.

Indexing

Property Graph in SQLite

Parses source files into vertices and edges for modules, classes, functions, and relationships, then persists them to a single SQLite database. Smart sync runs a full build first, then incremental updates.

Language Support

Polyglot via Tree-sitter

Python works out of the box. JavaScript, TypeScript, Rust, Go, Java, C#, C, C++, Ruby, PHP, Bash, HTML, and Ansible-shaped YAML are available as optional extras. Install only the languages you need.

Search

Semantic Similarity Search

Generate embeddings with sentence-transformers and query them for semantic similarity, not just exact text match. Falls back to SQLite BLOB storage when the vector extension isn't available on a given platform.

Live Updates

Background Reindexing

The server watches the source tree and reindexes changed files incrementally while keeping the embedding model warm in memory, so there is no need to rerun the indexer by hand.

Interface

Browser UI & CLI

A single th command handles indexing, serving, and querying. The same server exposes an interactive browser UI at localhost:8000 for visualizing and querying the graph directly.

Integration

HTTP API & OpenAPI Schema

Full REST API for embeddings, SQL queries, semantic search, and graph traversal, documented at /openapi.json and /docs. Built for scripting and for feeding an LLM prompt context.

Who It’s Built For

Anyone who needs a codebase's structure and meaning queryable, without shipping the code anywhere.

AI & LLM Tooling Builders

Give an agent or a RAG pipeline structured, queryable context about a codebase instead of dumping raw files into a prompt window.

Platform & Developer Tooling Teams

Explore an unfamiliar or legacy codebase's structure, including module boundaries, call relationships, and cross-file references, without reading it file by file.

Regulated & Air-Gapped Environments

Everything runs locally against a SQLite file. No code, embeddings, or queries leave the machine running Trailhead.

Get Started

pip install trailhead
th index .
th serve .

Then visit http://localhost:8000 for the browser UI, or query straight from the CLI with th query similar "...".

Works Well With

Dev-tooling neighbors from the same shop.

MIT • Browser-Native

WebUtils

Repo2Prompt packages a codebase for LLM prompt contexts entirely in the browser. Trailhead is the deeper local option, with a persistent queryable graph and semantic search over the same code.

Learn More →
MIT • Python • FastAPI

Adapt

Point Adapt at a folder for auth-gated APIs and MCP resource exposure. Point Trailhead at the same folder for semantic code search and a queryable property graph.

Learn More →

Free to Use. Commercially Supported.

Trailhead is MIT licensed. McIndi offers commercial support contracts for organizations that need SLA-backed maintenance, custom language support, and integration work.