Skip to main content
AgentMark Prompt

What are AgentMark Prompts?

AgentMark prompts are .prompt.mdx files that combine the readability of Markdown with the power of JSX templating. They provide a structured, version-controllable way to define LLM prompts with type safety and reusability. Benefits:
  • Readable: Human-friendly 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:
example.prompt.mdx
---
name: example
text_config:
  model_name: gpt-4o-mini
  temperature: 0.7
---

2. Template Content

The actual prompt using message tags and dynamic content:
<User>
  Summarize the following text: {props.text}
</User>

Key Features

Message Tags

AgentMark provides message role tags for structuring conversations:
  • <System> - System-level instructions
  • <User> - User messages
  • <Assistant> - Assistant responses (for few-shot examples)
See Generation Types →

Dynamic Variables

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

Conditional Logic

Show/hide content based on conditions:
<User>
  {#if props.isPremium}
    You have access to premium features.
  {/if}
</User>
Learn about Conditionals →

Loops

Iterate over arrays to generate content:
<User>
  Products:
  {#each props.products as product}
    - {product.name}: ${product.price}
  {/each}
</User>
Learn about Loops →

Reusable Components

Create shared components for common patterns:
components/ProductList.mdx
{#each props.products as product}
- {product.name}: ${product.price}
{/each}
Use in prompts:
<User>
  <ProductList products={props.products} />
</User>
Learn about Components →

Tools and Agents

Define tools for function calling and create multi-step agents:
---
name: assistant
text_config:
  model_name: gpt-4o
  max_calls: 5
tools:
  - name: get_weather
    description: Get current weather
---
Learn about Tools and Agents →

File Attachments

Include images and other files in prompts:
<User>
  <File src="./screenshot.png" />
  What's in this image?
</User>
Learn about File Attachments →

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 →

Next Steps

Have Questions?

We’re here to help! Choose the best way to reach us: