blog.dopana

Back

AI coding agents are powerful, but they waste tokens reading entire files when they only need a single function signature, a call chain, or an import graph. For large codebases, this inefficiency adds up fast.

Gortex solves this by indexing code into a persistent knowledge graph and exposing it through CLI, MCP Server, HTTP API, and a Web UI — giving AI agents surgical access to exactly the information they need.

What is Gortex?#

Gortex is a high-performance, graph-based code-intelligence engine built in Go. It indexes your codebase into a structured knowledge graph using tree-sitter AST analysis across 257 languages, enhanced with compiler-grade resolution for major languages. The result is a single static binary (zero dependencies) that serves as the brain for your AI coding assistant.

It supports 19 AI coding agents out of the box — Claude Code, Kiro, Cursor, Windsurf, VS Code / Copilot, Continue.dev, Cline, OpenCode, Antigravity, Codex CLI, Gemini CLI, Zed, Aider, and more. One gortex init configures every detected agent on your machine.

Why Gortex Matters#

Up to 50× Fewer Tokens#

Instead of feeding AI agents full source files, Gortex serves precise subgraph queries. The token savings dashboard shows real results:

Cost avoided: $168.69 (claude-opus-4) across 1,878 calls · 11,246,094 tokens saved
Today        ████████░░░░░░░░ 50.0% saved   9,200 / 18,400 tokens
Last 7 days  ██████████░░░░░░ 62.5% saved  60,100 / 96,200 tokens
All time     ███████████████░ 93.3% saved  11,246,094 / 12,050,716 tokens $168.69
txt

257 Languages#

Three parsing tiers ensure every file in your repository is reachable:

  1. Bespoke tree-sitter grammars — deep AST analysis for major languages
  2. Regex-based extractors — broad coverage for smaller ecosystems
  3. Forest-backed signatures — fallback for anything not explicitly handled

Plus support for Jupyter and Databricks notebooks.

Multi-Repository by Default#

N repos in one graph — contracts, references, and call chains span repo boundaries with evidence-gated resolution, contract matching, and impact analysis.

Zero Dependencies#

Single static binary for macOS, Linux, and Windows. No Node.js, no Python, no Docker. No network required. Install and use instantly.

Key Features#

FeatureDescription
257 language grammarsTree-sitter AST + compiler-grade resolution for Python, TypeScript, Go, Rust, C/C++, Java, Kotlin, Swift, Zig, Ruby, and more
175 MCP toolsSymbol lookup, call chains, blast radius, dataflow, clone detection, code actions — use only what you need
19 agent integrationsOne command configures every AI coding agent on your machine
Cross-repo API contractsAuto-detects HTTP, gRPC, GraphQL, Kafka, WebSocket contracts across repos
Semantic searchBuilt-in GloVe-50d (3.8 MB, zero deps), opt-in MiniLM / Ollama / OpenAI
Blast radius analysisPrecomputed depth-3 reach index turns impact queries into O(seeds × reach) lookups
Speculative executionpreview_edit / simulate_chain answer “what would change?” without touching disk
Live editor overlaysPush unsaved buffers as a shadow graph; branching for parallel speculative sessions
GCX1 wire format−27% tokens vs JSON at same fidelity
PR reviewEnd-to-end: triage open PRs, emit line-anchored findings with BLOCK/REVIEW/APPROVE verdicts
Web UIStandalone Next.js 15 UI with 3D force-directed graph visualization
Long-living daemonOne process serves every IDE window; live fsnotify, on-disk snapshots, restart

Cross-Repo API Contracts#

Gortex auto-detects API contracts across repositories and matches providers to consumers:

Contract typeDetection
HTTP routesFramework annotations (gin, Express, FastAPI, Spring…)
gRPCProto service definitions
GraphQLSchema type/field definitions
Message topicsKafka / RabbitMQ / NATS / Redis pub/sub
WebSocketEvent emit/listen patterns
Env varsos.Getenv, process.env, .env files
OpenAPISwagger / OpenAPI spec files
Temporal workflowsGo / Java SDK annotations

Contracts are normalized to canonical IDs (e.g. http::GET::/api/users/{id}) and matched across repos to detect orphan providers/consumers and mismatches.

Performance Benchmarks#

Measured on an Apple Silicon laptop:

RepositoryFilesNodesEdgesIndex timePeak heap
torvalds/linux70,3331,690,1746,239,570~3 min5.07 GB
microsoft/vscode10,762204,501808,902~1 min580 MB
Gortex (self)4305,58353,8303.4s52 MB

Parsing dominates wall time (65–80%); reference resolution and search-index build scale sub-linearly.

Installation#

# macOS / Linux
curl -fsSL https://get.gortex.dev | sh

# Windows (PowerShell)
irm https://get.gortex.dev/install.ps1 | iex
bash

The installer detects OS/arch, verifies SHA256 + cosign signatures, and installs to PATH.

Quick Start#

gortex install # One-time machine setup
gortex daemon start --detach # Start background daemon
gortex track ~/projects/myapp # Add a repository
cd ~/projects/myapp && gortex init # Per-repo config
bash

Your AI assistant now uses graph queries instead of raw file reads.

Architecture#

gortex binary
CLI (cobra) ──> MultiIndexer ──> In-Memory Graph (shared, per-repo indexed)
MCP (stdio) ──────────────────> Query Engine
HTTP /v1/* ────────────────────> Same tools + /v1/graph + /v1/events (SSE)
Daemon ────────────────────────> Shared graph for every MCP client
MultiWatcher <── filesystem events (fsnotify, per-repo)
CrossRepoResolver ──> Cross-repo edge creation
Persistence ──> gob+gzip snapshot
txt

Gortex vs. Alternatives#

FeatureGortexGraphifyTraditional RAG
Languages25736N/A
Multi-repo✅ First-class❌ Single repo
MCP tools175Limited
Agent integrations19CLI skill
Token savingsUp to 50×Significant
Cross-repo contracts✅ HTTP, gRPC, Kafka, etc.
Zero dependencies✅ Single Go binary✅ Python❌ Embeddings
Blast radius✅ O(seeds × reach)
Web UI✅ 3D force-directed graph✅ Interactive graph
LicenseApache 2.0Apache 2.0Varies

Summary#

Gortex is a remarkably complete code-intelligence engine. With 257-language support, multi-repo by default, 175 MCP tools, 19 agent integrations, and proven token savings of up to 50×, it’s one of the most comprehensive tools available for making AI coding agents truly efficient on large codebases.

Its single-binary zero-dependency design means you can install and start saving tokens in minutes — no infrastructure, no dependencies, no cloud required.

References#