AI
OwlPath uses knowledge compression to help AI agents fix bugs faster with smaller context windows
A new reasoning layer converts source code into semantic knowledge graphs, allowing language models to find relevant code fragments 2x more effectively while cutting token usage by nearly 30%.
LLMs tasked with fixing software bugs face a fundamental constraint: their context windows—typically around 100K tokens—must accommodate large swaths of structurally relevant code to pinpoint the issue. Traditional code retrieval systems treat source files as plain text, forcing AI agents to laboriously trace multi-hop dependencies like inheritance chains and transitive function calls through repeated trial and error.
The Problem with Text-Based Code Search#
Current retrieval methods stumble when bugs require understanding how classes inherit from each other, which functions call which, or which components implement specific interfaces. These structural relationships span multiple files and levels of abstraction, yet text-matching approaches have no semantic model of the code's architecture. The result: agents waste tokens fetching irrelevant snippets and exhaust context before locating the actual problem area.
OwlPath's Semantic Knowledge Approach#
Researchers have developed OwlPath, a reasoning layer built atop CodeGraph, a popular code intelligence platform. The system encodes source code into an OWL2 ontology—a machine-readable knowledge representation that captures code structure semantics. Rather than searching for text patterns, agents now query this ontology using SPARQL property-path queries to instantly retrieve all structurally connected symbols with minimal irrelevant noise.
The approach relies on two key components:
- Transitive-closure engine: Uses single SPARQL queries to fetch all symbols linked via structural relations (subclass chains, callers, implementations) that plain text search would miss
- OWL Software Knowledge Map (OWL-SKM): Precomputes a compact 3KB summary containing module hierarchies, core APIs, and issue-related symbols, allowing agents to focus on target modules in the first query
OwlPath supports multi-language codebases—Python, JavaScript, TypeScript, Go and others—by leveraging tree-sitter parsing to extract language-specific semantics into a unified OWL2 model.
Measured Impact#
Testing on 18 real SWE-bench Pro bug-repair tasks showed OwlPath achieving a 68.4% success rate compared to 66.7% for CodeGraph, while reducing token usage by 28.8% and runtime by 39.5%. On offline retrieval benchmarks across 67 instances, the system improved recall by (0.464 vs 0.226) and hit 88.1% accuracy versus CodeGraph's 59.7%.

