How we made search faster, more accurate, and a tenth the cost by moving 1.7 TB of vectors into Orion, our Rust search engine backed by blob storage.
Search is at the core of Circleback. Teams use us to record and transcribe their meetings, turning conversations into a shared context layer for both people and AI agents. That context is only useful if search is fast and accurate across every meeting you have access to.
We recently rewrote our search infrastructure from the ground up. On our largest accounts, a search could take up to 40 seconds, and some searches missed meetings they should have found. Now search is instant, finds more of what you're looking for, and costs a fraction of what it did.
Search before and after the move to Orion.
Search in Postgres #
Search lived inside our main database, using pgvector. When processing a meeting, we would extract chunks of text from the transcript, generate embeddings, and store those vectors in a massive table. We had 1.7 TB of those and no vector index, so every search scanned the chunks of every meeting you could read. Those scans read from disk and pushed the rest of the app's data out of memory, so the entire app slowed down whenever someone searched. That got worse as search grew: Ask Circleback searches your meetings to answer questions, and agents now search them through our MCP server, API, and CLI. In October we served about 3.5 million searches, 18 times more than in January, and almost 9 in 10 came from agents.
Another issue was our text search strategy, using Postgres' full-text search. When we saved transcripts, we cut words down to their root, so "pricing" became "price". We didn't do the same to searches, so a search for "pricing" never found "price". We also lost characters in Japanese, Chinese, and Korean text. And the embedding service cost us more than any other part of search.
Many companies have a similar architecture, which isn't really an issue until you have to scale it. I joined Circleback about a year and a half ago, and we had to upscale our database at least three times while seeing a steady growth curve, largely because of our inefficient search.
Orion #
Why not Turbopuffer or Elasticsearch
A long time ago, back in 2019, I was quite interested in building my own search engine. Orion was used in a few of my projects and had a pretty solid core, but it lacked many of the improvements that other systems, such as Turbopuffer, were bringing. So Claude Opus and I decided to rewrite it entirely, using Rust. It took a weekend to get something working end to end.
Turbopuffer was the obvious alternative, and Orion uses a similar design, so it came down to two things. Turbopuffer stores vectors but doesn't make them, so we'd have kept the embedding service, the part we most wanted to turn off. Orion takes plain text and makes the vectors itself. And Orion runs in our own cloud account, so meeting data never leaves it and we control how it's stored and who can reach it.
Elasticsearch could have done the search, but it keeps its index on disks of machines that run all the time. Most old meetings rarely get searched, and we would rather not pay to keep them all warm.
Cheap storage, fast reads
The main innovation was to keep the index in blob storage, like Google Cloud Storage or S3. Storage there is cheap, but reading from it is slow, so Orion keeps the parts searches need in memory and on a local disk. Files in blob storage can't be changed once they're written. So to save new text, Orion writes a new file, then updates a small file that lists which files are current. It only updates that file if nobody else changed it first, so two writes can't erase each other. After that, the new text shows up in searches. Later, a background job packs the small files into bigger ones that are faster to search.
How Orion saves new text without two writes erasing each other.
Every meeting in its own place
This architecture is quite similar to Turbopuffer. The main difference is that Orion goes further on sharding and isolation. Each meeting has its own section of the index. And Orion splits the index into shards and always puts a meeting in the same one, so a search over a couple of meetings only opens the shards that hold them.
With every search, we tell Orion which meetings it's allowed to read, and it only looks in those. Orion knows nothing about our permissions or access; everything is computed by the application when queried.
A search only opens the shards that hold the meetings you can read.
Faster, and cheaper to run
Because Orion is more specialized and tailored to our use case, our benchmarks show big gains compared to off-the-shelf alternatives. It also turned out to be much more cost-efficient for us, as we have more control over the machines and what runs on them. The same machines that run Orion also run some microservices for Circleback, thus sharing the cost.
Rolling it out #
Fixing leaks
Our first benchmarks were slower than we hoped, but most of that came from bugs and leaks that made Orion look worse than it was. The one I found most interesting: the default Rust allocator held on to freed memory more than we needed, so we switched to jemalloc, which turned out to be significantly more efficient.
Learnings and mistakes
We ran Orion search in a preview deployment next to production, changed one thing at a time and wrote down what each change did. We tried more than 30 changes. Most didn't help. More memory and compressed requests made no difference, and a quantized embedding model was faster but changed the results, so we dropped it.
The worst slowdown turned out to be in our code. Prisma copies binary columns numerous times on their way into Node, which caused long garbage collection s with big transcripts.
Rollout
By the end, the preview looked good, and finding the closest chunks for a large account took under 100 ms, down from about 700 ms on the old unindexed scan. So we turned it on for everyone.
A few days later, most searches finished in under a second end to end, and searches that found nothing had become rare. Before the switch, the slowest meeting searches took 20 to 40 seconds. Now Orion itself answers in tens of milliseconds. We've since deleted the old table and turned off the old service, and we expect search to cost about a tenth of what it did.
If you'd like to work on problems like this, we're hiring.