Promptel¶
Declarative prompt engineering for production AI applications.
Promptel is a framework for writing sophisticated LLM prompts using a clean, declarative syntax. It's the first Node.js framework with native Harmony Protocol support for multi-channel reasoning.
Why Promptel?¶
Modern AI applications need sophisticated prompt engineering, but implementing advanced techniques is complex:
- Chain-of-Thought requires careful step management
- Multi-channel responses need custom parsing logic
- Provider switching means rewriting integration code
- Prompt maintenance becomes difficult at scale
Promptel solves these problems with a declarative approach:
import { executePrompt } from 'promptel';
const result = await executePrompt(`
prompt MathSolver {
params {
problem: string
}
body {
text\`Solve: \${params.problem}\`
}
technique {
chainOfThought {
step("Analyze") { text\`Break down the problem\` }
step("Solve") { text\`Calculate step by step\` }
step("Verify") { text\`Check the answer\` }
}
}
}
`, { problem: "What is 25% of 240?" });
Key Features¶
-
Dual Format Support
Write prompts in
.promptsyntax or YAML. Convert between formats seamlessly. -
Advanced Techniques
Built-in Chain-of-Thought, Tree-of-Thoughts, ReAct, and more.
-
Multi-Provider
Switch between OpenAI, Anthropic, and Groq with consistent APIs.
-
Harmony Protocol
Native support for multi-channel responses with gpt-oss models.
Quick Install¶
Set your API key:
Quick Example¶
Architecture¶
flowchart LR
A[.prompt/.yml] --> B[Parser]
B --> C[AST]
C --> D[Executor]
D --> E[Provider]
E --> F[LLM]
F --> G[Response Parser]
G --> H[Output] Next Steps¶
- Installation - Get Promptel set up
- Quick Start - Build your first prompt
- Examples - See Promptel in action