Stitch
Case study·2 min read

Stitch

A code investigation tool that builds a multi-dimensional knowledge graph and lets an AI agent trace bugs, dependencies and behaviour through it.

The problem

Code questions are often about relationships — where a value changes, what calls a handler, or why a request reaches a particular path. Keyword search alone makes those connections difficult to follow.

The decision

Represent the repository as a graph with structural, dependency and semantic dimensions, then give a LangGraph agent specialised tools for traversing and querying those views during an investigation.

Stitch is a code investigation tool. It turns a repository into a knowledge graph, then gives an AI agent a way to query that graph while it works through a question. The goal is not to generate code from a prompt. It is to make the path from a symptom to the relevant part of a codebase easier to follow.

The graph keeps several kinds of information together: the structure of the repository, relationships such as calls and dependencies, and semantic links between pieces of code that are related even when they are not directly connected. That combination matters during an investigation. A useful answer may depend on what a function calls, where its data comes from, and what other code means something similar.

A question becomes a path through the code

The investigation agent uses specialised tools to move through those views instead of treating the repository as a pile of text. It can start with a symbol or search result, trace the surrounding relationships, and gather enough context to explain how a behaviour is connected. The interface also exposes the research map and evaluations, so the system can be examined as a set of decisions rather than only as a demo.

I built Stitch around a simple frustration: code questions are often relational. “Where is this value changed?” and “Why does this request reach that handler?” are not answered well by a single keyword search. They require following edges, checking the direction of a dependency, and keeping the path visible while the investigation develops.

Measured against real bug-finding tasks

The project includes an evaluation area using SWE-bench Verified Mini as a way to test code understanding and bug-finding on real-world issues. That gives the work a more useful test than a polished explanation alone: can the system help identify the relevant code and support an answer that holds up against the repository and its tests?

Stitch is still an experiment, but the direction is deliberate. Better code assistance should understand how a system is connected, show the route it took, and make it possible to inspect the evidence behind its answer.