Install AgentMark

Install with npm:

npm
npm install @puzzlet/agentmark

or yarn:

npm
yarn add @puzzlet/agentmark

Create your first Prompt

index.prompt.mdx

---
name: basic-prompt
metadata:
  model:
    name: gpt-4o-mini
---

<User>Hello World</User>

Run your Prompt

Run .prompt.mdx files directly within your VSCode editor.

Download the VSCode Extension

Node.js

Run AgentMark directly in your Node.js environment. Below is a sample implementation:

node
import { FileLoader, ModelPluginRegistry, createTemplateRunner } from "@puzzlet/agentmark";
import AllModelPlugins from '@puzzlet/all-models';

// Note: Registering all latest models for demo/development purposes. 
// In production, you'll likely want to selectively load these, and pin models.
ModelPluginRegistry.registerAll(AllModelPlugins);
const fileLoader = new FileLoader('./path/to/prompts', createTemplateRunner);

const run = async () => {
  const examplePrompt = await fileLoader.load('./example.prompt.mdx');
  const props = { name: "Emily" };
  const result = await examplePrompt.run(props);
  console.log(result);
}
run();

Puzzlet

Collaborate with your team on prompts and agents with Puzzlet’s platform.

node
import { ModelPluginRegistry, createTemplateRunner } from "@puzzlet/agentmark";
import { Puzzlet } from "@puzzlet/sdk";
import AllModelPlugins from '@puzzlet/all-models';

const puzzletClient = new Puzzlet({
  apiKey: process.env.PUZZLET_API_KEY!,
  appId: process.env.PUZZLET_APP_ID!
}, createTemplateRunner);

// Note: Registering all latest models for demo/development purposes. 
// In production, you'll likely want to selectively load these, and pin models.
ModelPluginRegistry.registerAll(AllModelPlugins);

const run = async () => {
  const examplePrompt = await puzzletClient.fetchPrompt("<example>.prompt.mdx");
  const props = { name: "Emily" };
  const result = await examplePrompt.run(props);
  console.log(result);
}
run();

Have Questions?

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