Agent SDK

@cognipeer/agent-sdk  ·  Flagship · Runtime
stable

A deterministic TypeScript agent runtime for planning, safety, memory, and multi-agent orchestration. Zero-graph, message-first design with built-in summarization, guardrails, and structured tracing.

License  ·  MITTypeScript  ·  100%Audience  ·  Teams building customFits  ·  Custom agent orchestration
Custom agent orchestrationDeterministic workflowsTracing-rich executionBrowse recipes
Production install
$npm install @cognipeer/agent-sdk

What's in the box

Teams building custom agent logic in TypeScript and needing deterministic execution, planning, and human-in-the-loop control. Each capability is opt-in — use the parts that fit, leave the rest.

Message-First Runtime

Executes agent reasoning through a transparent, message-driven runtime with full conversational traceability.

Planning (TODO)

Structures agent workflows through managed task planning and explicit execution steps.

Pause / Continue

Persists agent state to enable workflow pausing and asynchronous continuation.

Human-in-the-Loop

Introduces approval and review checkpoints within agent decision processes.

Interrupt

Allows live agent execution to be stopped, redirected, or overridden in real time.

Summarisation

Compresses long conversational context using token-aware memory summarisation.

Guardrails

Applies runtime safety and policy controls to govern agent behaviour and outputs.

Structured Tracking

Captures detailed execution traces, tool calls, and reasoning events.

How it runs

A single deterministic loop: plan → call tools → reflect → checkpoint. No graph DSL to learn, no implicit globals. Everything you would inspect in a debugger is on the result.

Input
Message
Step 1
Plan
Reasoning budget
Step 2
Tools
Typed · approved
Step 3
Reflect
Stream + persist
Step 4
Checkpoint
Snapshot state
Output
Result

Inputs

  • User messages
  • Tool registry
  • Reasoning profile
  • Approval policies

State

  • state.plan
  • state.reflections
  • state.history
  • state.snapshot

Side effects

  • Tool calls
  • Tracing events
  • Approval requests
  • Token accounting

Quickstart

Install, configure, run. The example below is the smallest piece of code that does something useful in production.

1import {
2  createSmartAgent, createTool,
3  createProvider, fromNativeProvider,
4} from "@cognipeer/agent-sdk";
5 
6const model = fromNativeProvider(
7  createProvider({ provider: "openai", apiKey: process.env.OPENAI_API_KEY! }),
8  { model: "gpt-4o" },
9);
10 
11const agent = createSmartAgent({
12  model,
13  tools: [searchKb, openTicket],
14  runtimeProfile: "balanced",
15  tracing: { enabled: true },
16});
17 
18const result = await agent.invoke({
19  messages: [{ role: "user", content: "Where is order #4187?" }],
20});

How it compares

Against the flagship · runtime options teams most often weigh — focused on operational concerns, not feature inventories.

CapabilityAgent SDKLangChain (JS)LangGraphOpenAI Assistants API
Deterministic Runtime●  native○  missing○  missing○  missing
Planning●  native◐  partial◐  partial○  missing
Summarisation●  native○  missing○  missing○  missing
Guardrails●  native○  missing○  missing◐  partial
Interrupt●  native○  missing○  missing○  missing
Pause / Continue●  native○  missing◐  partial○  missing

Patterns that use Agent SDK

Production-tested recipes powered by this package.

Next steps