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.

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.

Image prompts

Speech prompts

Dynamic content

TemplateDX makes prompts dynamic with props interpolation, conditionals (<If> / <Else>), loops (<ForEach>), and filters:
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:

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: