Use it from an agent
By the end of this page an agent will be able to answer questions about your codebase, and you will know where that stops.
Prerequisites
- An application with at least one completed ingest (Run an ingest).
- An AI Agent to attach the tools to (Create an AI Agent).
- Admin or Developer role.
The seven tools
Everything on the screens in this section is also available to an agent. Attach these from the tool picker — they need no configuration and no executor.
| Tool | What it answers |
|---|---|
context_graph_apps | Which codebases are indexed, and at which commit. Start here. |
context_graph_overview | A budgeted map of one codebase |
context_graph_search | Where something is handled, by meaning, with a repo/path:start-end citation |
context_graph_slice | What surrounds a node — callers, callees, reads, writes |
context_graph_impact | What breaks if this changes |
context_graph_read_file | The real source of a file at the analysed commit |
context_graph_changes | What changed between two indexed versions |
Full parameter reference: Context Graph tools.
Start with context_graph_apps
Every other tool takes an application_id, and can omit it only when the project has exactly one indexed codebase. More than one and the agent has to know which — so the first call establishes what exists and at what commit.
It is also how an agent qualifies an answer honestly: “as of commit abc123” rather than implying it read your code a moment ago.
The one thing to tell the agent
The graph is pinned to an indexed commit. It does not see uncommitted work, and it does not see anything merged since the last ingest. An agent that assumes otherwise will confidently describe code that has already been replaced.
Say so in the agent’s instructions. Something like:
The Context Graph reflects the last ingest, not the current branch. Call
context_graph_appsfirst and state which commit your answer is based on. If the user is asking about work in progress, say that you cannot see it.
When to use the code tools instead
The two families are complementary, and the split is clean:
| You want to… | Use |
|---|---|
| Find where something is handled, understand it, judge a change’s blast radius | Context Graph |
| Change a file, run a build, commit, open a pull request | Code tools |
The Context Graph needs no clone and no executor. The code tools need both, but they see the live working copy — including edits the agent has made, which the graph cannot.
Common issues
- The agent says nothing is indexed —
context_graph_appsreturned empty. Run an ingest. - The agent asks which application — The project has more than one. Name it in the agent’s instructions, or let the agent call
context_graph_appsfirst. - The agent describes code that no longer exists — The graph is pinned to the last ingest. Re-ingest, and add the instruction above.
- The agent tries to edit a file and fails — Context Graph tools are read-only. It needs the code tools for that.