Knowledge & search

Codebase Knowledge Graph: What It Connects

17 November 2026 · 7 min read · by Ayoush Chourasia

Say a client asks you on a call why the checkout behaves the way it does, and you know the answer is somewhere across your code, an old pull request and a decision you half remember. A codebase knowledge graph is your way of joining those pieces so you can follow the trail. Instead of searching four places separately, you move from a function to the commit that changed it, to the ticket that asked for the change, to the document that explains the rule behind it.

If you are new to the idea of graphs in general, start with this plain explainer of what a knowledge graph is. This post shows what goes into one built from a codebase, how the links work, and which questions it answers best.

The four kinds of material you connect

A useful graph has four types of nodes. You already have all of them. The work is in linking them so you can walk from one to the other when a question comes up.

Code: files, functions and config

Your code is the centre of the graph. For most teams, file or module level plus a few key functions is enough to start.

Give each code node a stable name you would recognise on a call. A path like billing/prorate.py plus a one-line note such as "works out mid-cycle plan changes" is more useful than a bare path. If a config flag controls behaviour the client sees, make that flag a node too.

Commits: when and what changed

Commits are your timeline. Each commit node records what changed, when, and who made the change, with a link back to the diff. A message that says "fix rounding on part-month invoices, see PROJ-412" connects the code to the reason in one line.

If your team already writes messages that name the ticket, you have half the graph built without extra work.

Tickets: why the work happened

Tickets, issues and pull requests hold the "why": the request, the discussion and the outcome. Link them to the commits that closed them and to the code they touched.

You do not need every comment in the graph. Keep the title, the decision, and links to related tickets. Say a ticket records that the team picked per-day proration after the client confirmed invoices should stay simple. That sentence is what you want six months later.

Docs: rules, specs and minutes

Docs hold the context that never fits in a ticket: specs, API guides, runbooks and past meeting minutes. Each doc, or each section of a long doc, becomes a node linked to the modules and tickets it describes.

When a call settles an open question, linking that minute to the ticket and the module means you can answer "what did we agree about refunds" with the source in front of you.

How the links work

Nodes without links are just four separate lists. The links are what turn them into a codebase knowledge graph you can walk across.

The core links are simple and you can keep them in a table or in your commit habits:

You do not need a graph database to hold this. A table with three columns — from, link type, to — is a graph. Say you start at billing/prorate.py. You step to the commit that last changed the rounding, then to ticket PROJ-412, then to the spec section on invoicing rules. Three steps take you from "where is this" to "why is it like this".

Keep the link types small. Five or six types you use every time beat twenty types you forget. Each link should carry the source you would show a client, such as the pull request URL. That habit also helps if you read about how AI answers cite sources.

Questions a codebase knowledge graph answers well

Graphs shine on questions that cross boundaries. A code search tool finds text in files. A ticket search finds words in tickets. Neither follows the chain from one to the other.

When did this change? Start from the code node, list its commits in date order, and read the linked release notes. You can tell the client the date and the version without guessing.

Why does it behave this way? Step from the code to the ticket and the linked doc or minute. You get the rule and the discussion, not just the current lines.

What else touches this? Follow the depends-on links out from a module before you promise a change. You can see what shares the same helper, so you avoid breaking something you forgot.

Who decided this? The ticket and the linked minute name the people in the discussion and the reason they picked one option.

Each answer is a short path through nodes, and each step has a source you can quote. That is what makes the graph useful on calls.

A starter schema you can copy

Use this as your first version. Copy it into a doc, adjust the names to your project, and fill in five or ten rows to test it. If those rows answer a real recent question, the schema is good enough.

Nodes — one list per type:
- code: path, kind (module/file/function/flag), one-line purpose
- commit: hash, date, author, message, diff link
- ticket: id, title, status, decision/outcome, ticket link
- doc: title, section, date, doc link

Links — from | link type | to | source to cite:
- billing/prorate.py | changed by | commit a1b2c3 | diff link
- commit a1b2c3 | closes | PROJ-412 | pull request link
- PROJ-412 | described by | Invoicing spec v3, rounding section | doc link
- Invoicing spec v3 | describes | billing/prorate.py | doc link
- billing/prorate.py | depends on | billing/tax_rates.py | code link

Weekly check (10 minutes):
1. Did each merged pull request name its ticket?
2. Did each ticket with a decision link its doc or minute?
3. Did each new module get a one-line purpose?

Keep this table where your team already works, such as next to your runbook. The point is not perfect coverage. The point is that the next "why" question has a path to follow.

Building one without overdoing it

Start from questions, not from tooling. Pick three questions your team was asked in the last month that took too long to answer. Write the ideal path for each. Those paths tell you which nodes and links to add first.

Then make the links a side effect of work you already do:

  1. Put the ticket ID in every commit message and pull request title. This one habit builds the code-to-ticket bridge for free.
  2. Close tickets with a decision line. One sentence on what was chosen and why is enough. Future you will thank present you.
  3. Name the module in specs and minutes. A line like "applies to billing/prorate.py" is a link a person or a script can follow later.
  4. Review the graph when you review code. If a pull request touches shared helpers, check the depends-on links before you approve.

For history search, the official git log documentation covers the flags you need. Pair those habits with this guide to search your codebase quickly for cases where direct search beats walking the graph.

One tool that follows this pattern during calls is HintGoblin, which builds a knowledge graph per meeting from the code folders and documents you add.

Limits to keep in mind

A graph answers from what you put in, so gaps show up as dead ends. If tickets lack decisions or docs never name modules, the path stops halfway. Treat dead ends as prompts to write the missing sentence, not as failures of the idea.

Graphs also go stale. Code moves faster than docs, and links rot when files are renamed. A short weekly check keeps the damage small. Rename the node when you rename the file.

Finally, a graph does not judge. It shows that a decision was made, but it does not tell you whether the decision was right. You still need to read the linked discussion before you tell a client the behaviour is correct.

Where HintGoblin fits

If you want this kind of graph ready when a call starts, HintGoblin builds one per meeting from the code and documents you add, then shows short cited answers while the client is still asking. See the pricing for the current plans.

Frequently asked questions

What is a codebase knowledge graph?

It is a map of your software project where code files, commits, tickets and documents are nodes, and the links between them show how they relate.

What questions can a codebase knowledge graph answer?

It answers when and why questions well, such as when a behaviour changed, why a decision was made, and which ticket or document explains a piece of code.

Do you need special tooling to build one?

No. You can start with naming conventions, ticket links in commit messages, and a simple list of which docs describe which modules.

How is it different from full-text search?

Full-text search finds matching words. A graph follows relationships, so you can move from a line of code to the commit, ticket and doc behind it.

HintGoblin

Never say “let me get back to you” again.

Knowledge graphs for every meeting, cited answers during the call, minutes and action points after. Mac app + web dashboard.

See plans →