The Ninth Rewrite (Might Be a Delete)
Why we kept rewriting our agent service, and what we learned along the way.

The nine lives of our observability agent
This is the story of the eight times we pretty much rewrote groundcover's agent service.
groundcover's "Agent Mode" is the intelligence layer of groundcover. It's an observability agent expert in investigating observability data as well as operating the groundcover platform (stuff like creating dashboards, helping users navigate to where they need to go in the app, and more). It lives in our UI and in messaging tools, as well as running in the background, providing value in the form of suggestions, investigations and more.
Some of these rewrites fixed what were plain out mistakes. Others removed stuff we built that became redundant as newer model generations became available, or otherwise became features the big AI labs now ship themselves. This is how we learned to tell what's really "ours" in this service we're building, and the impact it had on how we decide what to build next.
Get out of the model’s way
The first four versions taught us an important lesson (twice): every time we added control, the agent got slower. Also it didn't necessarily get more correct, if anything we were overfitting for a problem in our faulty benchmark.
v1, The Contract. The initial version was a PoC that lived outside of groundcover's product: A small python loop connected to our MCP that could search tools for logs, traces and metrics, plus a bespoke high-level search tool for entities we wrote especially for it, that wasn't is use by our system (this bit becomes important later). We had it follow a strict and very much bloated JSON structure, and tuned the whole thing toward a dozen investigation scenarios we decided were our north star. The experience was broken to say the least. It could one-shot all scenarios, but results came stupid-slow, which, as we learned, in an AI product is its own kind of broken.
v2, Weekend Hack. Then I built something over a weekend, for fun. It used a small model, minimal instructions, and one thing done properly: intimate knowledge of how to query groundcover. It was blazing fast and gave good results. It also failed some of the test scenarios v1 was built around, but we decided to scrap v1 and build on it anyway, because, well, it was delightful.
v3, Never Wrong. At this point we brought the engine into the groundcover UI and began planning ahead. We put that engine on LangGraph so it could spawn sub-agents and run tasks in parallel. Then we tried to make the agent never wrong, with sophisticated tools like that entities search tool so it always got its queries right - as well as added complex prompts teaching investigation technique and tool usage. As you might have guessed, context bloated and the agent got slower and slower.
v4, Trust the Model. At this point we realized what our core mistake was (making that mistake twice was apparently enough for us to get the message through). We stripped out most of the instructions and switched to lean prompts. We decided that from now on we trust the model, and, lo and behold, the agent felt snappy again. But it still had dozens of separate problems to solve, one for every kind of data we have.
Finding what’s ours
At this point we're looking at what's still contributing to context bloat - trying to get rid of as much as possible, and we realize this: while traces and logs are queryable with gcQL (the groundcover query language - an extension of VictoriaMetrics' LogsQL), all other tasks are handeled with bespoke solutions (like that high-level entities search).
Solving this led us to the realization of what's the part of the system that’s actually ours: we made almost everything in groundcover queryable in gcQL!
Logs, traces, events, dashboards, monitors, entities, APM, DB monitoring, AI observability, cloud costs and more: all gcQL. The agent stopped needing to be good at dozens of things and became an expert at one. It had one skill to focus on, and one syntax to retrieve and correlate everything.
Here’s a simplified version of the same entity query, before and after. Before gcQL, the agent had to write a typed call for each kind of data, with the right function, field names and shape:
After gcQL, it’s one line:
Every data type used to be its own problem. Now every question is the same problem: writing the right query. By making the product queryable, we gave our agent one problem instead of dozens.
At this point we felt like we squeezed everything out of the small model, so we moved to a bigger one, and since groundcover is a fully-BYOC solution, having inference running through AWS Bedrock, Google Vertex and Azure Foundry made that switch easy as pie. We also dropped the idea that the agent must get everything right, in favor of fast iteration.
When every answer is a gcQL query and its result, in the form of a dashboard widget - every claim is a query the user can then rerun, play around with and not have to take the agent for its word:
- The question comes in plain language.
- The agent composes a runnable gcQL query.
- The data is exactly what groundcover returned.
- Every claim in the answer points back to the query behind it.
Hallucination becomes an architecture problem, with an architecture solution. Stop trying to make your agent never wrong. Make it easy to check.
Building on shifting ground
Our last three major architectual changes built a platform around the agent. This was happening as the major AI labs shipped parallel functionality in their new Agentic SDKs and API offerings.
v6, Skills. We stripped the prompts down further with a skill-based architecture, so that the model starts with almost nothing and loads skills only when it needs them - turning context into a budget we spend just in time.
v7, Headless. We disconnected streaming from the groundcover frontend so the agent could now hold many conversations in parallel - which also opened the door to Slack. "Agent Mode" stopped being a feature of one screen and became a true backend service.
v8, Always On. We put the whole agent on Temporal for durable execution and added an external connectors system. Now custom agents run in the background, suggest improvements, and hand work to cloud coding agents and messaging tools. This is the architecture that held, for now.
Meanwhile, the labs shipped our last three rewrites. Skills became part of the labs’ own agents. Agents you tag in Slack shipped as products like Claude Tag. Background agents and connectors arrived from the labs and from tools like Cursor Cloud Agents.
Build now, or wait?
Every team building agents now faces the same choice: build now and risk being eclipsed in six months, or wait and fall behind.
/








