> ## Documentation Index
> Fetch the complete documentation index at: https://puzzlet-9ba7bb98.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Prompt syntax

> Learn the AgentMark template syntax for creating dynamic prompts

AgentMark prompts use TemplateDX, a syntax that combines Markdown with JSX-like components.

## Quick reference

### Message roles

Text and Object prompts use message-role tags (`<System>`, `<User>`, `<Assistant>`). Image and Speech prompts use dedicated root tags (`<ImagePrompt>`, `<SpeechPrompt>`).

#### Text prompts

The `<Assistant>` tag is optional. Include it to provide few-shot examples or prior conversation turns.

```mdx theme={null}
<System>You are a helpful assistant</System>

<User>Hello, how are you?</User>

<Assistant>I'm doing well, thank you!</Assistant>
```

#### Object prompts

Object prompts produce structured output defined by a `schema` field in the `object_config` frontmatter. The `<Assistant>` tag below is an optional few-shot example showing the model what a valid response looks like. It doesn't drive the structure itself. Wrap example JSON in a fenced code block: the compiler parses a bare `{...}` inside `<Assistant>` as a JSX expression, which fails to compile.

````mdx theme={null}
---
name: extract-contact
object_config:
  model_name: openai/gpt-5-mini
  schema:
    type: object
    properties:
      name: { type: string }
      email: { type: string }
---

<System>You extract structured data from text</System>

<User>Extract the name and email from: John Smith (john@example.com)</User>

<Assistant>
```json
{"name": "John Smith", "email": "john@example.com"}
```
</Assistant>
````

#### Image prompts

```mdx theme={null}
<ImagePrompt>
A futuristic cityscape at sunset with flying cars
</ImagePrompt>
```

#### Speech prompts

```mdx theme={null}
<System>Read this text clearly and slowly</System>

<SpeechPrompt>
Welcome to AgentMark. This is a test of speech generation.
</SpeechPrompt>
```

### Dynamic content

TemplateDX makes prompts dynamic with `props` interpolation, conditionals (`<If>` / `<Else>`), loops (`<ForEach>`), and filters:

```mdx theme={null}
<User>
  Hello {capitalize(props.userName)}, you have {props.messageCount} new messages.
  <If condition={props.isPremium}>Thanks for being a premium member!</If>
  Products:
  <ForEach arr={props.products}>
    {(product) => (
      <>
        * {product.name}: ${round(product.price, 2)}
      </>
    )}
  </ForEach>
</User>
```

Put the `<>` and `</>` fragment markers on their own lines; a single-line fragment leaks the literal markers into the rendered message. For the full reference, see [TemplateDX syntax](/templatedx/syntax): [variables](/templatedx/variables), [expressions](/templatedx/expressions), [tags](/templatedx/tags), and [filters](/templatedx/filters).

## Reserved frontmatter: `agentmark_meta`

The top-level `agentmark_meta` frontmatter key is a namespace managed by AgentMark, with two kinds of keys:

* **AgentMark-injected keys**: AgentMark manages these keys automatically; don't author them yourself. AgentMark currently injects:
  * `commit_sha`: the git commit AgentMark resolved the served prompt content from, used to attribute traces to an exact version.
* **User-authored keys** (any other key you write under `agentmark_meta`) are yours. They're preserved on save and flow into telemetry metadata on every generation, so you can use them to tag traces:

```mdx theme={null}
---
name: support-reply
text_config:
  model_name: openai/gpt-5-mini
agentmark_meta:
  team: support
  experiment: tone-v2
---

<System>You are a support agent</System>
```

## Learn more

This page covers the syntax you'll reach for most. For everything else, including advanced templating, filters, components, and type safety, head to the full TemplateDX reference:

<Card title="TemplateDX reference" icon="book" href="/templatedx/introduction">
  The complete syntax guide for AgentMark prompts
</Card>

<div className="mt-8 rounded-lg bg-blue-50 p-6 dark:bg-blue-900/30">
  <h3 className="font-semibold mb-3">Have questions?</h3>
  <p className="mb-4">Reach out any time:</p>

  <ul>
    <li>
      Email the team at <a href="mailto:hello@agentmark.co" className="text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-200">[hello@agentmark.co](mailto:hello@agentmark.co)</a> for support
    </li>

    <li>
      Schedule an <a href="https://cal.com/ryan-randall/enterprise" className="text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-200">Enterprise Demo</a> to learn about AgentMark's business solutions
    </li>
  </ul>
</div>
