Agent SDK

@cognipeer/agent-sdk  ·  Flagship · Runtime
stable

A deterministic TypeScript agent runtime for planning, reasoning, memory, and multi-agent orchestration. Native providers for OpenAI, Anthropic, Azure, Bedrock, and Vertex — no LangChain required — with a zero-graph, message-first loop plus built-in summarisation, guardrails, structured output, and 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, reasoning, and human-in-the-loop control. Each capability is opt-in — use the parts that fit, leave the rest.

Native LLM Providers

Direct bindings for OpenAI, Anthropic, Azure, Bedrock, Vertex, and any OpenAI-compatible endpoint — with normalised token accounting and no LangChain dependency.

Message-First Runtime

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

Reasoning & Reflection

Provider-native reasoning (OpenAI Responses, Anthropic thinking, Vertex thoughts) paired with post-tool reflection you can route to memory or the plan.

Planning (TODO)

Structures agent workflows through a managed TODO plan with configurable replanning on failure.

Pause / Resume & HITL

Snapshot and restore agent state, gate sensitive tools behind approval, and ask the user structured questions mid-run.

Summarisation

Compresses long context with token-aware rewriting while keeping full tool payloads retrievable on demand.

Guardrails

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

Structured Output

Supply a Zod schema and the runtime returns validated, fully typed JSON via a hidden finalize tool.

Multi-Agent & Tracing

Compose agents as tools or explicit handoffs, with structured traces streamed to file, HTTP, OTLP, or Cognipeer sinks.

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