AI
New Framework Helps AI Models Navigate and Understand Large Codebases
DeepDiscovery uses a two-stage approach to locate task-relevant code across sprawling industrial repositories, boosting AI coding agent performance on complex engineering tasks.
Researchers have developed DeepDiscovery, a framework designed to help large language models better understand and work with massive software repositories. The challenge being addressed is straightforward: while LLMs excel at many coding tasks, they struggle when faced with enormous industrial codebases where the relevant files and context are scattered across complex directory structures.
The Problem with Scale#
Existing retrieval methods typically fetch only small fragments of code from a repository, which often leaves AI models without enough context to understand the bigger picture. For intricate repository-level tasks—where understanding how components interact across multiple files is essential—this fragmented approach falls short. The researchers aimed to develop a solution that could recover the full scope of task-relevant material without requiring expensive offline preprocessing.
How DeepDiscovery Works#
The framework employs a two-stage process called location inference. In the first stage, it identifies high-confidence starting points (or "anchors") related to the task at hand. The second stage then expands outward, tracing through the repository's interconnected structure to pull in broader context while staying within computational budgets. This approach respects the multi-relational nature of modern codebases—function calls, imports, dependencies, and other relationships that bind files together.
Results Across Real-World Tests#
Testing occurred on three fronts. In controlled evaluations, DeepDiscovery outperformed five baseline methods at recovering task-relevant files on medium-scale tasks. When applied to internal production-scale repositories from an organization, the framework improved recall rates across multiple AI coding systems by margins ranging from 1.6 to 9.2 percentage points. On the SWE-bench Verified benchmark, a coding agent equipped with DeepDiscovery achieved a 78.6% solve rate—an 8.2 percentage point improvement over the baseline system.
Implications for Coding Assistants#
The research demonstrates that better repository understanding directly translates to better performance on complex software engineering tasks. As AI coding assistants become more prevalent in industry, the ability to navigate and comprehend large, interconnected codebases will likely become an important differentiator for both open-source and commercial tools.

