Agent SDK
The dnawerkes Agent SDK provides a typed, composable API for building, deploying, and orchestrating AI agents on the dnawerkes infrastructure.
# npm
npm install @dnawerkes/sdk
# or with pnpm
pnpm add @dnawerkes/sdk
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)
createAgent(config)Instantiate a new agent with a base prompt, memory index, and capability profile.
agent.run(task)Execute a task synchronously or asynchronously. Returns a structured Result object.
agent.delegate(subtask, target)Delegate a subtask to another agent node in the mesh for parallel execution.
agent.memory.query(query, k)Retrieve the top-k most semantically relevant chunks from the agent's vector store.
agent.memory.upsert(docs)Insert or update documents in the agent's vector memory with automatic deduplication.
agent.on('complete', cb)Subscribe to lifecycle events: complete, error, retry, delegate, and context_overflow.
