Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Markdown for the AI era

License

NotificationsYou must be signed in to change notification settings

MostUsing/agentmark

 
 

Repository files navigation

AgentMark Logo

Markdown for the AI Era

Discord |Docs |Puzzlet


Overview

Develop type-safe prompts and agents using readable Markdown and JSX.

Features

AgentMark supports:

  1. Markdown: 📝
  2. Type Safety: 🛡️
  3. Unified model config: 🔗
  4. JSX components, props, & plugins: 🧩
  5. Custom Models: 🛠️
  6. Streaming: 🌊
  7. Loops, Conditionals, and Filter Functions: ♻️
  8. JSON Output: 📦
  9. Tools & Agents: 🕵️
  10. Observability: 👀

Read ourdocs to learn more.

Getting Started

Below is a basic example to help you get started with AgentMark:

example.prompt.mdx

---name:basic-promptmetadata:model:name:gpt-4o-minitest_settings:props:num:3---<System>You are a math expert</System><User>What's 2 +{props.num}?</User>

Models

By default, AgentMark doesn't support any model providers. Instead, support must be added through our plugins.Here's a list of currently supported plugins you can start using.

Built-In Model Plugins

ProviderModelSupported@puzzlet/all-models
OpenAIgpt-4o✅ Supported
OpenAIgpt-4o-mini✅ Supported
OpenAIgpt-4-turbo✅ Supported
OpenAIgpt-4✅ Supported
OpenAIo1-mini✅ Supported
OpenAIo1-preview✅ Supported
OpenAIgpt-3.5-turbo✅ Supported
Anthropicclaude-3-5-haiku-latest✅ Supported
Anthropicclaude-3-5-sonnet-latest✅ Supported
Anthropicclaude-3-opus-latest✅ Supported
MetaALL✅ Supported🧩 Only
Customany✅ Supported🧩 Only
GoogleALL⚠️ Coming SoonN/A
GrokALL⚠️ Coming SoonN/A

Want to add support for another model? Open anissue.

Custom Model Plugins

Refer to ourdocs to learn how to add custom model support.

Language Support

We plan on providing support for AgentMark across a variety of languages.

LanguageSupport Status
TypeScript✅ Supported
OthersNeed something else?Open an issue

Running AgentMark

You can run AgentMark using any of the following methods:

1. VSCode Extension

Run .prompt.mdx files directly within your VSCode editor. Note: You can test props by usingtest_settings in your prompts.

Download the VSCode Extension

2. FileLoader

Run AgentMark files from your file system. Below is a sample implementation:

import{ModelPluginRegistry,FileLoader,createTemplateRunner}from"@puzzlet/agentmark";importAllModelPluginsfrom'@puzzlet/all-models';// Register modelsModelPluginRegistry.registerAll(AllModelPlugins);// Create a file loader pointing to your prompts directoryconstfileLoader=newFileLoader("./prompts",createTemplateRunner);construn=async()=>{// Load a prompt, relative to the file loader's rootconstmathPrompt=awaitfileLoader.load("math/addition.prompt.mdx");constprops={num1:5,num2:3}// Run the promptconstresult=awaitmathPrompt.run(props);console.log("Run result:",result.result);// Compile to see the AgentMark configurationconstcompiled=awaitmathPrompt.compile(props);console.log("Compiled configuration:",compiled);// Deserialize to see raw model parameters (i.e. whats sent to the LLM: OpenAI, Anthropic, etc.)constdeserialized=awaitmathPrompt.deserialize(props);console.log("Model parameters:",deserialized);}run();

3. Puzzlet Integration

Puzzlet is a platform for managing, versioning, and monitoring your LLM prompts in production, with built-in observability, evaluations, and prompt management.

import{Puzzlet}from'@puzzlet/sdk';import{ModelPluginRegistry,createTemplateRunner}from"@puzzlet/agentmark";importAllModelPluginsfrom'@puzzlet/all-models';ModelPluginRegistry.registerAll(AllModelPlugins);constpuzzletClient=newPuzzlet({apiKey:process.env.PUZZLET_API_KEY!,appId:process.env.PUZZLET_APP_ID!,},createTemplateRunner);construn=async()=>{// Load prompt from Puzzlet instead of local fileconstprompt=awaitpuzzletClient.fetchPrompt('math/addition.prompt.mdx');// Run the promptconstresult=awaitprompt.run({num1:5,num2:3});console.log("Run result:",result);// Compile the promptconstcompiled=awaitprompt.compile({num1:5,num2:3});console.log("Compiled configuration:",compiled);// Deserialize the promptconstdeserialized=awaitprompt.deserialize({num1:5,num2:3});console.log("Model parameters:",deserialized);}run();

Type Safety

AgentMark & Puzzlet supports automatic type generation from your prompt schemas. Define input (input_schema) and output (schema) types in your prompt files:

---name:math-additionmetadata:model:name:gpt-4osettings:schema:type:"object"properties:sum:type:"number"description:"The sum of the two numbers"required:["sum"]input_schema:type:"object"properties:num1:type:"number"description:"First number to add"num2:type:"number"description:"Second number to add"required:["num1", "num2"]---<System>You are a helpful math assistant that performs addition.</System>

Then generate types using the CLI:

# From local filesnpx @puzzlet/cli generate-types --root-dir ./prompts> puzzlet.types.ts# From local Puzzlet servernpx @puzzlet/cli generate-types --local 9002> puzzlet.types.ts

Use the generated types with FileLoader:

importPuzzletTypesfrom'./puzzlet.types';import{FileLoader,createTemplateRunner}from"@puzzlet/agentmark";constfileLoader=newFileLoader<PuzzletTypes>("./prompts",createTemplateRunner);// TypeScript will enforce correct input/output typesconstprompt=awaitfileLoader.load("math/addition.prompt.mdx");constresult=awaitprompt.run({num1:5,// Must be numbernum2:3// Must be number});constsum=result.result.sum;// type-safe number

Or with Puzzlet:

importPuzzletTypesfrom'./puzzlet.types';import{Puzzlet}from'@puzzlet/sdk';constpuzzlet=newPuzzlet<PuzzletTypes>({apiKey:process.env.PUZZLET_API_KEY!,appId:process.env.PUZZLET_APP_ID!,},createTemplateRunner);// Same type safety as FileLoaderconstprompt=awaitpuzzlet.fetchPrompt("math/addition.prompt.mdx");constresult=awaitprompt.run({num1:5,num2:3});constsum=result.result.sum;// type-safe number

AgentMark is also type-safe within markdown files. Read morehere.

Contributing

We welcome contributions! Please check out ourcontribution guidelines for more information.

Community

Join our community to collaborate, ask questions, and stay updated:

License

This project is licensed under theMIT License.

About

Markdown for the AI era

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript84.6%
  • MDX12.3%
  • JavaScript3.1%

[8]ページ先頭

©2009-2025 Movatter.jp