BGTS Context Engine CLI
A CLI and MCP server that build a code graph of a repository and answer an agent with a ranked, repeatable set of symbols.
- 180 ★ on the repository
- Last commit
- MIT
Extended access
Why this level
- The engine indexes your repository code into a database and stores its structure.
- When enabled the selector sends task file contents to the decision model.
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add cli/bgts-context-engineDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The engine indexes your repository code into a database and stores its structure.
- When enabled the selector sends task file contents to the decision model.
This is third-party code. Review the repository files before installing.
What it does
BGTS Context Engine indexes repositories into a graph: symbols, calls, references, type hierarchies, HTTP routes and cross-language bridges. A question such as why the login timeout fires on the meeting webhook is answered by walking the graph and returns the eight symbols that take part in the behavior, not those that merely mention a word. Embeddings are used only to find entry points when the task text names nothing recognizable, and they never affect ranking. For the same task text and commit the answer repeats byte for byte: no model, clock or randomness sits in retrieval. Above the ranking is an optional probabilistic step, a context selector, which picks from the ranked files those the task actually edits. It turns on when `BCE_SELECTOR` is set, and the `--no-select` flag returns the exact pack. Commands: `bce index`, `bce context --task`, `bce serve` for REST and a web UI and `bce serve-mcp` for agents. Cursor, Claude Code, OpenCode, Codex and Copilot have `*-init` commands.
Who it is for. Teams on large unfamiliar repositories where an agent burns tokens hunting for files and picks the wrong context.
Good fit when
- An agent must fix the login timeout and needs the functions that set and call it.
- You must replay what the agent was shown before a bad edit and find the faulty stage.
- A service spans several languages and links between them are lost in text search.
- Agent context must shrink to hundreds of tokens while staying complete.
Not a fit when
- You want simple text search without a deployed database.
- The project is tiny and the agent copes by reading every file.
- A machine cannot run PostgreSQL with extensions.
Example request
Use bce to find the eight symbols responsible for the login timeout on the meeting webhook and show the call chain.Limitations
PostgreSQL 16 with Apache AGE and pgvector in one database is required, easiest through `docker compose -f deploy/docker-compose.yml up -d`. For MCP install `bgts-context-engine[mcp]` so that `bce` is on the user PATH and not only in a `.venv`. Do not leave `bce serve-mcp` running in a terminal because the editor starts its own process. The selector uses a decision model: hosted Jev, or decider-2b and decider-4b on your own GPU. The token reduction figures over 600 changes were published by the authors, and on your code the result will differ.
How to disable. Run `pip uninstall bgts-context-engine`, stop the containers with `docker compose down` and remove the `bce` entries from editor configs created by the `*-init` commands.
FAQ
How do I index a repository?
With `bce index --repo /path/to/your/repo --name my-service` after `bce migrate`. A PostgreSQL database with AGE and pgvector must be running.
How do I get context for a task?
With `bce context --task "fix the login timeout in the meeting webhook"`. The result is identical for the same text and commit.
How do I connect to Claude Code?
Run `bce --env-file /path/to/engine/.env claude-init --repo-id my-service` in the project the agent works on. Cursor, OpenCode, Codex and Copilot have their own `*-init`.
What is the context selector?
An optional probabilistic step: a decision model picks from ranked files those the task edits. It turns on with `BCE_SELECTOR` and off with the `--no-select` flag.
Is there a web interface?
Yes, `bce serve` starts REST on port 8000 with docs at `/docs` and a web UI at `/ui/`.
Discussion
No questions or reviews yet.
Related
CLI toolsA local MCP server that indexes your code so the agent pulls the functions it needs instead of rereading whole files
Context Engine: code search and memory for an agent
Context Engine
A skill that teaches an agent to query the Context Engine code index and symbol graph before reading files directly
Selects code context for a coding agent from a repository graph, taking previous file reads and edits into account
A local code graph and context toolkit for agents: entities, Git relations and recorded mistakes served via CLI, hooks and MCP
An MCP server that turns a large codebase into a semantic feature graph for precise navigation and meaning-based search
An MCP server in one binary: AI reads and edits files across several projects and runs your commands
Comparison with similar tools
Cards that share the main search query, and how they differ.
| Tool | Official | Authentication | Repository stars | Main difference |
|---|---|---|---|---|
| BGTS Context Engine (this card) | no | 180 | ||
| CodeGraph | no | not required | 77,481 | also a code graph for agents; here a reproducible ranked answer and an optional context selector |
| code-graph-rag | no | not required | 5,352 | builds a graph for code questions; here byte-for-byte repeatable output and connection commands for five agents |
README in short
The README explains why embedding search misses and presents a graph walk as an exact answer. It describes results on 600 changes across 12 repositories, a quick start, agent connections, the web UI, supported models and limits.