Noureddine RAMDI / Supavec: open-source RAG-as-a-Service with cost-efficient batch embeddings and hybrid filtering

Created Mon, 06 Jul 2026 15:15:52 +0000 Modified Mon, 06 Jul 2026 15:16:10 +0000

taishikato/supavec

Supavec tackles a core challenge in retrieval-augmented generation (RAG) workflows: how to keep embedding costs manageable and query latency low while maintaining good recall. It offers a self-hostable platform exposing REST APIs for vector search and chat, built with a modern TypeScript stack. The project claims concrete savings of 65% on OpenAI embedding costs by batching requests, a 12-point recall gain through configurable chunk size and overlap, and a P95 latency of 210ms using a hybrid filtering strategy.

What supavec does and how it is built

Supavec is an open-source RAG-as-a-Service platform primarily written in TypeScript. It uses Next.js for the frontend, Supabase for backend and database services, Tailwind CSS for styling, Bun as the JavaScript runtime, and Upstash for caching or storage. The architecture is multi-tenant, employing Supabase’s Row-Level Security (RLS) to isolate data per team securely within the same database schema.

The platform exposes REST API endpoints for vector search and chat functionalities. It supports both streaming and standard response modes, allowing flexibility depending on client needs. The multi-tenant design combined with usage-based billing tiers (Free 100, Basic 750, Enterprise 5000 requests per month) makes it suitable for SaaS providers or internal enterprise deployments that require data isolation and cost control.

Under the hood, Supavec focuses on optimizing embedding generation and vector search:

  • Batch processing of embeddings reduces the number of calls to OpenAI’s embedding API, directly cutting costs by 65%.
  • The system supports configurable chunk size and overlap parameters for document segmentation, which improves recall by 12 points by better capturing document context.
  • Vector search performance is enhanced through hybrid filtering, combining filtering by file_id with cosine similarity search. This approach achieves a P95 latency of 210ms, balancing accuracy and speed.

Technical strengths and tradeoffs

Supavec’s standout technical feature is its batch embedding optimization. By grouping multiple documents per API call, it cuts the operational expense of OpenAI embeddings significantly. This is a practical optimization that directly benefits anyone running large-scale RAG pipelines with cost constraints.

Configurable chunk size and overlap offer a clear tradeoff between index granularity and recall quality. Larger chunks reduce index size and speed up queries but risk missing fine-grained context, while overlapping chunks improve recall at some added computational cost. The 12-point recall improvement cited indicates the effectiveness of tuning these parameters in practice.

The hybrid filtering technique is a pragmatic solution to reduce vector search latency. Instead of relying purely on cosine similarity across all vectors, the system first filters by file_id, narrowing down the candidate set, then applies cosine similarity. This two-step filtering helps keep response times low (P95 latency of 210ms) while maintaining search accuracy.

The use of Supabase’s Row-Level Security for multi-tenancy is a solid architectural choice, ensuring team data isolation without separate databases or schemas. This reduces operational complexity but requires careful security rules configuration.

The choice of Bun as a runtime is interesting, potentially improving startup and execution speed compared to Node.js, though it may introduce some ecosystem compatibility tradeoffs.

The code quality appears well-structured, leveraging the TypeScript ecosystem and Next.js conventions. However, the analysis doesn’t detail internal patterns or tests, so one should evaluate those aspects directly in the repo.

Quick start

To get started with Supavec in development, follow these commands exactly as provided:

bun i
bun dev
cd apps/web && bun run dev
cd packages/api && bun run dev
bun i

This installs dependencies and runs the development servers for both the web frontend and API backend using Bun.

Verdict

Supavec is a solid choice if you want a self-hostable RAG platform that manages embedding costs efficiently and offers a configurable, multi-tenant vector search API. Its batch embedding optimization and hybrid filtering strategy are practical features that address common cost and latency challenges in RAG workflows.

However, the project’s reliance on specific tech like Bun and Supabase might require some adaptation depending on your stack preferences. Also, while the platform supports multiple billing tiers, the operational overhead of running and securing a multi-tenant environment is non-trivial.

For developers building SaaS products or internal tools that need scalable vector search with cost-sensitive embedding workflows, Supavec offers a codebase and architecture worth exploring. It’s less suited if you need out-of-the-box analytics integrations or advanced UI features, as those claims aren’t substantiated in the provided analysis.

Overall, Supavec balances developer experience, cost efficiency, and performance in a modern TypeScript codebase with clear architectural decisions.


→ GitHub Repo: taishikato/supavec ⭐ 1,083 · TypeScript