"AI doesn't work on our codebase."
I hear this weekly. Same problem: they skipped context acquisition.
They pointed an agent at a repo, handed it a ticket, and got code that compiles but misunderstands the architecture.
One team built the context layer first. Two engineers rebuilt a FedEx supplier's delivery platform in 3.5 months when the original estimate was eight.
Week one, they wrote zero code. They scanned the entire repo into a knowledge graph covering modules, dependencies, data flows, and domain terms. Agents read that map before touching anything.
Every ticket ran this loop: 1. Define scope and constraints 2. Write a technical spec 3. Plan the implementation 4. Agent implements, engineer reviews 5. Test against the spec 6. Update the knowledge graph
Nothing merged unless the engineer could verify it, explain it, and debug it without the agent.
The team merged 122 PRs in 90 days with AI generating 90% of the code at $200/month in compute.
Map your repo into a knowledge graph and run this loop before you hand the agent open-ended tasks.
I recommend you to follow @mardehaym.
He runs @LimestoneHQ and posts production AI breakdowns like this.