Prompt Manager

Introduction

Get started with Prompt Manager

Introduction

Welcome to Prompt Manager, a flexible and extensible prompt management system for building dynamic prompt templates.

Features

  • Flexible Templates: Support for multiple template engines including Handlebars and simple string interpolation
  • Multiple Storage Backends: Store prompts in memory, SQLite, PostgreSQL, or any custom storage backend
  • Smart Caching: Built-in caching with memory, Redis, and Cloudflare KV adapters for optimal performance
  • Type-Safe: Full TypeScript support with comprehensive type definitions
  • Modular Architecture: Use only the packages you need

Quick Start

Install the core package and your preferred storage/template engines:

bun add @prompt-manager/core
bun add @prompt-manager/storage-memory
bun add @prompt-manager/template-simple

Create your first prompt manager:

import { PromptManager } from '@prompt-manager/core';
import { MemoryStorage } from '@prompt-manager/storage-memory';
import { SimpleTemplate } from '@prompt-manager/template-simple';

const manager = new PromptManager({
  storage: new MemoryStorage(),
  template: new SimpleTemplate(),
});

// Store a prompt
await manager.set('greeting', 'Hello, {{name}}!');

// Render a prompt
const result = await manager.render('greeting', { name: 'World' });
console.log(result); // "Hello, World!"

Architecture

Prompt Manager follows a modular architecture with separate packages for different concerns:

  • @prompt-manager/core: Core prompt management functionality
  • Storage Adapters: Memory, SQLite, PostgreSQL
  • Template Engines: Simple interpolation, Handlebars
  • Cache Adapters: Memory, Redis, Cloudflare KV

Next Steps