Hybrid Graph-Augmented Code Intelligence Engine
Codetrip turns a source repository into a typed code graph and combines graph traversal, lexical source search, and semantic retrieval. Use it as a Go library, a CLI, or an MCP server.
+--------------------+ +------------------------------+ +------------------------+
| Source Code | | Codetrip Engine | | Intelligence |
| | | | | |
| .go .ts .py | --> | Parse + Language Resolution | --> | Symbol Search |
| .rs .java ... | | | | | Source Search |
| | | v | | Graph Context |
| Repository | | Typed Code Graph | | Dependency Exploration |
| | | | | | Bounded BFS |
| | | +---------+---------+ | | Shortest Path |
| | | | | | | | Hybrid Retrieval |
| | | Symbol Source Semantic | | Agent Context |
| | | Index Index Vectors | | |
| | | +---------+---------+ | | |
| | | | | | |
| | | Atomic Snapshot | | |
| | | | | | |
| | | Go LIB / CLI / MCP | | |
+--------------------+ +------------------------------+ +------------------------+
Each repository is published as an atomic snapshot. The durable graph is authoritative; search indexes and vectors are repository-scoped derived data.
go install github.com/mengshi02/codetrip/cmd/codetrip@latestOr build from source:
git clone https://github.com/mengshi02/codetrip.git
cd codetrip && make buildcodetrip index /path/to/project --repo project
codetrip search "ParseConfig" --repo project
codetrip source 'lang:go ParseConfig' --repo projectcodetrip traverse NODE_ID --repo project --direction both --depth 3
codetrip path SOURCE_ID TARGET_ID --repo projectcodetrip embed --repo project \
--endpoint http://localhost:11434/v1/embeddings \
--model nomic-embed-text
codetrip hybrid "configuration loading" --repo project \
--endpoint http://localhost:11434/v1/embeddings \
--model nomic-embed-text| Capability | Description |
|---|---|
| Code Graph | Typed files, symbols, calls, imports, inheritance, overrides, communities, and processes |
| Multi-language Parsing | Go, TypeScript/TSX, JavaScript/JSX, Python, Java, C, C++, C#, Rust, Ruby, PHP, Swift, and Kotlin |
| Graph Navigation | Bounded BFS and shortest directed paths over typed relationships |
| Symbol Search | Repository-scoped lexical search over symbols and metadata |
| Source Search | File-name and source-content search with literal, regex, file, and language filters |
| Semantic Retrieval | HTTP embeddings, persisted vectors, optional int8 quantization, and hybrid rank fusion |
| Atomic Snapshots | Complete replacement builds before publication; active data is never partially updated |
| CSV Export | Deterministic parser-inspection CSV and complete persisted-graph export |
engine, err := codetrip.Open("./.codetrip")
if err != nil {
log.Fatal(err)
}
defer engine.Close()
_, err = engine.IndexRepo(ctx, "/path/to/project",
codetrip.WithRepoName("project"),
codetrip.WithReplaceExisting(true),
)
result, err := engine.Search(ctx, &codetrip.SearchRequest{
Repo: "project", Query: "ParseConfig", Limit: 20,
})The public API also provides source search, embedding, hybrid search, traversal, shortest paths, repository listing, CSV export, metrics, and configuration options.
codetrip mcp --dir ~/.codetripThe stdio server exposes the same core names as the CLI:
list search source traverse path
codetrip index /path/to/project --repo project \
--export ./local-review/project --export-strict
codetrip export --repo project --output ./exports/projectLanguage fixtures and review tools are maintainer-local assets; users only need the CSV export capability.
Release binaries are available for Linux and macOS on amd64/arm64, and Windows on amd64. They are distributed as single executables with no third-party runtime installation. Windows uses a portable source-search backend and may be slower on large repositories.
go test ./...
go vet ./...MIT