20 AI Agents Team Up, Run 350 Experiments in 4 Days, and Beat ClickBench's Best Public Score
Total query time on Quickwit dropped 31%, with a maximum reduction of 87%.
But what if you let 20 AI Agents form an engineering team and did not tell them which specific line of code to change - letting them find the performance bottlenecks themselves, propose technical approaches, design experiments, and even review each other's code?
Recently, AI startup TabbyML published a rather intriguing piece of work: it threw a systems engineering team made up of 20 AI Agents at Quickwit, a real open-source search engine.
More importantly, in the data lake category of the database performance benchmark ClickBench, the AI-optimized Quickwit beat every previously published score on same-basis hot-query scoring.
This time, AI did more than write code - it began taking on the work of a professional systems engineering team.
The optimization target chosen this time was Quickwit, the open-source search engine TabbyML uses in its real business.
Quickwit is a search engine for large-scale log and observability data, built on Tantivy, a full-text search library written in Rust, and it can process massive data directly on cloud object storage.
TabbyML uses it to store and retrieve the execution traces of its AI Agents.
Unlike ordinary software development tasks, system performance optimization is genuinely complex engineering work.
An engineer must not only understand a huge codebase but also dig into low-level mechanisms such as CPU, memory, data structures, and storage access.
And an optimization that looks effective can cause performance regressions in another scenario, or even introduce bugs that are extremely hard to spot. To measure what the AI team achieved, the TabbyML team chose ClickBench, a well-known performance benchmark in the database world.
On a test set containing 100 million rows, the AI team optimized the 40 queries supported by Quickwit. In the end, Quickwit's hot-query geomean score fell from 403 ms to 304 ms.
Recomputed over the same set of 40 queries, the optimized Quickwit posted a hot-query geomean of 304 ms, 16% faster than Duckflight's published 354 ms.
The TabbyML team also reproduced the unoptimized scores of ClickHouse and Quickwit (the fourth and fifth rows in the chart): Quickwit's hot-query geomean was 304 ms, and ClickHouse's was 392 ms.
Notably, the AI did not redesign the whole search engine; it dug into the underlying implementation of the existing system and hunted down removable performance bottlenecks one by one.
The 20 AI Agents worked across cache configuration, data structures, decompressor reuse, memory allocation mechanisms, and more.
After roughly 350 explorations and experiments, they converged on 6 effective performance optimizations.
What happens if you simply let 20 AI Agents modify one codebase at the same time?
They might duplicate each other's work or overwrite each other's changes, or mistake random test fluctuations for performance gains.
Worse, chasing higher benchmark scores, the AI might gradually drift toward gaming the system.
TabbyML's solution was to make the AI collaborate with a division of labor, like a real engineering team.
The Agents read code, analyze profiling data, look for potential bottlenecks, and propose optimization hypotheses.
Multiple Agents can explore different directions at once, from data decoding to memory management, from aggregation operations to storage access.
Can this approach truly solve a general engineering problem? Could it just be gaming the benchmark? How do you prove the optimizations work? Which existing behaviors must stay unchanged?
In TabbyML's system, every experiment requires an explicit 'experiment contract' before it officially starts.
The contract fixes not only performance targets but also constraints on correctness, compatibility, memory use, and more.
The Agents implement their optimizations in isolated experimental environments, running unit tests, microbenchmarks, and full performance tests.
If code reading reveals problems with the original plan, they can even challenge the tech lead's judgment and demand a new experiment plan.
Every round's result, success or failure, flows back to the tech lead and becomes input for the next exploration.
Successful optimizations enter the next code baseline; failed attempts become shared knowledge for the entire team.
This way, the AI team forms a closed engineering loop of proposing hypotheses, validating them, correcting errors, and continuously improving.
Humans no longer need to break a complex engineering goal down, step by step, into concrete programming tasks.
The AI found that executing one query forced Quickwit to process about 100 million intermediate records, while the user only needed the 10 most frequently accessed IP addresses.
So the AI proposed a seemingly very reasonable plan: filter out the final 10 results first, then run the subsequent data transformations.
The test results were gorgeous too: the microbenchmark ran 3.02x faster and the target query's time dropped 11%. More importantly, result verification passed on all 40 ClickBench queries. Judged by benchmark scores alone, this optimization looked ready to merge.
Yet the reviewing Lead Agent halted it. The reason: the AI had quietly changed how IP addresses are compared.
Under string comparison the former sorts first; under numeric comparison the latter does.
This subtle difference caused no errors in the current benchmark data.
But if the real business ever contained IP addresses with identical access counts, the optimization could change the returned query results.
In other words: all tests passed, performance improved, and the code could still harbor a correctness problem.
In the end, the Lead Agent vetoed the optimization and recorded the finding so that later Agents would not repeat the same mistake.
In this multi-Agent team, posting good numbers and deciding whether code can merge are two different jobs.
The Verification Agent hands over evidence of speedup; the Lead Agent still has to ask: are the tests all green only because the failure-prone spots were never tested? E251's change stopped at exactly this gate.
The value of the multi-Agent division of labor is not only trying more approaches in parallel, but having someone whose job is to check whether faster code still produces the same answers.
At first glance, that hardly seems like a high ratio. But in real system performance engineering, large numbers of failed explorations are precisely the norm.
The AI found the system was making many unnecessary memory allocations while processing large numbers of small data packets, and proposed a new data structure.
The target query's time dropped 28%, but another query regressed by 9%.
This time the AI did not simply accept the change; in follow-up experiment E119 it narrowed the optimization's scope, using the new data structure only where it genuinely helped. The team ultimately kept the gains and eliminated the regression.
Similar episodes kept recurring. In the subsequent experiment E237, the verification Agent even found an error in an optimization the tech lead had approved.
The temporary memory buffer first believed to be the bottleneck was in fact flushed every 2,048 documents and never grew large enough to cause the expected problem.
The real performance cost came from a different, continuously growing array. Rather than mechanically executing its task, the verification Agent fed the finding back to the Lead Agent and pushed the team to revise the plan.
The corrected optimization ultimately cut the target query's time from 5.891 seconds to 3.131 seconds, a 47% reduction.
The AI proposes hypotheses, the AI validates hypotheses, the AI questions other AIs' conclusions, and the AI runs the next round of experiments. The many failures are not thrown away; they become the foundation of later optimizations.
In the end, the 6 approved optimizations kept stacking up, steadily cutting the system's total hot-query time from 40.5 seconds to 27.9 seconds.
This also reveals another difference between this system and ordinary Coding Agents.
Its work is not one-shot code generation; it is autonomous engineering exploration that can run for days or longer.
What matters is not whether any single experiment succeeds, but the whole system's capacity to keep accumulating optimization gains.
After ClickBench, the TabbyML team kept talking with the Quickwit maintainers, turning their attention from query speed to indexing efficiency on SearchBench.
During the exchanges before experiments started, the Quickwit maintainers mentioned that past a certain point, adding more CPU brought little speedup.
One known bottleneck is the WAL (write-ahead log) write lock: more CPUs still cannot let multiple writes take the same lock at once. Knowing where it jams and having the time to verify optimizations along that write path are two different things.
TabbyML gave the AI Agents an optimization goal and a reproducible validation environment, but did not reveal that the WAL write lock was a known bottleneck, nor specify which code to change.
The Investigator Agent ran its own profiling, traced time along the write path, and independently located the very same WAL write lock. The Agents then tried compressing larger WAL records before writing them, reducing the volume of data written while the lock is held.
In interim internal tests, the write phase of index construction for 100 million log entries took nearly 60% less time. The team is still digging for further gains.
The most striking part of this work: a team of AI Agents can reach Senior Engineer level and take over much of the day-to-day work of human systems engineers.
Given a goal and a reproducible validation environment, the AI Agents can go from problem location to validated optimization on their own, pushing forward the work that normally requires carving out dedicated engineering time.
But in systems engineering, what is truly expensive is often not writing the code itself; it is finding performance bottlenecks, exploring alternative technical approaches, and running experiments and validation over and over.
Interestingly, system performance optimization happens to be a domain naturally suited to autonomous AI Agents.
Clear optimization goals, quantifiable performance metrics, reproducible experimental environments, and strict correctness constraints build the AI a feedback loop in which it can explore continuously, self-correct, and keep accumulating results.
Every experiment earns feedback from real performance data. Every failure becomes the starting point of the next exploration. Every effective optimization becomes the foundation for pushing the whole system further.
Human engineers can hardly devote days or weeks to exploring hundreds of potential optimizations inside one low-level component, but AI Agents can.
They can explore different technical paths in parallel around the clock, finally executing the optimizations that used to be shelved because of labor and time costs.
Database query latency, search engine indexing efficiency, resource scheduling in distributed systems, data pipeline throughput, compute efficiency of AI inference frameworks...
In software infrastructure running at scale, even a relatively small performance gain can bring substantial compute savings and lower infrastructure costs.
TabbyML has now built a mature multi-agent system around autonomous systems engineering and is scaling it across all kinds of real infrastructure software.
These AI Agents run continuously, autonomously finding performance bottlenecks, running optimization experiments, and delivering verified code improvements, helping enterprises raise software performance and cut infrastructure costs.
That means system performance optimization could shift from an engineering effort that depends on scarce experts and runs intermittently into an infrastructure capability that runs continuously and at scale.
In the past, enterprises had to dedicate engineering resources to performance optimization. In the future, continuous optimization itself can become a routine capability of software infrastructure.
Going forward, an enterprise's software infrastructure will not only run around the clock but also be optimized around the clock.
From helping engineers write code to letting AI autonomously drive the continuous evolution of software systems, TabbyML is exploring the next form of AI Engineering.
Reference: https://www.tabbyml.com/blog/beating-clickbench-sota-with-a-team-of-agentic-systems-engineers/