DEV Community

Cover image for DevGraph AI: Debugging Smarter with Graph-Powered Intelligence
GAURAV KUNDU
GAURAV KUNDU

Posted on

DevGraph AI: Debugging Smarter with Graph-Powered Intelligence

DevGraph AI: Exploring FalkorDB for Smarter Debugging

When working on a project, finding a bug is not always the hardest part. Sometimes the real problem is figuring out which file or function is causing it. In a large codebase, one function may depend on several others, and tracing all those connections manually can take a lot of time.

We started building DevGraph AI to explore whether graph databases and AI could make this process easier. It is our project for the FalkorDB Hackathon.

  1. What is DevGraph AI?

DevGraph AI is a tool for investigating bugs by understanding how different parts of a codebase are connected.

The idea is to upload a repository, extract its code structure, and represent the relationships between files, functions, classes, and tests in a graph. When a developer reports a bug, these connections can help identify the parts of the code worth investigating.

The basic workflow looks like this:

  1. Upload a repository as a ZIP file.
  2. Parse the supported source code.
  3. Store code entities and their relationships in FalkorDB.
  4. Enter a bug description.
  5. Explore related code and gather evidence for the investigation.

  6. Features

The project includes several features that support this workflow:

  • Repository upload and indexing
  • Visual exploration of files, functions, classes, and their relationships
  • Bug investigation using a natural-language description
  • Source-code browsing to inspect relevant files
  • Graph queries to explore dependencies
  • Discovery of related tests
  • Patch review for inspecting proposed code changes

Test execution and patch validation depend on the relevant backend functionality being available and working correctly.

  1. Why FalkorDB?

The main reason we chose FalkorDB is that code is full of relationships.

For example, a file imports another file, a function calls another function, and a test checks a particular part of the application. These connections can help us understand where a bug might originate.

With FalkorDB, we can represent code entities as nodes and their relationships as edges. We can then use graph queries to explore connections between them.

A relational database can store this information too, but graph queries are a natural fit when we need to follow paths across connected entities.

In DevGraph AI, FalkorDB is used to store and explore the repository graph. The aim is to use those results to give the investigation more context instead of relying only on a bug description.

4. Tech stack

Here is the stack we are using and why:

  • React + Vite — frontend and user interface
  • Python — source-code parsing and investigation logic
  • FastAPI — backend APIs
  • FalkorDB — storage and querying of code relationships
  • Cypher-style queries — exploring connected code entities
  • Language parsers — extracting information from supported source files
  • LLM integration — helping analyze retrieved code and suggest possible causes when configured

The frontend handles user interaction, FastAPI connects the different parts, the parsers extract code information, and FalkorDB stores the relationships. The AI layer can use the retrieved context to help investigate an issue.

  1. Example: A checkout bug

Suppose a developer reports that the checkout total is wrong when a discount is applied.

Instead of searching every file manually, DevGraph AI aims to:

  1. Find code related to checkout and discounts.
  2. Explore connected functions through the graph.
  3. Retrieve relevant source files and tests.
  4. Use the available code context to suggest possible causes.
  5. Check relevant tests where execution is supported.
  6. Let the developer review any proposed changes.

The graph helps narrow the search, but it does not automatically prove which function is responsible. Source-code evidence and test results are still important.

  1. What comes next?

We still have areas to improve, including support for more programming languages, graph visualization, investigation accuracy, test execution, and patch validation.

One thing we find interesting about this project is that graph databases can be useful for more than social networks or recommendation systems. Software repositories also contain many connected entities, and those connections can be valuable when debugging.

That is what we are exploring with DevGraph AI: using FalkorDB to understand code relationships and help developers investigate bugs with better context.

Thanks to the FalkorDB team for organizing the hackathon and giving us a chance to build and experiment with this idea.

Top comments (0)