1

Register and create your App

  1. Register with a new account or login to your existing

  2. Create your app, and sync it with your GitHub repository and branch

Tip: Your AgentMark repo doesn’t need to be the same as where you store your app code. Your data is still accessible via our secure data layer.

2

Run AgentMark init and Push to GitHub

  1. Initialize your AgentMark configuration in the root of your repo.
npx @agentmark/cli@latest init
  1. Commit & push the changes to your synced branch.
3

Publish your first Prompt Template

4

Fetch your prompt and run it with tracing

  1. Create your API key, and grab your appId.
  2. Run your prompt
import { AgentMarkSDK } from "@agentmark/sdk";
import { createAgentMarkClient, VercelAIModelRegistry } from "@agentmark/vercel-ai-v4-adapter";
import { openai } from "@ai-sdk/openai";
import { generateText } from "ai";

const sdk = new AgentMarkSDK({ apiKey, appId });
const tracer = sdk.initTracing({ disableBatch: true })

const modelRegistry = new VercelAIModelRegistry();
modelRegistry.registerModels( ["gpt-4o-mini"], (name: string) => {
    return openai(name);
  }
);

const agentMark = createAgentMarkClient({
  loader: sdk.getFileLoader(),
  modelRegistry
});

async function run () {
  const examplePrompt = await agentMark.loadTextPrompt("example.prompt.mdx");
  const vercelInput = await examplePrompt.format({
    props: { name: "World" },
    // required for tracing
    telemetry: {
      isEnabled: true,
      metadata: {
        userId: "user_123",
      }
    }
  });
  return generateText(vercelInput);
}
// Note: You only need to shutdown the tracer for local/short running tasks.
run().then(() => tracer.shutdown());
  1. View the results in your dashboard

Have Questions?

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