Stop wrestling with prompt strings. Start building AI agents that actually work.
You’re building an AI agent. You start with a simple string prompt. Then you need to add tools. Then constraints. Then examples. Before you know it, you’re managing 500-line template strings, copy-pasting security rules, and debugging why your agent ignores half your instructions. PromptSmith gives you a structured, type-safe, testable way to build AI agent prompts that scale.Why PromptSmith?
Type-Safe Tools
No more runtime errors from mismatched tool schemas. Zod schemas give you autocomplete and type checking.
Security Built-In
One-line guardrails against prompt injection. Forbidden topics enforcement. Error handling patterns.
Composable & Reusable
Create base prompts and extend them. Merge security patterns across agents. DRY up your AI code.
AI SDK Native
.toAiSdk() exports ready-to-use configurations for Vercel AI SDK and Mastra integration.Test Your Prompts
Built-in testing framework. Run real LLM tests against your prompts before production.
Built-In Validation
Automatic validation catches duplicate tools, missing identity, conflicting constraints before deployment.
State Introspection
Query builder state with
hasTools(), hasConstraints(), getSummary() for conditional logic.Debug Mode
Comprehensive debug output shows configuration, validation status, and token usage estimates.
Key Features
Production-Ready Templates
Start fast with pre-built, optimized templates for common use cases:Token Optimization with TOON Format
Reduce token usage by 30-60% with TOON (Token-Oriented Object Notation) format:Start with
markdown while authoring prompts, promote to compact in staging (10-20% savings), and ship toon in production (30-60% savings) for maximum token efficiency.Test Before Deploy
Run automated tests with real LLM responses:Use Cases
E-Commerce Support
Build agents that search products, handle returns, and answer questions with built-in safety guardrails.
Code Review & Generation
Create coding assistants with access to your codebase, documentation, and testing tools.
Data Analysis
Query databases, generate reports, and visualize data with natural language interfaces.
Research & Documentation
Build agents that search knowledge bases, summarize documents, and answer domain-specific questions.
Secure Internal Tools
Enterprise agents with strict access controls, audit logging, and compliance requirements.
Multilingual Support
Agents that handle multiple languages with consistent behavior and cultural awareness.
Quick Links
Installation
Get started with PromptSmith in your project
Quick Start
Build your first agent in 5 minutes
API Reference
Complete API documentation
Framework Support
PromptSmith works seamlessly with both Vercel AI SDK and Mastra:- Vercel AI SDK
- Mastra
What Makes PromptSmith Different?
| Feature | Manual Prompts | PromptSmith |
|---|---|---|
| Type Safety | None | Full TypeScript support |
| Tool Integration | Manual sync | Automatic from schemas |
| Reusability | Copy-paste | Compose & extend |
| Security | DIY | Built-in guardrails |
| Testing | Manual | Automated framework |
| Validation | None | Pre-deployment checks |
| Maintainability | 500-line strings | Structured & organized |
| Framework Support | Manual config | AI SDK + Mastra native |
| Token Optimization | Manual | TOON format (30-60% savings) |
| Debug Tools | None | Built-in debug mode |
Ready to Get Started?
Installation Guide
Install PromptSmith and its dependencies
Quick Start Tutorial
Build your first agent in minutes
Built with ❤️ for the Vercel AI SDK community
Made by @galfrevn