Custom Prompts

Save reusable prompts in Postgres and use them in AI Chat.

Overview

Custom prompts are stored in Postgres and can be selected inside the AI Chat UI.

  • Table: prompts in tanstarter/src/db/schema.ts
  • UI: tanstarter/src/components/CustomPrompts.tsx
  • API: tanstarter/src/routes/api/prompts.ts

API surface

  • GET /api/prompts returns the current user’s prompts
  • POST /api/prompts creates a new prompt (name + content required)

If you want public/shared prompts, add fields and query paths on top of the existing prompts table.