Skip to main content

Default Integration

The default (fallback) adapter transforms prompts into AgentMark’s raw configuration format without targeting a specific AI SDK. This lets you map the output directly to your preferred provider.
With the Default integration, you can map the parameters directly to your preferred provider (e.g., OpenAI, Ollama) or your own SDK. This allows you to maintain flexibility while using AgentMark’s interface.

Installation

npm install @agentmark-ai/fallback-adapter

Usage

import { createAgentMarkClient } from "@agentmark-ai/fallback-adapter";
import { FileLoader } from "@agentmark-ai/prompt-core";

const loader = new FileLoader("path/to/prompts");

const agentmark = createAgentMarkClient({
  loader,
});

const prompt = await agentmark.loadTextPrompt("<example>.prompt.mdx");
const result = await prompt.format({
  props: {
    // prompt props
  },
});

console.log(result);

What It Returns

The fallback adapter returns the raw prompt configuration as-is, without transforming it for a specific SDK. The output includes:
  • Model configuration — model name, temperature, max tokens, and other parameters from your prompt’s frontmatter
  • Messages — the rendered system/user/assistant messages after template processing
  • Tool definitions — any tools referenced in the prompt (as raw config)
  • Schema — for object prompts, the output schema
This raw config can be mapped to any provider’s API format (OpenAI, Anthropic, Google, Ollama, etc.) in your own code.

When to Use

  • Unsupported SDK — Your AI SDK doesn’t have a dedicated AgentMark adapter yet
  • Custom provider — You’re calling a provider API directly without an SDK
  • Inspection/debugging — You want to see the raw config AgentMark produces before sending it to a provider
  • Adapter development — You’re building a new adapter and want to understand the input format
For most applications, prefer a dedicated adapter like the AI SDK or Claude Agent SDK for a streamlined experience.

Next Steps

Have Questions?

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