Skip to main content

DevQL — Development Query Language

DevQL is a graph-navigation query language for codebase intelligence. It traverses your repository's knowledge graph by chaining stages — navigating from repositories to files to artefacts to dependencies to tests, all resolved against immutable commit snapshots.

Why DevQL?

Without structured context, AI agents waste tokens navigating your codebase and miss architectural patterns. DevQL gives agents precise, high-signal context:

  • Structural queries — find specific artefacts by kind, language, or symbol name
  • Dependency traversal — follow imports, calls, references, inheritance edges
  • Blast radius — compute what breaks if a symbol changes
  • Historical snapshots — query the codebase at any commit
  • External knowledge — surface linked issues, tickets, and decisions

Query Model — Stage Chaining

DevQL queries chain stages together, each narrowing or expanding the result set:

artefacts(kind:"function", language:"typescript")
→ deps(direction:"out", kind:"imports")

Core Stages

StagePurposeExample
artefacts()Select code symbolsartefacts(kind:"function", symbol_fqn:"auth::validate")
deps()Traverse dependenciesdeps(direction:"in", kind:"calls")
asOf()Query at a specific point in timeasOf(commit:"a1b2c3d")

Artefact Filters

artefacts(
kind: "function | method | class | interface | type | enum | module | struct | trait",
language: "typescript | javascript | rust",
symbol_fqn: "module::symbol_name"
)

Dependency Traversal

deps(
direction: "out | in | both",
kind: "imports | calls | references | extends | implements | exports"
)
  • direction:"out" — what does this symbol depend on?
  • direction:"in" — what depends on this symbol? (reverse dependencies)
  • direction:"both" — full dependency neighbourhood

Edge Kinds

KindMeaning
importsModule A imports from module B
callsFunction A calls function B
referencesSymbol A references symbol B
extendsClass A extends class B
implementsStruct A implements trait B
exportsModule A exports symbol B

Blast Radius — Impact Analysis

One of DevQL's most powerful capabilities: answering "what will this break?"

bitloops devql query "artefacts(symbol_fqn:'auth::validate_token') → deps(direction:'in', kind:'calls')"

This computes the transitive impact by following all incoming call edges — every function that directly or indirectly calls validate_token. If you change that function's signature, these are the artefacts that break.

Historical Snapshots

DevQL resolves queries against immutable commit snapshots:

# Query current workspace state (default)
bitloops devql query "artefacts(language:'rust')"

# Query at a specific commit
bitloops devql query "asOf(commit:'a1b2c3d') → artefacts(kind:'function')"

# Query at a branch ref
bitloops devql query "asOf(ref:'main') → artefacts(kind:'struct')"

Current vs Historical State

DevQL maintains two state models:

StateTablesUse Case
Currentartefacts_current, artefact_edges_currentLatest workspace, including uncommitted changes
Historicalartefacts, artefact_edgesCommitted state at any point in git history

The default query (no asOf) returns current workspace state. Historical queries use asOf(commit:"...") or asOf(ref:"...").

Knowledge Graph Contents

Artefacts (nodes):

  • Functions, methods, classes, interfaces, types, enums, structs, traits, modules
  • Each with: source content, file path, line numbers, language, metadata

Edges (relationships):

  • Imports, calls, references, extends, implements, exports
  • Each with: source/target artefact, edge kind, line numbers, metadata

External knowledge (optional):

  • GitHub issues/PRs, Jira tickets, Confluence pages
  • Versioned and linked to specific commits and artefacts

Supported Languages

LanguageParserExtracted Artefact Types
Rusttree-sitter-rustFunctions, structs, enums, traits, modules, impls
TypeScripttree-sitter-typescriptFunctions, classes, interfaces, types, modules
JavaScripttree-sitter-javascriptFunctions, classes, modules, exports

Parsing is deterministic and parser-backed (Tree-sitter), not heuristic.

Three-Store Architecture

StoreDefaultContents
RelationalSQLite (bundled)Artefacts, dependency edges, semantic features
EventDuckDB (bundled)Checkpoints, transcripts, telemetry
BlobLocal filesystemRaw content, embeddings, knowledge documents

Zero configuration required — SQLite and DuckDB are compiled into the binary. See Configuring Storage for team setups.

Getting Started

See Configuring DevQL for setup, and the DevQL Query Cookbook for practical examples.