AI apps

Tech stack for an AI document chat app (2026)

Chat with your documents, designed by StackPrism from one sentence: 10 components, a reason for each, and the live checks that watch them.

The stack

  • Next.js
  • Node.js
  • Inngest
  • Supabase
  • Upstash
  • Clerk
  • OpenAI
  • Pinecone
  • Sentry
AIRAGTeamsUpdated
The idea someone typed
“An AI assistant where teams upload PDFs and docs and chat with them. Answers cite the passages they came from, and each team has its own shared document library.”

Make it yours. Open this stack in the editor to check its health, harden it and hand it to your coding agent. No sign-up, nothing to generate.

Start from this stack
goes down

Select a component to see what it does and what it connects to, or pick one above to see what breaks if it goes down. Pinch or use the buttons to zoom.

Why this stack

Teams sign in with Clerk, which also keeps each team’s library separate, and upload files through a Next.js app on Vercel straight into Supabase Storage. An Inngest workflow does the slow part in the background: it chunks each document, embeds it with OpenAI and indexes it in Pinecone. When someone asks a question, the Node.js API finds the closest passages in Pinecone and has OpenAI answer from them, so every answer can point back to its source. Supabase Postgres keeps teams and chat history, Upstash Redis caches recent context, and Sentry reports errors.

Why each piece

All 10 components on the diagram: what each one does, what it talks to, and what stops if it goes down.

  1. Next.js Web App

    Runs on Vercel

    Chat and upload UI. Calls Clerk (signs in), Supabase Storage (uploads) and Node.js API. Called by Sentry (captures).

    Nothing else on the diagram depends on it.

  2. Node.js API

    Runs on Vercel, in Core Services

    Chat and ingestion API. Calls Supabase Postgres (queries), Upstash Redis (reads), OpenAI and Pinecone (retrieves). Called by Next.js Web App and Sentry (captures).

    If it goes down, 1 of 9 components stops working.

  3. Inngest Workflows

    Runs on Vercel, in Core Services

    Async ingestion pipeline. Calls Supabase Storage (reads), Supabase Postgres (writes) and Pinecone (indexes).

    Nothing else on the diagram depends on it.

  4. Supabase Storage

    In Data & Storage

    Original documents. Called by Next.js Web App (uploads) and Inngest Workflows (reads).

    If it goes down, 2 of 9 components degrade.

  5. Supabase Postgres

    In Data & Storage

    Teams and chats. Called by Node.js API (queries) and Inngest Workflows (writes).

    If it goes down, 3 of 9 components stop working.

  6. Upstash Redis

    In Data & Storage

    Chat context cache. Called by Node.js API (reads).

    If it goes down, 1 of 9 components degrades.

  7. Clerk

    In External Services

    Auth and org access. Called by Next.js Web App (signs in).

    If it goes down, 1 of 9 components stops working.

  8. OpenAI

    In External Services

    LLM generation. Called by Node.js API.

    If it goes down, 1 of 9 components degrades.

  9. Pinecone

    In External Services

    Vector database. Called by Node.js API (retrieves) and Inngest Workflows (indexes).

    If it goes down, 3 of 9 components stop working.

  10. Sentry

    Error tracking. Calls Node.js API (captures) and Next.js Web App (captures).

    If it goes down, 2 of 9 components degrade.

When this stack fits

  • Answers have to cite the passages they came from.
  • Each team has its own library, and Clerk organizations map onto those teams.
  • Documents arrive as uploads, so indexing can happen in the background before anyone asks.

When to pick something else

  • You’d rather not run a separate vector database: the pgvector extension in Supabase Postgres can hold the embeddings next to the rest of your data.
  • The documents can’t leave your network: OpenAI and Pinecone are hosted services, so plan for self-hosted models and storage.
  • The answers must reflect data that changes every minute: query the live source instead of an index of uploaded files.

What you need to build this

10 components across 8 areas of the stack.

Build it with your AI agent

Hand the stack to Claude Code, Codex, Cursor or any coding agent as a brief: how it connects, install steps and a build plan.

Frontend1

  • Next.js Web App

    Chat and upload UI

    npm install next

    Docs

Backend & APIs2

  • Node.js API

    Chat and ingestion API

    Docs
  • Inngest Workflows

    Async ingestion pipeline

Data2

  • Pinecone

    Vector database

    Docs
  • Supabase Postgres

    Teams and chats

    npm install @supabase/supabase-js

    Docs

Cache & queues1

  • Upstash Redis

    Chat context cache

    Docs

Auth1

  • Clerk

    Auth and org access

    npm install @clerk/nextjs

    Docs

AI1

  • OpenAI

    LLM generation

    npm install openai

    Docs

Storage & CDN1

  • Supabase Storage

    Original documents

    npm install @supabase/supabase-js

    Docs

Observability1

  • Sentry

    Error tracking

    npm install @sentry/nextjs

    Docs

Install

npm install next @supabase/supabase-js @clerk/nextjs openai @sentry/nextjs

SDKs only. Pick your own database driver or ORM.