Türkçe →

graphlore — token-efficiency benchmark

Headline: mean over 6 queries (send · auth · redirects · decoding · cookies · timeouts) on encode/httpx (2,101-node graph). Each query orients an agent to a code area; tokens = what reaches the model's context (≈ chars/4). Validated across JS/TS · Go · Java · Rust · C++ ↓

vs grep + read
263× fewer
vs semble + graphify
11.6× fewer
hidden links / query
7
tokens to orient
235

Mean tokens delivered (log scale — lower is better)

Naive grep + read
61,836
semble + graphify (separate)
2,721
semble alone
1,613
graphify alone
1,107
graphlore locate
235  ·  +7 hidden links

By capability

ApproachTokensCallsStructureSemanticHidden links
Naive grep + read61,836~14——0
semble alone1,6131—✓0
graphify alone1,1071✓—0
semble + graphify (separately)2,7214✓✓0
graphlore locate2351✓✓7

Per query

Querynaivesemblegraphifylocatehidden
async send request63,4971,6821,1752688
digest auth challenge7,5331,6037772437
redirect / location headers82,6111,6131,1682047
content decoding (gzip/brotli)67,1201,6941,1771895
cookie jar storage83,0011,5561,1702207
request timeout config67,2571,5321,17728610
Those ~235 tokens are a navigational map (seed file:line + structural neighborhood + hidden links), not raw code — you fetch the specific code only where needed. semble's ~1,600 tokens are readable code chunks; the two representations are complementary. graphlore optimizes for cheapest orientation plus the cross-check signal, then you drill in precisely.

Case study — the hidden links are real

Asked "does httpx duplicate request-sending across sync and async?", graphlore_locate (live over MCP) returned seed Client._send_single_request and flagged hidden links — every production flag checked out as a genuine sync/async twin in the source:

Flagged by locateVerified in httpx source
_send_single_request (seed + cousin)sync Client :1001 ↔ async AsyncClient :1717
handle_request / handle_async_requestsync ↔ async, in every transport (base · default · asgi · mock)
__enter__ / __aenter__sync ↔ async context managers (default.py)

~500 tokens (one locate + a targeted read) surfaced a real architectural pattern — httpx's deliberate parallel sync/async implementations — that reading _client.py (~16k tokens) would. The unreachable bucket also held test files (related, not refactor targets); the distance field separates production parallels (3–4) from that noise.

Across languages — real HTTP-client repos

The span join and the freshness check are not Python-only. I built AST-only graphs for an HTTP client in five more languages and ran the same kind of queries (send · redirects · timeout/retry · headers/auth · transport). Span-join precision = share of semble hits whose resolved node's real tree-sitter span actually contains the chunk; qualname = seeds that recover an FQN (e.g. Got.request, resty.Client.Get); locate vs grep = map tokens vs a naive grep+read for one representative query.

Span-join precision across languages — Python 96%, Go 93%, JS/TS 89%, Java 85%
LanguageRepoGraph nodesSpan-join precisionQualnameHidden / qlocate vs grepCalls (locate vs naive)
Python (ast)encode/httpx2,09596% (52/54)67%3.2272×1 vs 15 (0 vs 14 reads)
JavaScript / TSsindresorhus/got55689% (48/54)67%2.3583×1 vs 9 (0 vs 8 reads)
Gogo-resty/resty1,27793% (50/54)100%1.8911×1 vs 17 (0 vs 16 reads)
Javasquare/retrofit49785% (46/54)50%2.3217×1 vs 18 (0 vs 17 reads)
Rustalgesten/ureq1,44470% (38/54)83%3.7577×1 vs 22 (0 vs 21 reads)
C++libcpr/cpr35057% (31/54)100%4.3195×1 vs 16 (0 vs 15 reads)
Python uses the stdlib ast (exact, decorator-aware); JS/TS · Go · Java · Rust · C++ use tree-sitter with automatic language detection — one tool, zero per-language config. Precision is 57–96% across six very different graphs (350–2,095 nodes), the hidden-links cross-check keeps surfacing 2–4 candidates/query, and locate stays 195–911× cheaper than grep+read — at 1 tool call / 0 file reads where the grep-driven baseline spends 9–22 calls opening 8–21 files (89–95% fewer calls, same grep baseline as the token numbers). C++ trails at 57% and Rust at 70% — their non-contained remainder is mostly impl-block / file-top chunks where resolution to the introduced symbol is still correct (they recover qualified names at 83–100%) — not misroutes.

Freshness is correct across languages

For one real file per repo: a comment/reformat edit must read cosmetic (no regraph), an operator/identifier edit must read structural. The tree-sitter skeleton compares every token, so an operator flip or rename is caught — while a number changed inside a license-header comment is correctly ignored.

LanguageFileComment / reformatOperator / rename
Pythonhttpx/…cosmetic ✓structural ✓
JavaScript / TSas-promise/index.tscosmetic ✓structural ✓
Gocircuit_breaker.gocosmetic ✓structural ✓
JavaAndroidMainExecutor.javacosmetic ✓structural ✓
Rustagent.rscosmetic ✓structural ✓
C++accept_encoding.cppcosmetic ✓structural ✓