Skip to main content
Create prompts as .prompt.mdx files in your editor, or use the visual editor in the Dashboard. Both produce the same format and are fully interchangeable. Run them via SDK, CLI, or the Dashboard Playground.

Write prompts as .prompt.mdx files

An AgentMark prompt is a .prompt.mdx file: Markdown for the prompt text, JSX tags for structure and logic. You write it once and reuse it across your app, version it in git next to your code, and type-check the inputs and outputs against your schema.
  • Readable: syntax that’s easy to review and understand
  • Reusable: share components across prompts and use variables for dynamic content
  • Type-safe: full TypeScript support for props and outputs
  • Version-controlled: store prompts in git alongside your code
  • Testable: run experiments with datasets and automated evaluations

Basic structure

Every AgentMark prompt consists of two parts:

1. Frontmatter (YAML)

Defines the prompt’s metadata and configuration:
agentmark/greeting.prompt.mdx
---
name: greeting
text_config:
  model_name: openai/gpt-5-mini
  temperature: 0.7
---

2. Template content

The actual prompt using message tags and dynamic content:
<System>
You are a friendly assistant.
</System>

<User>
Say hello to {props.name} and tell them something interesting.
</User>

Creating prompts

Use the Dashboard’s visual editor to create and edit prompts. No coding or git knowledge required.The visual editor shows the frontmatter and message-tag body, a model selector, input-variable fields, and a streaming output pane. Everything it edits is the same .prompt.mdx format you edit locally in your own editor.
  • Write and edit prompts with syntax highlighting
  • Test prompts directly in the editor
  • Configure model settings through visual controls
  • Preview outputs in real-time
Step-by-step guide →

Key features

Message tags

Structure conversations with role tags:
  • <System>: system-level instructions
  • <User>: user messages
  • <Assistant>: assistant responses (for few-shot examples)

Dynamic variables

Access runtime data using props:
<User>
Hello {props.userName}, you have {props.messageCount} new messages.
</User>
Learn about Props →

Conditional logic and loops

<User>
  <If condition={props.isPremium}>
    You have access to premium features.
  </If>

  Products:
  <ForEach arr={props.products}>
    {(product) => (
      <>
        * {product.name}: ${product.price}
      </>
    )}
  </ForEach>
</User>
Put the <> and </> fragment markers on their own lines, as shown. With props.isPremium = true and props.products = [{ name: "Widget", price: 10 }, { name: "Gadget", price: 20 }], the <User> message renders as:
You have access to premium features.

Products:

* Widget: $10
* Gadget: $20
Learn about TemplateDX syntax →

Generation types

AgentMark supports multiple output formats:
  • Text: natural language responses
  • Object: structured JSON with schema validation
  • Image: image generation
  • Speech: audio generation
Explore generation types →

Advanced features

Next steps

Running prompts

Execute prompts in your application via SDK

Generation types

Explore text, object, image, and speech generation

Tools & agents

Build multi-step agents with function calling

TemplateDX syntax

Learn the full template syntax

Have questions?

Reach out any time: