Skip to main content
The Prompts API tracks user prompts (questions/requests sent to AI) for context and searchability.

Add Prompt

POST /prompts Store a user prompt.

Request Body

string
required
Session ID this prompt belongs to
string
required
The full prompt text (max 2000 chars, automatically truncated)
string
Project name for filtering

Response

integer
The prompt ID (auto-incremented)
string
Always “saved”

Example

Get Recent Prompts

GET /prompts/recent Retrieve recent prompts, optionally filtered by project.

Query Parameters

string
Filter by project name
integer
default:"20"
Maximum prompts to return (1-100)

Response

Returns an array of prompts:
integer
Prompt ID
string
Session ID
string
Full prompt text
string
Project name (empty string if not set)
string
ISO 8601 timestamp

Example

Search Prompts

GET /prompts/search Search prompts using full-text search (FTS5).

Query Parameters

string
required
Search query. Supports multiple words, automatically quoted for safety.
string
Filter by project name
integer
default:"10"
Maximum results to return (1-100)

Response

Returns an array of matching prompts (same schema as Get Recent Prompts).

Example

Search Behavior

Query Sanitization

Prompt search uses the same FTS5 sanitization as observations search:

Searched Fields

  • content - Full prompt text
  • project - Project name

Multi-Word Queries

Multi-word queries match prompts containing all terms (AND logic):

Privacy

Prompts support <private>...</private> tags to prevent sensitive data storage:
Stored as:

Error Handling

Missing Required Fields

Missing Search Query

Prompt Schema

Complete prompt object structure:

Use Cases

  1. Context Building - Show recent prompts to provide conversation context
  2. Pattern Detection - Identify frequently asked questions
  3. Debugging - Trace what users asked before encountering issues
  4. Analytics - Understand common user workflows and pain points

Retention

Prompts are stored indefinitely. Use the export/import API to backup or migrate prompt data.