Skip to main content

Custom Agent Integration

If your agent runtime does not have native hooks, call Sequenceware directly through the SDK.

TypeScript example

import { SequencewareClient } from '@sequenceware/sdk';

const client = new SequencewareClient({
baseUrl: 'http://localhost:3000',
apiKey: process.env.SEQUENCEWARE_API_KEY,
agentId: 'custom-coding-agent',
});

const runId = await client.startRun(undefined, {
task: 'Refactor CI workflow',
source: 'custom-agent',
});

const toolCallId = await client.trackToolCall(
runId,
'Write',
{
file_path: '.github/workflows/deploy.yml',
content: 'name: Deploy\n...',
},
undefined,
'config_change',
'Update deployment workflow',
);

await client.completeToolCall(runId, toolCallId, { changed: true });
await client.completeRun(runId);

Python example

from sequenceware import SequencewareClient

client = SequencewareClient(
base_url="http://localhost:3000",
api_key="acl_replace_with_your_key",
agent_id="custom-coding-agent",
)

with client.run(metadata={"task": "refactor ci workflow", "source": "custom-agent"}) as run:
run.track_tool(
"Write",
{
"file_path": ".github/workflows/deploy.yml",
"content": "name: Deploy\\n...",
},
)

Minimum event model

Your integration should always send:

  • run start/end
  • every tool call with toolName + payload
  • completion/failure status for each tool call

See SDK overview and Events API for details.