Skip to content

SDK & Packages

The CLI is built on @agntk/core, which you can use directly in your own projects:

import { createAgent } from '@agntk/core';
const agent = createAgent({
name: 'my-agent',
instructions: 'You are a helpful coding assistant.',
workspaceRoot: process.cwd(),
});
const result = await agent.stream({ prompt: 'Read package.json and list the dependencies' });
for await (const chunk of result.fullStream) {
if (chunk.type === 'text-delta') process.stdout.write(chunk.text ?? '');
}
PackageDescription
agntkCLI — npx agntk entry point
@agntk/coreAgent factory — tools, streaming, memory, sub-agents, hooks
@agntk/cliCLI implementation
@agntk/serverHTTP server — REST + SSE + WebSocket endpoints
@agntk/clientClient library — HTTP, SSE, WebSocket
@agntk/loggerStructured logging with namespace filtering
const agent = createAgent({
name: 'my-agent',
tools: {
myCustomTool: {
description: 'Does something custom',
parameters: z.object({ input: z.string() }),
execute: async ({ input }) => ({ output: `Processed: ${input}` }),
},
},
});

Custom tools are merged with the 20+ built-in tools.

Every provider has 4 model tiers. Override via environment variables:

TierPurposeEnv Override
fastQuick responses, low costAGENT_SDK_MODEL_FAST
standardBalanced quality/costAGENT_SDK_MODEL_STANDARD
reasoningComplex logic, planningAGENT_SDK_MODEL_REASONING
powerfulBest quality, highest costAGENT_SDK_MODEL_POWERFUL

Expose any agent as an HTTP API:

import { createAgentServer } from '@agntk/server';
import { createAgent } from '@agntk/core';
const agent = createAgent({ name: 'api-agent', instructions: 'You help with API tasks.' });
const server = createAgentServer({ agent, port: 3000 });
server.start();
// POST /stream, POST /chat, GET /health, WS /ws/browser-stream

Connect from anywhere:

import { AgentHttpClient } from '@agntk/client';
const client = new AgentHttpClient('http://localhost:3000');
for await (const event of client.generateStream({ messages: [{ role: 'user', content: 'Hello' }] })) {
if (event.type === 'text-delta') process.stdout.write(event.textDelta);
}

Available via sub-path imports:

import { ... } from '@agntk/core'; // Core essentials
import { ... } from '@agntk/core/evals'; // Eval suite and assertions
import { ... } from '@agntk/core/advanced'; // Durability, hooks, guardrails, reflection, observability

Features include: durable workflows (crash recovery), workflow hooks (human-in-the-loop approval), guardrails (PII filtering), reflection (always-on self-critique), observability (Langfuse + OpenTelemetry), and best-of-N evaluation.