Skip to main content
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.
<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.
---
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

<ImagePrompt>
A futuristic cityscape at sunset with flying cars
</ImagePrompt>

Speech prompts

<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:
<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: variables, expressions, tags, and 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:
---
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:

TemplateDX reference

The complete syntax guide for AgentMark prompts

Have questions?

Reach out any time: