Skip to main content

prompt.pom

Prompt Object Model (POM)

The prompt object model (POM) is a structured data format designed for composing, organizing, and rendering prompt instructions for AI agents. POM helps users create prompts that are clearly structured and easy to understand. It allows for efficient editing, management, and maintenance of prompts. By breaking prompts into sections, users can manage each section independently and then combine them into a single cohesive prompt.

SignalWire will render the prompt into a markdown document.

If the text parameter is present while using pom, the pom prompt will be used instead of text.

Want a library for working with the POM?

SignalWire provides a Python library for working with the POM. More information can be found in the POM reference.

NameTypeDefaultDescription
pomOptionalobject[]-An array of objects that defines the prompt object model (POM) for the AI. Each object represents a section in the POM.

Section parameters

Each seciton can contain one of the two valid objects. One of body or bullets or pass both is required.

NameTypeDefaultDescription
titleOptionalstring-The title of the section. Will be a heading in the rendered prompt.
bodyConditionally Requiredstring-The body of the section. This will be a paragraph in the rendered prompt. This parameter is required if bullets is not present.
bulletsConditionally Requiredstring[]-An array of strings that represent the bullets of the section. This will be a list of short statements/rules in the rendered prompt. This parameter is optional if body is present.
subsectionsOptionalobject[]-An array of objects that defines the prompt object model (POM) for the AI. Each object represents a section in the POM allowing the users to nest sections within sections.
numberedOptionalbooleanfalseIf true, the section will be numbered in the rendered prompt.
numberedBulletsOptionalbooleanfalseIf true, the bullets will be numbered in the rendered prompt.

Example

Below is an example of using the POM to create a prompt.

version: 1.0.0
sections:
main:
- ai:
prompt:
text: "Prompt is defined in pom"
pom:
- title: "Agent Personality"
body: "You are a friendly and engaging assistant. Keep the conversation light and fun."
subsections:
- title: "Personal Information"
numberedBullets: true
bullets:
- "You are a AI Agent"
- "Your name is Frank"
- "You work at SignalWire"
- title: "Task"
body: "You are to ask the user a series of questions to gather information."
bullets:
- "Ask the user to provide their name"
- "Ask the user to provide their favorite color"
- "Ask the user to provide their favorite food"
- "Ask the user to provide their favorite movie"
- "Ask the user to provide their favorite TV show"
- "Ask the user to provide their favorite music"
- "Ask the user to provide their favorite sport"
- "Ask the user to provide their favorite animal"

Rendered Prompt

The above example will render the following prompt:

## Agent Personality

You are a friendly and engaging assistant. Keep the conversation light and fun.

### Personal Information

1. You are a AI Agent
2. Your name is Frank
3. You work at SignalWire

## Task

You are to ask the user a series of questions to gather information.

- Ask the user to provide their name
- Ask the user to provide their favorite color
- Ask the user to provide their favorite food
- Ask the user to provide their favorite movie
- Ask the user to provide their favorite TV show
- Ask the user to provide their favorite music
- Ask the user to provide their favorite sport
- Ask the user to provide their favorite animal