Docs / SDKTypeScript / Python

Agent SDK

The dnawerkes Agent SDK provides a typed, composable API for building, deploying, and orchestrating AI agents on the dnawerkes infrastructure.

Installation
TERMINAL

# npm

npm install @dnawerkes/sdk

# or with pnpm

pnpm add @dnawerkes/sdk

Quick Example

import { createAgent } from '@dnawerkes/sdk'

const agent = createAgent({

model: 'genome-ultra',

systemPrompt: 'You are a market analysis specialist...',

memoryIndex: 'market-data-v3',

})

const result = await agent.run('Summarize NVDA earnings trends Q1 2026')

console.log(result.output)

API Surface
import
createAgent(config)

Instantiate a new agent with a base prompt, memory index, and capability profile.

method
agent.run(task)

Execute a task synchronously or asynchronously. Returns a structured Result object.

method
agent.delegate(subtask, target)

Delegate a subtask to another agent node in the mesh for parallel execution.

method
agent.memory.query(query, k)

Retrieve the top-k most semantically relevant chunks from the agent's vector store.

method
agent.memory.upsert(docs)

Insert or update documents in the agent's vector memory with automatic deduplication.

hook
agent.on('complete', cb)

Subscribe to lifecycle events: complete, error, retry, delegate, and context_overflow.