Skip to main content
Potpie reads every source file in a connected repository through a Tree-Sitter AST parser using language specific query patterns. Each file produces a set of typed nodes. The relationships between those nodes become edges. Potpie extracts three node types from every source file.
Node typeWhat it captures
FilePath, imports, exports, and the definitions it contains
Function / MethodName, parameters, return type, line number, and containing file
ClassName, methods, fields, and containing file
Each node receives a fully qualified name such as auth/service.py:AuthService.validate_token, making it referenceable across the entire graph.

How files are read

1

Definitions

Potpie extracts every definition in the file and turns it into a node. Each node stores its source text, file path, and line numbers.
2

References

Potpie extracts every reference and turns it into an edge pointing back to the definition it uses. Two edge types connect nodes.
Edge typeWhat it represents
CONTAINSA file holding a function or class
REFERENCESOne definition referencing another
3

Scoring

PageRank scores each node by how frequently other nodes reference it. These scored nodes then pass to inference, which gives each one a semantic meaning.
Supported languages: Python, Java, JavaScript, TypeScript, C#, C++, Go, Ruby, Rust, and PHP.