ConverseCommand, the OpenAI SDK, a hand-rolled HTTP client? You don’t need to switch SDKs or write a full adapter to adopt AgentMark. Pick the path that matches what you want.
Observe & evaluate (lightweight)
Keep your SDK calls. Add prompt management, tracing, and experiments in your own app. No
Executor, no adapter.Cloud-executed prompts
Let the dashboard “Run” your prompts and run managed experiments. Add a small
Executor so AgentMark can call your SDK.Path A — observe & evaluate in your own app
This covers the common migration: your code keeps calling Bedrock; AgentMark manages the prompts, traces the calls, and runs experiments. Everything runs in your process and reports to the cloud. Zero adapter, zero executor.1. Prompt management (neutral render)
Use the Default integration — it renders a.prompt.mdx to AgentMark’s neutral { messages, text_config } shape, which you pass straight to your SDK. It’s fully type-safe.
2. Tracing
Initialize once, then wrap any call — AgentMark’s tracing is SDK-agnostic.3. Experiments + evals
runExperiment takes your function as the task — it drives the dataset, traces each row, runs evaluators, and applies the regression gate.
Path B — let the cloud run your prompts
To use the dashboard Run prompt button,agentmark dev’s webhook, or platform-driven experiments, AgentMark needs to call your SDK — so you provide an Executor. The createExecutor builder makes this a pair of one-shot handlers; it guarantees the AgentEvent wire protocol for you (no async-generator plumbing, no usage/finish/error footguns).
Same primitive in Python:
from agentmark.prompt_core import create_executor — pass text=/object= (or stream_text=/stream_object=) handlers, validate with run_executor_conformance. Streaming handlers yield the same stream events in both languages — TS as object literals ({ type: "text-delta", text }), Python as dataclasses (TextDeltaEvent(text=...)) — and report usage on a yielded finish (FinishEvent(reason=..., usage=...)). The builder folds it onto the single terminal finish.Serve the runner
createWebhookRunner gives you a runner with runPrompt / runExperiment methods. The cloud reaches it over HTTP, so you mount it one of two ways.
Local development — agentmark dev and the dashboard talk to a local webhook server:
handler(body) entry. handleWebhookRequest bridges the runner’s methods to the { type, data } request the gateway dispatches:
createExecutor → createWebhookRunner → serve. The dashboard can now Run your prompts and drive managed experiments against your SDK.
Streaming SDKs
If your SDK streams (e.g. BedrockConverseStream), use the streaming handlers instead of buffering — same protocol guarantees. Streaming handlers yield the same stream events the rest of the protocol uses (text-delta, tool-call, …) and report usage + the finish reason on a finish event you yield; the builder emits the single terminal finish for you:
Streaming object handlers yield
object-delta / object-final events and a finish (carrying usage). If your SDK only streams cumulative partials (no explicit object-final), the builder uses the last delta as the resolved value — so the cloud always receives a complete object.Validate your executor
Run the conformance suite — one call confirms your executor emits a protocol-correct stream for every kind, including the error path:ctx, the suite runs your executor twice — once streaming, once one-shot — so if you supply both a text and a streamText handler, both branches are validated (a broken one-shot path won’t hide behind a working stream).
createExecutor only covers the model-call (Executor) half. If you also need provider-specific parameter mapping (tool wiring, custom settings) rather than the neutral config, write a custom adapter and pass your executor to createWebhookRunner via the same path.Have Questions?
We’re here to help! Choose the best way to reach us:
- Email us at hello@agentmark.co for support
- Schedule an Enterprise Demo to learn about our business solutions