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.

Learn AI for Free — FreeAcademy.ai

Take "Prompt Engineering Practice" — a free course with certificate to master the skills behind this story.

More in Tools

Cloudflare Launches Agent Memory Private Beta to Give AI Agents Persistent Recall
Tools

Cloudflare Launches Agent Memory Private Beta to Give AI Agents Persistent Recall

Cloudflare's new Agent Memory service extracts and stores information from AI agent conversations so models can recall context across sessions without bloating the token window, addressing one of agentic AI's biggest bottlenecks.

2 days ago2 min read
OpenAI Turns Codex Into a Super App With Computer Use, Atlas Browser, and Image Generation
Tools

OpenAI Turns Codex Into a Super App With Computer Use, Atlas Browser, and Image Generation

OpenAI's latest Codex desktop update lets the agent operate other apps, browse the web in-app, generate images, and run scheduled automations — moving the product from coding tool to full AI super app.

2 days ago3 min read
Anthropic Launches Claude Design, Turning Text Prompts Into Slides, Prototypes and One-Pagers
Tools

Anthropic Launches Claude Design, Turning Text Prompts Into Slides, Prototypes and One-Pagers

Anthropic introduced Claude Design on April 17, 2026, a research preview that converts text descriptions into shareable visuals like prototypes, slides and one-pagers using Claude Opus 4.7.

3 days ago2 min read