***

title: PromptManager
slug: /reference/typescript/agents/configuration/prompt-manager
description: Manages agent prompt text, supporting both raw text and structured POM-based prompts.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[pombuilder]: /docs/server-sdks/reference/typescript/agents/pom-builder

`PromptManager` manages agent prompt text, supporting both raw text and structured
POM-based prompts. When POM mode is active (the default), sections are rendered
to Markdown via the underlying [`PomBuilder`][pombuilder].

```typescript {3}
import { PromptManager } from '@signalwire/sdk';

const pm = new PromptManager();
pm.addSection('Role', { body: 'You are a helpful support agent.' });
pm.addSection('Rules', { bullets: ['Be concise', 'Be polite'] });
console.log(pm.getPrompt());
```

## **Constructor**

<ParamField path="usePom" type="boolean" default="true" toc={true}>
  Whether to use structured POM sections. When `false`, only raw text via
  `setPromptText()` is supported.
</ParamField>

## **Methods**

<CardGroup cols={3}>
  <Card title="setPromptText" href="/docs/server-sdks/reference/typescript/agents/configuration/prompt-manager/set-prompt-text">
    Set raw prompt text, bypassing POM rendering.
  </Card>

  <Card title="setPostPrompt" href="/docs/server-sdks/reference/typescript/agents/configuration/prompt-manager/set-post-prompt">
    Set the post-prompt text appended after the main prompt.
  </Card>

  <Card title="addSection" href="/docs/server-sdks/reference/typescript/agents/configuration/prompt-manager/add-section">
    Add a POM section with body, bullets, or subsections.
  </Card>

  <Card title="addToSection" href="/docs/server-sdks/reference/typescript/agents/configuration/prompt-manager/add-to-section">
    Append body text or bullets to an existing POM section.
  </Card>

  <Card title="addSubsection" href="/docs/server-sdks/reference/typescript/agents/configuration/prompt-manager/add-subsection">
    Add a subsection under a parent POM section.
  </Card>

  <Card title="hasSection" href="/docs/server-sdks/reference/typescript/agents/configuration/prompt-manager/has-section">
    Check whether a POM section with the given title exists.
  </Card>

  <Card title="getPrompt" href="/docs/server-sdks/reference/typescript/agents/configuration/prompt-manager/get-prompt">
    Return the fully rendered prompt text.
  </Card>

  <Card title="getPostPrompt" href="/docs/server-sdks/reference/typescript/agents/configuration/prompt-manager/get-post-prompt">
    Return the post-prompt text.
  </Card>

  <Card title="getPomBuilder" href="/docs/server-sdks/reference/typescript/agents/configuration/prompt-manager/get-pom-builder">
    Return the underlying PomBuilder instance.
  </Card>
</CardGroup>

## **Example**

```typescript {3-6,8}
import { PromptManager } from '@signalwire/sdk';

const pm = new PromptManager();
pm.addSection('Role', { body: 'You are a friendly customer support agent.' });
pm.addSection('Rules', { bullets: ['Be concise', 'Be polite', 'Never guess'] });
pm.setPostPrompt('Summarize the conversation in JSON format.');

console.log(pm.getPrompt());
// ## Role
// You are a friendly customer support agent.
//
// ## Rules
// - Be concise
// - Be polite
// - Never guess
```