Guides

Instrument A Custom Framework

Use adapter-kit patterns when there is no dedicated framework integration.

Use @isplay/adapter-kit when the app has its own agent loop or an unsupported framework. The kit wraps common capture patterns without forcing a specific framework model.

What To Wrap

BoundaryKit helper or SDK method
Run start/endinit() and withRun() from @isplay/sdk
Prompt, memory, retrieval, stateannotateContext() or kit annotations
Model callcaptureModelCall() or SDK model methods
Tool callwrapTool()
Framework lifecycle eventrecordFrameworkEvent()
State snapshotcheckpoint()

Basic Shape

import { init } from "@isplay/sdk";
import { createAdapterKit } from "@isplay/adapter-kit";

const client = init({
  projectId: process.env.ISPLAY_PROJECT_ID!,
  baseUrl: process.env.ISPLAY_API_URL,
  serviceName: "custom-agent",
});

const kit = createAdapterKit({ client });

const search = kit.wrapTool(
  {
    name: "search",
    sideEffectClass: "read",
    schemaVersion: "1",
  },
  async (args: { query: string }) => {
    return searchBackend(args.query);
  },
);

Add Framework Events

await kit.recordFrameworkEvent({
  framework: "custom",
  type: "step.started",
  payload: {
    step: "retrieve",
    inputSummary: "claim policy lookup",
  },
});

Custom events are allowed by the event schema. Keep them compact and use stable names.

Annotation Strategy

Annotate the context that the framework hides:

  • Planner or router prompts.
  • Tool schema descriptions generated by the framework.
  • Retrieval inputs and returned chunks.
  • Memory read/write values.
  • Graph node state.
  • Human approval decisions.

Replay Readiness Checklist

QuestionRequired work
Can a branch resume before the decision?Add checkpoint before the decision.
Can a replay identify changed tool args?Capture tool proposal and execution args.
Can missing output be matched?Capture stable args hashes and tool names.
Can risky tools be blocked or fixture-backed?Classify side effects and wrap before execution.
Can a report cite context?Annotate context with paths and provenance.

On this page