Circleback replaced search built on a 1.7-terabyte pgvector table in its main Postgres database with Orion, a custom Rust search engine. The old system had no vector index, so every query scanned meeting transcript chunks from disk, slowing searches and competing with the rest of the application for memory. Search volume had grown to about 3.5 million queries in October - 18 times January’s total, with nearly 90% coming from AI agents. The team also found shortcomings in Postgres full-text search: stemming mismatches caused some searches to miss results, and some Japanese, Chinese, and Korean characters were lost. Generating embeddings through an external service was another major expense.
Orion accepts plain text and creates its own vectors, keeping index files in inexpensive blob storage while caching search-critical data in memory and on local disks. It divides data into shards, assigns each meeting consistently, and searches only meetings the application has authorized. Immutable files and a carefully guarded update to a manifest prevent simultaneous writes from overwriting one another; background jobs consolidate small files. After testing more than 30 changes, the team fixed memory-allocation and Node.js data-copying bottlenecks, then enabled Orion for all users. Finding relevant chunks for a large account fell from roughly 700 milliseconds to under 100; most complete searches now finish within a second, versus 20-40 seconds for the slowest old queries. Circleback expects the new system to cost about one-tenth as much.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.