Gortex Exposes Tree-Sitter Knowledge Graphs via Model Context Protocol to Cut Agent Tokens
Gortex is an open-source, local-first code intelligence daemon written in Go that parses codebases into SQLite knowledge graphs. Instead of dumping full files into agent context windows, tools query AST nodes directly over Model Context Protocol (MCP), claiming up to a 50x token reduction.

Impact: High
Why it matters
Install this daemon locally to stop Claude Code, Cursor, and Codex from consuming thousands of tokens reading irrelevant files during navigation.
TL;DR
- 01Replaces brute-force grep and whole-file context dumping with indexed SQLite knowledge graph lookups.
- 02Natively supports 257 languages with deep tree-sitter AST queries for 16+ core languages.
- 03Maps distributed API contracts across separate repositories for microservices.
- 04One-command installation configures MCP endpoints for Claude Code, Cursor, Codex CLI, and 16 other tools.
Key facts
- Language Coverage
- 257 languages across 3 parsing tiers
- AST Engine & Storage
- Tree-sitter AST queries, persistent on-disk SQLite
- Assistant Integrations
- 19-20 agents (Claude Code, Cursor, Codex CLI, Gemini CLI)
- Kernel Benchmark (Self-Reported)
- 70,333 files in ~3 min (300 files/sec, 5.07 GB peak heap)
- Reported Token Efficiency
- Up to 50x fewer tokens per response (project benchmark)
Tree-Sitter AST Graphs over Model Context Protocol
When coding agents execute repository-wide edits, initial exploration frequently burns through massive context allocations. Gortex replaces linear string scanning with an on-disk SQLite knowledge graph generated through tree-sitter. The binary indexes functions, classes, call chains, HTTP endpoints, and cross-service dependencies, exposing them directly through a long-lived Model Context Protocol (MCP) daemon.
Parsing is categorized into three language tiers:
- Core Tier (16+ languages): High-precision AST parsing via hand-tuned queries for Go, Rust, TypeScript, Python, Java, Kotlin, C, C++, C#, PHP, Swift, Zig, Ruby, Elixir, OCaml, and Haskell.
- Heuristic Tier (~60 languages): Regex-based symbol extraction.
- Generic Tier (~165 languages): Structural signature fallback.
Multi-Repository Cross-Contract Mapping
For microservice architectures, Gortex extracts and unifies distributed contracts. It detects routes from web frameworks (FastAPI, Express, gin, Spring), alongside gRPC, GraphQL, and broker topics (Kafka, RabbitMQ). It normalizes endpoints into standardized IDs such as http::GET::/api/users/{id}, revealing missing consumers, orphaned routes, and schema drift across distinct git repositories.
Benchmarked Performance and Token Reductions
Project benchmarks report indexing the 70,333-file Linux kernel in approximately 3 minutes (300 files/sec, 5.07 GB peak heap on Apple Silicon) and the 10,762-file VS Code repository in roughly 1 minute (143 files/sec, 580 MB peak heap).
Because agents retrieve surgical AST declarations rather than raw files, sample ledgers report up to a 93.3% token reduction on complex queries. Precomputed depth-3 reach queries provide instant blast-radius feedback during code modifications.
Try it in 2 minutes
irm https://get.gortex.dev/install.ps1 | iex
gortex install
gortex daemon start --detach
gortex track ~/projects/myappbash
✓ When to use
- Complex microservice architectures requiring automated API and message topic resolution across repositories.
- Agentic workflows running against pay-per-token frontier models like Claude 3.5 Sonnet or Opus.
- Large legacy codebases where standard grep searches cause agents to derail or hit context degradation.
✕ When NOT to use
- Small single-file scripts or repositories under 2,000 lines where flat file injection easily fits in context.
- Workflows limited to flat-rate model subscriptions where per-token API expenditure is not tracked.
- Environments where running persistent background Go daemons is restricted by policy.
What to do today
- Install the Gortex static binary and run machine-level assistant configuration.
- Initialize Gortex inside your primary multi-service workspace to index contracts.
- Verify your agent detects the registered MCP tools before initiating complex cross-file refactoring.
Sources