Before SBE
- LLM reads 10-20 files to find the relevant path.
- Guesses dependencies from imports and naming.
- Burns tokens on unrelated controllers, services, and DTOs.
- Misses downstream impact during refactors.
Open-source semantic graph engine for code context
LLM coding tools waste tokens when they load broad folders before understanding the change.
SBE turns repositories into semantic graphs for precise AI context retrieval.
sbe impact createUser --json
symbol: createUser
kind: Function
file: src/users/user.service.ts:18-42
dependencies:
-> validateCreateUserDto
-> UserRepository.save
-> hashPassword
dependents:
<- POST /users controller
<- createUserHandler
context:
4 files, 7 symbols, exact source ranges
Before / After
What It Does
Demo
$ sbe scan ./repo
SBE scan complete
indexed files : 214
graph : 918 symbols, 301 imports, 1440 edges
storage : ./repo/.sbe
elapsed : 682 ms
$ sbe graph createUser --json
{
"symbol": "createUser",
"dependencies": ["CreateUserDto", "hashPassword", "UserRepository.save"],
"dependents": ["UsersController.create", "createUserHandler"]
}
$ sbe impact saveUser
origin: saveUser
affected:
UsersService.createUser
UsersController.create
AuthService.register
tests/users/create-user.spec.ts
Download
Download the latest release artifact for your platform from GitHub Releases.
sbe-0.2.0-windows-x64.msi
Download MSI
sbe-linux-x64.tar.gz
Download archive
sbe-macos-arm64.tar.gz
Download archive
Why It Matters
AI tools are strongest when they receive the right code. They become expensive and unreliable when they read entire repositories, infer architecture from partial searches, or miss hidden dependents.
SBE reduces unnecessary context by retrieving code through a semantic graph. The result is smaller prompts, clearer dependency awareness, and better refactoring decisions.
Live Demo Case Study
This is a realistic simulated demo using honojs/hono, a TypeScript web framework. It shows how SBE would guide an AI assistant through a multi-file middleware bug without loading broad framework context.
Middleware post-processing after await next() should still apply headers when a downstream handler throws and onError creates the final response.
app.use(async (c, next) => {
await next()
c.header('x-request-processed', 'true')
})
$ sbe scan ./hono
$ sbe graph compose --json
$ sbe impact compose --json
The graph starts from the middleware composition function and follows dependents into dispatch, context response mutation, factory helpers, and tests.
src/compose.ts:18-102
src/hono-base.ts:210-275
src/context.ts:120-175
src/types.ts:40-88
src/helper/factory/index.ts:12-44
src/compose.test.ts:1-90
src/hono-base.test.ts:300-370
The numbers are demo estimates until reproduced against a checked-out Hono commit. The purpose is to show the SBE workflow: graph first, focused code ranges second, AI context last.
Architecture
V1 uses practical syntax-based TypeScript analysis through Tree-sitter. It is not a TypeScript type checker or language server. The goal is fast local graph retrieval for AI context.
Use Cases
See dependents and affected files before editing a shared symbol.
Trace services, controllers, DTOs, and database layers without opening broad folders.
Give agents structured context packets instead of raw repository dumps.
Query relationships between symbols, files, and code layers from the CLI.
Roadmap