GRAPHREPO: KNOWLEDGE GRAPHS FOR AI
AI coding agents are only as good as the context you give them. Feed an agent a flat file dump and it will hallucinate imports, misname functions, and miss the architectural intent of the code it is trying to modify. GraphRepo exists to solve that problem — it turns any repository into a structured, traversable knowledge graph that an AI agent can navigate the same way a senior engineer navigates a codebase they know well.
The Problem
Modern codebases are not flat. They are webs of relationships: modules import from other modules, functions call other functions, types flow through interfaces, and configuration files wire everything together. When you paste a single file into a prompt, you lose all of that structure. The agent sees tokens, not architecture.
The result is brittle suggestions, broken imports, and code that looks right in isolation but fails the moment it touches the rest of the system. The agent needs a map — not just a snapshot.
How GraphRepo Works
GraphRepo parses your repository and builds a directed graph where every meaningful unit of code becomes a node and every relationship becomes an edge. The process has three stages:
GraphRepo walks the repository tree, identifies source files, and extracts the abstract syntax tree (AST) for each supported language. From every AST it pulls out the entities that matter: files, classes, functions, variables, types, and exports.
Once every entity is a node, GraphRepo resolves the edges. Import statements become dependency edges. Function calls become invocation edges. Type annotations become type-reference edges. Re-exports, inheritance, and interface implementations all get their own edge types. The result is a richly-typed directed graph that encodes the real structure of the codebase.
The graph is serialised and made queryable. An AI agent can ask questions like "what does this function depend on?", "which files import this module?", or "trace the type flow from this interface to its consumers" — and get structured answers instead of grep output.
Because the graph preserves direction and type information, agents can scope their context window to exactly the subgraph they need. Instead of dumping an entire repository into a prompt, you give the agent a focused neighbourhood of relevant nodes and edges. Less noise, better results.
What the Graph Contains
Files, directories, functions, classes, variables, types, interfaces, exports
Imports, calls, type references, inheritance, re-exports, implementations
File paths, line numbers, language, scope, visibility, docstrings
Getting GraphRepo on the VS Code Marketplace
The next milestone for GraphRepo is shipping it as a VS Code extension — giving every developer one-click access to a knowledge graph of their current workspace. Here is the path from open-source repo to published extension:
1. Build the extension wrapper
VS Code extensions are Node.js packages with a package.json that declares activation events, commands, and contributions. The GraphRepo extension activates on workspace open, indexes the repository in the background, and exposes commands to query the graph through the command palette or through an AI agent integration.
2. Package with vsce
Microsoft's @vscode/vsce CLI bundles the extension into a .vsix file. This handles dependency resolution, tree-shaking, and packaging the extension manifest. Run vsce package to produce the distributable.
3. Create a publisher
The VS Code Marketplace requires a publisher identity. Create one at the Visual Studio Marketplace management portal using an Azure DevOps organisation. The publisher name goes into the extension's package.json under the publisher field.
4. Publish
Generate a Personal Access Token (PAT) from Azure DevOps with the Marketplace (Manage) scope. Then run vsce publish with your PAT. The extension goes through a brief verification and appears in the Marketplace within minutes. Subsequent updates follow the same flow — bump the version and publish again.
5. CI/CD for updates
Automate publishing with a GitHub Action that triggers on tagged releases. The action installs vsce, runs the test suite, packages the extension, and publishes it — all without manual intervention.
Why It Matters
GraphRepo is part of a broader vision at The Muses: making AI development tools open and accessible. The same knowledge-graph approach that helps a coding agent understand a repository can help a student understand a new codebase, help an educator build interactive code walkthroughs, or help a team onboard new members faster.
It is open source, built in the open, and designed to be one of a suite of tools that make working with code more intelligent — for humans and machines alike.