Cognipeer Agent SDK

Deterministic TypeScript Agent Runtime

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.

Key Features

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.

Architecture

A deterministic while-loop — no external graph runtime. Each turn flows through these stages:

1. Resolver

Normalize state (messages, counters, limits)

2. Context Summarize

Archive heavy tool outputs when token estimates exceed limit

3. Agent

Invoke the model (binding tools when supported)

4. Tools

Execute proposed tool calls with configurable parallelism

Quick Start

import { createSmartAgent, createTool, fromLangchainModel } from "@cognipeer/agent-sdk";
import { ChatOpenAI } from "@langchain/openai";
import { z } from "zod";

const echo = createTool({
  name: "echo",
  description: "Echo back user text",
  schema: z.object({ text: z.string().min(1) }),
  func: async ({ text }) => ({ echoed: text })
});

const model = fromLangchainModel(new ChatOpenAI({
  model: "gpt-4o-mini",
  apiKey: process.env.OPENAI_API_KEY,
}));

const agent = createSmartAgent({
  name: "ResearchHelper",
  model,
  tools: [echo],
  useTodoList: true,
  limits: { maxToolCalls: 5, maxToken: 8000 },
  tracing: { enabled: true },
});

const result = await agent.invoke({
  messages: [{ role: "user", content: "plan a greeting and send it" }],
  toolHistory: [],
});

Cognipeer Agent SDK vs Alternatives

ProductPrimary RoleDeterministic RuntimePlanningSummarisationGuardrailsInterruptPause / ContinueHuman-in-the-LoopMulti-AgentStructured Output

Cognipeer Agent SDK

Deterministic Agent Runtime

LangChain (JS)

LLM Framework

LangGraph

Graph-based Agent Runtime

OpenAI Assistants API

Managed Agent Runtime

CrewAI

Multi-Agent Framework

Microsoft Autogen

Multi-Agent Framework