Skip to main content

Overview

All PrePrompt records live in MongoDB under the preprompts collection. The backend never keeps a separate in-memory store—each API read/write goes through the repository defined in src/services/database/repositories/preprompt.repository.ts, which also initialises the indexes described below.

Document shape

  • key: unique identifier referenced by clients through preprompt_key.
  • public_value: friendly string rendered in the UI.
  • masked_value: injected after the system prompt; never exposed to clients.
  • description, tags: optional metadata for catalog filtering.
  • is_deleted: soft-delete flag used by admin workflows.

Indexes

Both indexes are created automatically at service startup, so no manual migration is required.

Access patterns

Because every lookup hits MongoDB, deploying multiple API instances stays consistent without additional cache invalidation logic.