hn.today

We moved 1.7 TB off pgvector to our own Rust search engine

circleback.ai66 points32 comments
Screenshot of We moved 1.7 TB off pgvector to our own Rust search engine

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.

Read on circleback.ai32 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Show HN: Rust Commander

Show HN: Rust Commander

Rust Commander is a Rust terminal file manager modeled on Midnight Commander, with dual-pane navigation, a persistent shell, archive and remote browsing, and background file operations. Version 0.3.1 adds file-change alerts, viewer copy controls, customizable skins, and faster SFTP previews and copying. (github.com)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.