Back to stories
Tools

Sourcegraph Launches Cody Context Engine — AI Code Assistant That Understands Your Entire Codebase

Michael Ouroumis2 min read
Sourcegraph Launches Cody Context Engine — AI Code Assistant That Understands Your Entire Codebase

Sourcegraph has launched the Cody Context Engine, a major upgrade to its AI coding assistant that indexes entire codebases into a persistent semantic graph. The system lets AI models answer questions across millions of lines of code without hitting context window limits — solving one of the biggest pain points in AI-assisted development.

The Problem It Solves

Every AI code assistant faces the same fundamental constraint: context windows. Even with Claude's 200K tokens or Gemini's 1M tokens, large enterprise codebases simply don't fit. Developers end up manually selecting which files to include, and the AI misses critical context from the rest of the codebase.

The Cody Context Engine takes a different approach. Instead of stuffing code into a prompt, it pre-indexes the entire repository into a semantic graph that maps code structure, function call chains, type hierarchies, dependency relationships, and usage patterns. When a developer asks a question, Cody queries the graph to retrieve exactly the relevant context — then passes only that context to the underlying LLM.

How It Works

The indexing pipeline runs in three stages:

  1. Structural indexing: Parses every file to extract symbols, types, function signatures, imports, and module boundaries
  2. Semantic embedding: Embeds code chunks and documentation into a vector space for similarity search
  3. Graph construction: Builds a dependency graph linking callers to callees, types to implementations, and tests to the code they cover

The graph updates incrementally on every commit, keeping the index current without full re-indexing.

Benchmarks

Sourcegraph tested the Context Engine against standard RAG-based retrieval (the approach used by most competitors) on three enterprise codebases:

CodebaseSizeContext Engine AccuracyStandard RAG
Stripe (monorepo)12M lines84%51%
Shopify (Ruby/TS)28M lines79%43%
Internal test repo50M lines72%38%

Accuracy was measured as the percentage of developer questions answered correctly without manual file selection.

Pricing and Availability

The Context Engine is available today for Sourcegraph Enterprise customers and in beta for Cody Pro users ($19/month). It supports Claude Sonnet 4.5, GPT-5, and Gemini 3.1 Pro as backend models. The free tier of Cody includes graph-based context for repositories under 100,000 lines.

Why It Matters

The launch signals a broader shift in AI-assisted development: from "give the model more context" to "give the model better context." As codebases grow and AI models plateau on raw context length, intelligent retrieval systems like the Context Engine may prove more valuable than longer context windows.

Competitors are watching. GitHub confirmed that Copilot is "exploring similar graph-based approaches" for enterprise customers, and JetBrains said its AI Assistant would add codebase-wide indexing later this year.

More in Tools

Best AI Code Review Tools in 2026 — A Developer's Guide
Tools

Best AI Code Review Tools in 2026 — A Developer's Guide

A practical comparison of the top AI code review tools in 2026, covering GitHub Copilot Code Review, CodeRabbit, Sourcegraph Cody, and others — with pricing, features, and real-world trade-offs.

1 day ago2 min read
Microsoft Copilot Workspace Hits GA — AI Plans and Executes GitHub Issues
Tools

Microsoft Copilot Workspace Hits GA — AI Plans and Executes GitHub Issues

Microsoft announces general availability of Copilot Workspace, a tool that reads GitHub issues, generates implementation plans, writes code across multiple files, and opens pull requests — all from a single click.

1 day ago2 min read
Replit Agent 2.0 Builds and Deploys Full-Stack Apps From a Prompt
Tools

Replit Agent 2.0 Builds and Deploys Full-Stack Apps From a Prompt

Replit launches Agent 2.0, an AI system that takes a natural language description and autonomously builds, debugs, and deploys a complete web application — including database, authentication, and hosting — in minutes.

1 day ago2 min read