The AI Gazette

Agent memoryCoding agents

Grab grades its coding agents' knowledge base against changes engineers already shipped

In a post dated 23 November, Grab engineers describe a replay test for the knowledge base their coding agents load before touching a backend service. Fifty recent merge requests were rewound to their pre-merge commits and planned twice by five agent stacks from three model providers. With the knowledge base, every stack beat the strongest stack working without it.

Illustration of two cartoon robots planning at laptops, one with an open book beside it, next to a branching line of commits and a clipboard with a check mark.
Image: Grab (opens in a new tab)

A coding agent starts every session with no memory of how a service got the way it is. It can see what the code does, but not why a limit lives in configuration, which nightly job breaks if a shared client changes, or what an old review thread settled, so it asks or guesses. Grab built a knowledge base to fill that gap. For each backend service it maps how requests move through the code, what a change could break, which configuration values the code runs with and why the team made its calls. Agents load it through a skill, engineers read the same files, and any factual claim an agent makes from them has to cite a file and line.

The knowledge base is built in two passes. The first is plain code analysis with no language model involved: it parses the service into syntax trees and extracts entry points, imports, configuration keys and the actual call graph. Only then do model sub-agents write summaries and flow documents on top of that structure, and a verifier checks each batch before the build accepts it. Everything lives in Git, so each change is a reviewed diff. When merge requests land, an update job rebuilds only the files they touched and opens a knowledge merge request for the service owners to approve, and every build records the commit it indexed.

Grab wanted a number rather than opinions. More context feels like progress, the post says, but each file takes some of the agent's attention, can contradict something else and starts going stale the day it lands. Ten opinions will not say which of ten additions helped, and public benchmarks test models on public code they may have seen in training. Because the knowledge base rewrites itself whenever a merge request lands, it also needs a check before each update goes live, and a check needs a score.

The test treats every merged change as an exam with an answer key. It selects recent merge requests made after the knowledge base snapshot, rewrites each request to state only the need and the outcome, and strips file paths, links, code and anything describing the solution. It then creates an isolated worktree at the commit before the merge and runs two identical agents with the same time budget, one of them with a single extra prompt line that turns on the knowledge base skill. A model grader scores both plans against the merged diff on a fixed rubric. The agents write plans, not code, because a plan shows whether the agent worked out what the change needs, and code has many right answers.

Several choices keep the test honest. The grader always has the merged diff in front of it, every point must trace back to that diff, and confidence alone earns nothing. Only changes merged after the snapshot are replayed, agents are told not to look up the merge request or later history, and each grader sees one plan, never the other variant. The selector skips reverts, dependency bumps, test-only changes, file moves and single-file changes under about 15 lines. Plans can earn up to 8 points across five dimensions, and a plan that hands a core decision back to a human, the failure seen most often, scores at most 1 on each of the first two.

Grab replayed 50 recent merge requests from a large, actively developed backend service across five agent stacks from three model providers. With the knowledge base, every stack beat the strongest stack without it, including budget-tier and previous-generation models, while stronger baselines gained less. On the stack run most often, plans improved on more than half the merge requests and tied on almost all the rest. Plans with full marks nearly tripled, and the weakest quarter went from about half marks to about three quarters. The largest gains were in finding the right code, understanding the intent and being honest about uncertainty, each up by more than a fifth of its range.

Most of the gain came from knowledge built straight from the code. Adding layers one at a time on one stack, flow documents, impact maps and live configuration values delivered most of the lift, and decisions, glossary and conventions added the rest. Flow documents and impact maps say nothing the code does not, but they save the searching and guessing an agent would otherwise repeat on every task. The team also found that agents did better searching a link graph built from the code than one whose links a model had guessed, and that chunked similarity search struggled with the order of events and with which information was current.

The replay now guards the knowledge base itself. When it changes in a big way, such as a new source, a new format or automatically learned context, the same merge requests are replayed against the current and updated versions. If the score holds the update ships; if it drops, the update waits and its owner gets the list of changes that got worse. The post notes limits: the results cover plans only, and a good plan can still be implemented badly. Grab plans to apply the same idea to other finished work with a recorded outcome, such as resolved incidents and answered metrics questions.

Let LLMs describe structure, not discover it.
From Grab's engineersGrab's advice on building an agent knowledge base from a call graph taken from the code, rather than one a model guesses.

From other editions

Say hi.