# AI use cases for BGTS Context Engine (bgts-ai-org/bgts-context-engine)

Repo: [bgts-ai-org/bgts-context-engine](https://github.com/bgts-ai-org/bgts-context-engine) | Use cases: 4 | Page: https://dedupedai.com/use-cases/bgts-ai-org-bgts-context-engine/

A deterministic code-graph context engine that indexes your repositories and returns ranked code symbols to AI coding agents over MCP, REST or the command line.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Find the symbols behind a bug question before editing: https://dedupedai.com/use-cases/bgts-ai-org-bgts-context-engine/rank-code-symbols-for-a-bug-question/
- Let a coding agent pull ranked context over MCP: https://dedupedai.com/use-cases/bgts-ai-org-bgts-context-engine/give-mcp-agent-ranked-context-over-mcp/
- Replay a retrieval call to audit a bad agent change: https://dedupedai.com/use-cases/bgts-ai-org-bgts-context-engine/replay-a-retrieval-call-to-audit-an-agent/
- Trace React Native calls into native Swift, Kotlin or Objective-C: https://dedupedai.com/use-cases/bgts-ai-org-bgts-context-engine/trace-react-native-calls-into-native-code/

## How to find the symbols behind a bug question before editing with BGTS Context Engine

Repo: [bgts-ai-org/bgts-context-engine](https://github.com/bgts-ai-org/bgts-context-engine) | Difficulty: Intermediate | Time: 1 hour | Basis: From the README

Ask a plain bug question and get the ranked code symbols that answer it.

**Who it is for:** A developer or coding agent starting work on an unfamiliar repository, with a bug report that describes behaviour rather than file names.

**The problem:** Embedding search returns files that mention the words in the question, not the functions that set the behaviour and the callers that depend on it.

**The outcome:** A ranked, budgeted list of the symbols that participate in the behaviour, with a coverage report showing how much of the answer to trust.

### Steps

1. `docker compose -f deploy/docker-compose.yml up -d`
2. `pip install bgts-context-engine`
3. `cp .env.example .env`
4. `bce migrate`
5. `bce index --repo /path/to/your/repo --name my-service`
6. `bce context --task "fix the login timeout in the meeting webhook"`

### Prompt to paste into your agent

```text
Using the bgts-context-engine repository, index the repository at <target repo path> with bce index, then run bce context with the bug description <bug description> as the task. Expected output: a ranked list of symbols with a coverage report. Verify that the top results include the function that sets the behaviour named in the bug.
```

### Caveat

The benchmark figures in the README come from BGTS's own harness, which is not yet in this repository, so check the ranking on your own code before relying on it.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/bgts-ai-org-bgts-context-engine/rank-code-symbols-for-a-bug-question/

## How to let a coding agent pull ranked context over MCP with BGTS Context Engine

Repo: [bgts-ai-org/bgts-context-engine](https://github.com/bgts-ai-org/bgts-context-engine) | Difficulty: Intermediate | Time: 1 hour | Basis: From the README

Connect an MCP-capable coding agent to the code graph so it asks before it searches.

**Who it is for:** A team running an MCP-capable coding agent on a large repository that spends many tool calls grepping for the files a task touches.

**The problem:** The agent re-reads the same context on every turn while it searches the tree, which costs tokens, time and tool calls.

**The outcome:** The agent starts from a ranked answer served over stdio and adds to it only when it needs more, so it makes fewer tool calls and turns.

### Steps

1. `docker compose -f deploy/docker-compose.yml up -d`
2. `pip install bgts-context-engine`
3. `bce migrate`
4. `bce index --repo /path/to/your/repo --name my-service`
5. `pip install "bgts-context-engine[mcp]"` (inferred, check the README)
6. `bce serve-mcp`

### Prompt to paste into your agent

```text
In the bgts-context-engine setup, make sure the repository at <target repo path> is indexed, then start the MCP server with bce serve-mcp and connect the agent to it over stdio. Expected output: the agent gets a ranked answer for the task <task text> before any grep or glob call. Verify that the agent's first tool call is to the context tool and that the returned symbols include the files the task changes.
```

### Caveat

The README says the MCP surface needs the mcp extra, but its exact install command is cut off in the text provided, so the extra install step above is inferred.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/bgts-ai-org-bgts-context-engine/give-mcp-agent-ranked-context-over-mcp/

## How to replay a retrieval call to audit a bad agent change with BGTS Context Engine

Repo: [bgts-ai-org/bgts-context-engine](https://github.com/bgts-ai-org/bgts-context-engine) | Difficulty: Intermediate | Time: 1 hour | Basis: From the README

Re-run the exact context an agent received and check which stage surfaced the wrong symbol.

**Who it is for:** A tech lead or reviewer who needs to explain why an agent made a bad change and wants to see exactly what it was told.

**The problem:** Without a record of the retrieval inputs, it is hard to tell whether the agent or the context caused a bad change.

**The outcome:** The same task text against the same commit returns the same ranking, so the failing stage can be found and fixed.

### Steps

1. `docker compose -f deploy/docker-compose.yml up -d`
2. `pip install bgts-context-engine`
3. `bce migrate`
4. `bce index --repo /path/to/your/repo --name my-service`
5. `bce context --task "fix the login timeout in the meeting webhook" --no-select` (inferred, check the README)
6. `bce bench`

### Prompt to paste into your agent

```text
Using the bgts-context-engine repository, index <target repo path> at the commit <commit id>, then run bce context with the task <task text> and the flag --no-select. Expected output: the byte-exact context pack. Verify by running the same command again and confirming the output matches.
```

### Caveat

The README says bce bench checks determinism by running each case repeatedly, but the case format is not in the text provided, so check its arguments in the docs before use.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/bgts-ai-org-bgts-context-engine/replay-a-retrieval-call-to-audit-an-agent/

## How to trace React Native calls into native Swift, Kotlin or Objective-C with BGTS Context Engine

Repo: [bgts-ai-org/bgts-context-engine](https://github.com/bgts-ai-org/bgts-context-engine) | Difficulty: Intermediate | Time: 1 hour | Basis: From the README

Find the native method behind a NativeModules call in a React Native or Expo app.

**Who it is for:** A developer on a React Native or Expo app who needs to find the native implementation behind a TypeScript call.

**The problem:** No single parser can see a call that crosses from TypeScript into Objective-C, Swift or Kotlin, so the native side is easy to miss.

**The outcome:** The context answer links the NativeModules call in TypeScript to the native method it reaches.

### Steps

1. `docker compose -f deploy/docker-compose.yml up -d`
2. `pip install bgts-context-engine`
3. `bce migrate`
4. `bce index --repo /path/to/your/react-native-app --name my-app` (inferred, check the README)
5. `bce context --task "where does NativeModules.Foo.bar() end up on the native side"` (inferred, check the README)

### Prompt to paste into your agent

```text
Using the bgts-context-engine repository, index the React Native app at <target repo path>, then run bce context with the task <question about a NativeModules call>. Expected output: a ranked answer that includes the native Objective-C, Swift or Kotlin method. Verify that the native method is linked from the TypeScript call site.
```

### Caveat

The README describes these bridges for React Native and Expo only, so other cross-language calls may not be linked.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/bgts-ai-org-bgts-context-engine/trace-react-native-calls-into-native-code/
