OpenViSTAI · Agents · Blockchain · Crypto
Menu
RAG & Knowledge Systems

Db Per Tenant

Db Per Tenant is an open-source TypeScript web application example for uploading PDFs and chatting with their contents. It provisions a dedicated Neon PostgreSQL database with pgvector for each user, storing document chunks for vector-similarity retrieval.

Independent OpenViST project profile, based on linked sources.

Db Per Tenant — OpenViST project profile in RAG & Knowledge Systems.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it as an architectural reference when a document-chat application needs to store and retrieve each tenant’s embeddings from a dedicated database rather than a shared vector store.

Who it is for

  • Developers exploring PDF chat and retrieval-augmented generation.
  • Teams designing tenant-specific vector stores for users, organizations or workspaces.

Documented uses

  • Explore a working application pattern for uploading PDFs and asking questions about their contents.
  • Study how to associate tenants with separate PostgreSQL vector databases.
  • Adapt document chunking, embedding storage and similarity retrieval to a tenant-specific knowledge service.
Before you choose

Requirements & limits

The repository is public and identified as open source. Its README links to a live demo.

  • The example provisions a separate Neon PostgreSQL database with pgvector for each user.
  • The main database tracks users, documents and their associated vector databases; tenant databases store document chunks in an embeddings table.
  • The repository identifies Remix, Remix Auth, Drizzle ORM, Vercel AI SDK, LangChain, OpenAI, Cloudflare R2, Upstash Redis and Railway in the stack.
  • The project describes separate database storage but does not specify additional isolation guarantees.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Provision a dedicated pgvector database during user signup

Set up the documented pattern for creating a user record and associating it with a dedicated Neon PostgreSQL database using pgvector.

Before you start

  • A Neon API client and a main application database configured for the app’s user and vector-database tables.
  • The documented authentication setup uses Google OAuth and environment variables for the Google client ID, client secret, and callback URL.
  • PostgreSQL, pgvector, and the app’s Drizzle migrations.

Steps

  1. During authentication, look up the user and their associated vector database in the main application database.

  2. If either record is missing, create a Neon project and obtain its connection URI.

  3. Connect to that database, enable the vector extension, and run the Drizzle migrations.

  4. Insert the user and associate the new Neon project ID with that user in the main application database.

Expected outcome

The user is associated with a dedicated Neon database prepared with pgvector and the app’s migrations.

Guide limitations

  • The example provisions a database on signup; it does not specify provisioning commands, configuration beyond the shown code, or operational recovery procedures.
  • The description identifies per-user database separation but does not specify additional isolation guarantees.
Source-based practical guide

Follow the documented PDF-to-chat data flow

Understand the application’s documented flow from PDF upload through tenant-specific retrieval during chat.

Before you start

  • The application’s documented architecture uses a main database for users, documents, and vector-database associations, plus a dedicated pgvector database for each user.

Steps

  1. Upload a PDF; the application records document information linked to the user.

  2. The application chunks the uploaded document and stores its embeddings in that user’s dedicated vector database.

  3. When the user chats with the document, run vector similarity search against that database to retrieve relevant information for the prompt.

Expected outcome

Document chunks are retrieved from the user’s associated vector database as part of the described retrieval-augmented chat flow.

Guide limitations

  • The README describes this flow but the available chat code is truncated, so it does not provide complete implementation details for chunking, embedding, retrieval, or answer generation.
  • The description does not specify additional guarantees about tenant isolation.
COMPARE OPTIONS

Compare options for Vector search

These projects document a common task and share a project role. This is a source-based comparison, not an execution benchmark or a guarantee of interchangeability.

ProjectDocumented purposePlatformAccess and requirements
Db Per TenantExplore a working application pattern for uploading PDFs and asking questions about their contents.WebThe repository is public and identified as open source. Its README links to a live demo.
Chatbot with PDF for Semantic SearchPrepare document content as embeddings and save it to a supported vector database.WebThe repository is identified as open source and publicly visible on GitHub.
AI LLM PlaygroundAsk questions about PDF documents through an assistant interface.Web
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
18 October 2026
Original website title
neondatabase/db-per-tenant · Official homepage title · retained in its source language