A 512MB limit led to a cheaper AI search design
An AI developer tool first used a standard server-heavy design. The backend copied the , split files into smaller pieces, created , stored vectors, and answered questions. On Render’s free plan with 512MB of memory, one large pushed memory use close to 500MB and the service was shut down.
Instead of moving to a bigger server, the design moved work to the user’s browser. The browser now reads the , splits files inside a Web Worker, creates in small batches, and stores vectors locally in IndexedDB. The backend only handles retrieval and .
This makes server memory easier to predict, lowers hosting costs, keeps the backend simpler, and improves scaling. The trade-off is that indexes live on each device, so syncing them across devices becomes harder.
Key points
- A large nearly used the full 512MB server memory limit and caused the service to stop.
- reading, file splitting, , and vector storage moved into the browser.
- The backend was reduced to retrieval and .
- The new design lowers hosting costs and makes server memory more predictable.
- es make cross-device sync harder.