Skip to content
Languages

Graphify for Ruby

tree-sitter-ruby · on-device

Graphify maps your Ruby codebase into an on-device knowledge graph — a structure of entities and typed relationships that your AI coding assistant queries instead of grepping. Nothing about Rubyis special-cased away: it's parsed the same deterministic way every other language is, into nodes and edges you can trace. New to the idea? Start with how Graphify works.

How Graphify parses Ruby

Ruby files (.rb, .rake, .gemspec) are parsed locally with tree-sitter using the bundled tree-sitter-ruby grammar. This is real AST extraction, not a model reading your source: Graphify walks the abstract syntax tree of each file and pulls out classes, modules, methods, requires, and call edges. Because it's parsing, the result is deterministic — the same code produces the same graph, with no API call and nothing to hallucinate.

What ends up in the graph

The Ruby entities the parser finds become nodes, and the relationships between them become edges: a function that calls another, a module that imports another, a type that's defined here and referenced there. Every one of these code edges is tagged EXTRACTED— Graphify's provenance label for a relationship that came straight out of the AST, as opposed to INFERRED (a model connected the dots) or AMBIGUOUS(evidence that couldn't be fully resolved, like dynamic dispatch). For Rubyparsed this way, the call graph is parsed fact, and it's labeled as such. The full provenance model is in concepts.

How your assistant queries it

Once the graph is built, your assistant reaches for it instead of dumping whole Ruby files into the context window. Ask "what breaks if I change this function?" and it traverses the call edges to find every caller, and the callers of those callers — a multi-hop answer that string search can't give you. Three commands drive it:

  • graphify query — everything connected to a Ruby symbol.
  • graphify path — the exact route between two entities.
  • graphify explain — why a given edge exists.

Your assistant can call these directly as a skill, or over Graphify's Model Context Protocol server. It works the same across the assistants Graphify supports — see the integrations page for the list.

Confidence you can trace

The point of the EXTRACTED tag is trust. When your assistant answers a question about your Rubycode by traversing the graph, you can see which hops are parsed facts and which are inferences. A similarity score from an embedding index can't tell you that; a graph can, because every answer is a path and every edge on it carries a label.

On-device by design

Parsing Rubyhappens on your machine with the bundled grammar. The graph lives in files on your disk — there's no account, no hosted index, and no telemetry. Graphify is open source under the MIT license; install it with uv tool install graphifyyand point it at your repository. The honest caveat is unchanged: Graphify adds no new place your code travels, but it doesn't change where your assistant sends its own prompts. Read the docs to build your first graph.

Graphify parses many languages the same way — see the full list of languages, or the neighbors Graphify for PHP and Graphify for Lua.