Create

Sign in to ReadmeX

or

How we handle your data: Privacy Policy

ReadmeX

Your AI reading companion

What would you like to catch up on?

Pick a briefing, or ask your own question.

Your community and people briefings stay personal to you.

Story

Modem moves embedding search from pgvector to turbopuffer

AI summary

Modem says its shared pgvector table made its smallest customers experience the slowest searches, while database compute costs rose. By August 2026, median searches took about 0.8 seconds and the slowest 1% took as long as 28 seconds. The company tried an HNSW index, which it says made performance materially worse, and binary quantization, which improved searches but did not prevent embeddings from competing with other data for Postgres memory. Modem later moved embedding storage and search to turbopuffer, reporting a 76% reduction in p90 search time. During the first 24 hours, it also reported that production database CPU fell 62%, cache misses fell 82%, slow queries on the embedding table fell 95%, and the Neon Postgres instance could be downsized. The company says overall storage costs fell by roughly 10% despite also paying for turbopuffer. These performance and cost figures were reported by Modem and were not independently verified.

In-depth insight

Modem’s account shows that embedding searches can consume Postgres memory, slow other workloads and increase database requirements even when queries return correct results. Moving embeddings to a separate service reduced that contention and allowed the company to reduce database resources, but also required operating two databases rather than one.

All posts

Learn how our shared pgvector table made our smallest customers the slowest, why an HNSW index made it worse, and how moving to turbopuffer made our whole database faster and cheaper.

Like many other AI products, Modem uses embeddings. When new customer messages come in, we want to know whether any customers have said something similar before, in any channel and in any wording. Embeddings are part of how we answer that.

When we started off, we wanted to manage as few moving pieces as possible. So those embeddings lived in Postgres with the pgvector extension. And for a long time it was fine.

Then our searches started getting slow in a way that made no sense. Some of our smallest customers waited up to ten seconds for results while our biggest customers (with the most data to scan) got answers immediately. And the whole time our database compute costs soared.

In this post, I'll explain what was slowing us down, why the standard fix didn't work for a product like ours, and how we eventually capitulated and switched to turbopuffer, which cut our p90 search time by 76% and took most of the load off our database.

#Modem#turbopuffer#pgvector#Postgres#Neon#HNSW

Original · 14 min readRead the original
Group chat

No comments yet. Start the conversation.