# `PhoenixKit.Migrations.Postgres.V38`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.87/lib/phoenix_kit/migrations/postgres/v38.ex#L1)

PhoenixKit V38 Migration: AI Prompts System

This migration adds reusable prompt templates with variable substitution to the AI module.

## Changes

### Prompts Table (phoenix_kit_ai_prompts)
- Reusable text templates for AI interactions
- Variable substitution with {{VariableName}} syntax
- Auto-extracted variables stored for validation
- Usage tracking (count and last used timestamp)
- Sorting and organization support

## Key Features

- **Variable Substitution**: Use {{VarName}} placeholders in prompts
- **Auto-extraction**: Variables are automatically parsed from content
- **Usage Tracking**: Track how often prompts are used
- **Flexible Templates**: Can be used as system prompts, user prompts, or any text

# `down`

Rollback the V38 migration.

# `up`

Run the V38 migration to add AI Prompts.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
