
**Deterministic code-graph context for AI coding agents.**
Ask *"why does the login timeout fire on the meeting webhook?"* and get the eight symbols
that actually answer it — ranked, budgeted, and reproducible.
[](#results)
[](#results)
[](#results)
[](#results)
[](#results)
Two coding agents, 600 real merged changes, 12 repositories, 6 languages — the agent alone against the same agent with BCE as its first step.
[](https://pypi.org/project/bgts-context-engine/)
[](https://pypi.org/project/bgts-context-engine/)
[](https://github.com/bgts-ai-org/bgts-context-engine/actions/workflows/ci.yml)
[](LICENSE)
[](docs/mcp.md)
[](https://github.com/bgts-ai-org/bgts-context-engine/stargazers)
[Results](#results) · [Quick start](#quick-start) · [Use it from your agent](#use-it-from-your-agent) · [How it works](#how-it-works) · [Supported models](#supported-models) · [Selector models](docs/selector.md) · [Documentation](#documentation) · [Website](https://bgts-ai-org.github.io/bce-microsite/) · [Türkçe](README.tr.md)
---
## Why this exists
An agent working on an unfamiliar repository has to decide what to read before it can
decide what to change. The usual answer is embedding search over chunked files. It is cheap
to build and wrong in a specific way: it returns text that *reads* like the question rather
than code that *participates* in the behaviour. Ask about a login timeout and you get the
five files that mention timeouts, not the one function that sets it and the three callers
that break when you change it.
That information is structural, and it has an exact answer. `handleLogin` calls
`refreshSession`, which reads `SESSION_TTL`, which is written in exactly one place. That is
a graph walk.
BGTS Context Engine indexes your repositories into that graph — symbols, calls,
references, type hierarchies, HTTP routes, cross-language bridges — and answers questions
by walking it. Embeddings are used in one place only: finding entry points when the task
text names nothing recognisable. They never affect ranking.
**The same task text, against the same commit, returns the same ranking.** No model in
the retrieval path, no clock, no randomness. When an agent makes a bad change you can
replay exactly what it was told, find the stage that surfaced the wrong symbol, and fix
that stage.
On top of that ranking sits one optional, clearly marked probabilistic step: a *context
selector* that asks a decision model which of the ranked files the task actually edits and
hands the agent those in full, the likely-related ones as one line each, and nothing else.
On 600 real changes it cut the tokens handed to the agent from 8 310 to 1 121 (−87 %) for
about one point of recall (94.4 → 93.3). It is off until
`BCE_SELECTOR` names a model — hosted Jev, or decider-2b / decider-4b on your own GPU — and
`--no-select` gives back the byte-exact pack.
The engine is published so people can run it. Organisations that want the same thing
inside their own perimeter — help with indexing, deployment, scoring tuned to their
repositories, or the agent stack around it — can engage
[BGTS](https://www.bgts.com) for consulting. Write to
**opensource-ai@bgts.com**.
## Results
Two coding agents ran the same 600 tasks. Each task is a change a project actually merged,
50 per repository across 12 open-source repositories in six languages: flask and requests
(Python), express and axios (JavaScript), nest and vite (TypeScript), guava and netty
(Java), efcore and PowerShell (C#), gin and prometheus (Go). The agent gets the developer's
sentence in a copy with the history removed and has to name the source files the change
touched. Every task ran twice: the agent **alone**, with its own grep, glob and read tools,
and the agent **with BCE as its first step** (`BCE_AGENT_MODE=hint`): it asks the engine,
starts from the answer and adds to it when it needs to.
| Per task | Cursor CLI · grok-4.7-high-fast