Skip to content

Code Lab

Gortex Explained: What a Code Graph Can Save on Repository Searches

By Miles Park·
GitHub preview of zzet/gortex, a repository graph for coding agents

CODE LAB · PROJECT SPOTLIGHT

Gortex Go · Apache-2.0

Explore repository symbols and their relationships through a code graph.

Preview: GitHub · zzet/gortex

Gortex indexes a repository as a graph of files, symbols, imports and calls. A coding agent can ask for the neighborhood around a function and use the result to choose which files to read. The project’s homepage reports 688 tokens for that kind of lookup versus 11,480 in its example baseline. The useful question is how many tokens the agent reads after it has found the right code. Creator’s token-accounting example.

Gortex web interface showing a network of connected code symbols and repository files
Gortex’s public project screenshot. The connected nodes show the relationships the index exposes for navigation. Original repository image.

Start with one symbol and a question

Suppose a checkout total looks wrong. Search for the function that computes it, then follow the callers to the service that passes quantity and price. The project’s MCP documentation describes get_editing_context as a source of signatures and neighboring calls. A compact response can narrow the scope. Check the implementation and its tests before relying on the graph, especially where a call target is resolved at runtime. Pinned MCP reference.

zzet / gortexGo · source excerpt
GO  internal/mcp/tools_search_context.go
19    ranked := eng.SearchSymbolsRankedContext(ctx, queryText, limit, scope, scope.RerankContext)20    if ctx.Err() != nil {21        return nil22    }23    nodes := make([]*graph.Node, 0, len(ranked))24    for _, candidate := range ranked {25        if candidate != nil && candidate.Node != nil {26            nodes = append(nodes, candidate.Node)27        }28    }29    return nodes
Lines 19–29 · commit 5b9017aView original on GitHub ↗

Source credit: Gortex contributors. Apache-2.0 license.

The Go excerpt calls the ranked search, checks whether the request was canceled, then keeps the nonempty nodes in ranked order. This is the ranked-candidate path. The tools can then add source and graph relationships to help an agent decide what to inspect.

Recalculate the 94% example

baseline, graph_response = 11480, 688
print(f"{100 * (baseline - graph_response) / baseline:.1f}%")
# Observed: 94.0%

We verified the arithmetic using the creator’s published inputs. We also ran the checksum-verified Windows release to check its benchmark command. A local benchmark against a two-file fixture stopped because the benchmark runner needed Go on the host. No local retrieval or session-wide token savings were measured.

The project’s separate benchmark makes the trade-off visible. For one natural-language dashboard query, the graph returned 1,825 tokens and found the expected target file. The full-file ripgrep baseline returned 415 tokens with zero recall at the reported 2,000-token budget. A short response counts for little if the expected file is missing. When you compare methods, record both returned tokens and the expected files found. Project benchmark and reproduction commands.

Use a disposable repository for your first comparison

The official releases provide binaries. Review the setup guide before running gortex init, which can create agent configuration and hooks in a repository. For a fair lookup test, pick a known symbol plus one natural-language question, name the expected files, and compare graph retrieval with a fixed text-search baseline. Keep the token budget the same and check whether a human can find the correct implementation from the returned context. Official releases · Setup and command reference.

For a related repository graph workflow, see our Graphify walkthrough. This story was discovered via Mindung’s November 30 video. Graphify walkthrough · Mindung video.

Join the discussion

Your email address will not be published. Required fields are marked *