A human-friendly high-level declarative language that defines AI agent behavior, knowledge, rules, and persona through ".book" files, with automatic RAG retrieval and multi-LLM provider integration.
Promptbook is a human-friendly high-level declarative language and engine that defines AI agent behavior, knowledge, rules, and persona through "Book" files.
Core Concepts#
The project introduces a declarative language called "Book" that defines AI agents through "Commitments":
- PERSONA: Define the AI agent's role, personality, and communication style
- KNOWLEDGE: Provide specific knowledge, documents, or context with PDF/DOCX/URL support and automatic RAG retrieval
- RULE: Enforce specific behavior constraints, executable through adversarial agents
- TEAM: Define team structure and other expert members available for consultation
Book File Example#
Paul Smith & Associés
PERSONA You are a company lawyer.
Your job is to provide legal advice and support to the company and its employees.
RULE Always ensure compliance with laws and regulations.
RULE Never provide legal advice outside your area of expertise.
KNOWLEDGE https://company.com/company-policies.pdf
Ecosystem Components#
| Component | Description |
|---|---|
| Book Language | Human-friendly high-level declarative language, file extension .book |
| Promptbook Engine | Engine running Book language, published as multiple NPM packages |
| Agents Server | AI agent hosting and management platform |
| VSCode Plugin | Editor plugin supporting .book file extension |
Installation#
# Install complete package
npm i ptbk
# or
npm i promptbook
# Core packages
npm i @promptbook/core
npm i @promptbook/node # Node.js environment
npm i @promptbook/browser # Browser environment
# LLM provider integrations
npm i @promptbook/openai
npm i @promptbook/anthropic-claude
npm i @promptbook/google
npm i @promptbook/deepseek
npm i @promptbook/ollama
npm i @promptbook/azure-openai
Typical Use Cases#
- Chat Apps: Create chat applications that leverage company knowledge for accurate responses
- Reply Agent: Auto-generate context-aware email reply drafts
- Coding Agent: Enforce coding style and architecture rules in vibecoding platforms
- Internal Expertise: Integrate AI into internal applications for data analysis, sentiment analysis, etc.
Capabilities and Limitations#
Supported: Multi-LLM providers (OpenAI, Claude, Gemini, DeepSeek, Ollama, Azure), automatic RAG retrieval with vector database integration, multi-agent team collaboration definition, PDF/DOCX/web knowledge source import, Node.js / Browser / Docker runtime environments
Not Supported/Limited: Streaming response (planned), recursive logic, applications primarily focused on non-text media (images, audio, video, spreadsheets)