Puzzlet supports reusable components to help you maintain consistent prompting patterns across your applications. Components can be created and managed in two ways:

Create Components via Puzzlet

Create and manage components directly in the Puzzlet platform:

  1. Navigate to the prompt section of Puzzlet
  2. Click on the 3-dots menu option next to the folder
  3. Create a new component, with a given name and publish it

Local Components

Create components locally in your puzzlet/templates directory:

puzzlet/templates/
  ├── components/
  │   ├── math-instructions.mdx
  │   └── language-instructions.md
  └── prompts/
      └── example.prompt.mdx
  1. Create a new component in the templates directory
  2. Commit and push your changes to the connected git branch

Using Components

Import and use components in your prompts:

example.prompt.mdx
import MathInstructions from '../components/math-instructions.mdx';

<System>
  You are a math tutor.
  <MathInstructions level={props.difficulty} />
</System>

Component example:

math-instructions.mdx
You are a patient and knowledgeable math tutor. Follow these guidelines:

<If condition={props.level === "basic"}>
  - Explain concepts using simple, everyday examples
  - Break down problems into very small steps
  - Use visual representations when possible
  - Avoid complex mathematical notation
</If>

<If condition={props.level === "intermediate"}>
  - Provide detailed step-by-step solutions
  - Introduce formal mathematical notation gradually
  - Explain the reasoning behind each step
  - Include relevant formulas with explanations
</If>

<If condition={props.level === "advanced"}>
  - Use formal mathematical notation
  - Include theoretical foundations
  - Reference related concepts and theorems
  - Provide rigorous mathematical proofs
</If>

Learn More

For detailed information about component features and syntax, see the AgentMark Components Documentation.

Key features include:

  • Props support
  • Conditional rendering
  • Plain markdown imports
  • Component composition

Have Questions?

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