Skip to content
项目

关于

AI agents that survive production. Self-hosted TypeScript runtime: multi-provider LLMs, tools with approvals, memory & RAG, durable workflows, multi-agent swarms, sandboxed execution, MCP and A2A.

编程语言与运行时

这些数字如何统计

可以做什么

  • Agents that work as a team. Eight swarm strategies (hierarchy, round-robin, consensus, pipeline, debate, auction, negotiation, and agent teams with a shared task board and mailboxes), handoffs and agents as tools, plus DAG workflows with human approval, sagas and map-reduce.
  • Rules you can read, decisions you can audit. Claude Code compatible allow, ask and deny rules from .claude/settings.json, permission modes from plan to bypass, an auto mode with a classifier model, every decision in the thread's log, and session budgets that pause a run instead of failing it.
  • Subagents and commands, as your repository already has them. .claude/agents/*.md subagents behind one agent tool, with tool lists, models, permission modes that only narrow, approvals that bubble up through nested checkpoints, background runs continued by id and git worktree isolation, and .claude/commands/*.md templates expanded from /name args.
  • Hooks and project instructions, as your repository already has them. The hooks of Claude Code's settings.json (commands, HTTP endpoints, model prompts, MCP tools) run before and after tool calls, at session start and when the agent would stop, and AGENTS.md and CLAUDE.md load into the system prompt with their imports and path-scoped rules.

实测星标增长

24小时
0
7天
0
15天
+1
1个月
+1

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

Cogitator

Cogitator

Self-hosted agents, swarms and workflows in TypeScript.

Built for engineers who trust their agents to run while they sleep.

License: MIT TypeScript Node npm npm downloads CI

Quick Start · Examples · Docs · Cookbook · Discussions

Coding agents can read the docs as Markdown: cogitator.app/llms.txt (index) and cogitator.app/llms-full.txt (everything in one file).



What is Cogitator?

Cogitator is a TypeScript runtime for LLM agents that runs on your own infrastructure. Start with one agent and a couple of tools, then grow into multi-agent swarms, durable workflows and agents served over HTTP, MCP or A2A, with the same Agent, tool() and Cogitator you started with.

It works with 12 providers, from OpenAI, Anthropic and Google to local models through Ollama, and @cogitator-ai/core has 7 dependencies.

import { Cogitator, Agent, tool } from '@cogitator-ai/core';
import { z } from 'zod';

const weather = tool({
  name: 'get_weather',
  description: 'Get current weather for a city',
  parameters: z.object({ city: z.string() }),
  execute: async ({ city }) => `${city}: 22°C, sunny`,
});

const agent = new Agent({
  name: 'assistant',
  model: 'google/gemini-3.8-flash', // free tier, no credit card
  instructions: 'You help people with questions. Use tools when needed.',
  tools: [weather],
});

const cog = new Cogitator({
  llm: {
    providers: {
      google: { apiKey: process.env.GOOGLE_API_KEY! },
    },
  },
});
const result = await cog.run(agent, { input: 'What is the weather in Tokyo?' });
console.log(result.output);

Tools are typed with Zod: the model sees a JSON Schema, and execute gets validated arguments. Change the model string to switch providers, nothing else changes.


Quick Start

Option A - scaffold a project:

npx create-cogitator-app my-agents
cd my-agents && npm run dev
npm run dev:studio     # Cogitator Studio: chat, traces and costs, approvals, workflows, forks
  • 16 presets: agent, personal assistant, memory, Express, Hono or Tetsu API, Next.js chat, messaging bot, RAG, MCP, swarm, workflow, durable workflow, A2A, realtime voice and evals. Or start from any example in this repository (--example core/basic-agent) or from a GitHub template.
  • Services handled: with Docker running, it starts Postgres, Redis and the Ollama model the stack needs and waits until they are healthy. Without Docker, the first run tells you what is missing (ollama pull, or a key in .env).
  • Ready for coding agents: every project has a registry of its agents, tests on a mocked model, an AGENTS.md and the docs bundled for Claude Code, Cursor and Codex.
  • Grows with you: npx cogitator add rag (or MCP, workflows, evals, memory, deploy) adds a feature later and merges with your edits.

Option B - add to an existing project:

pnpm add @cogitator-ai/core zod

Set GOOGLE_API_KEY in your .env (get one free here) and run any example:

npx tsx examples/core/01-basic-agent.ts

Works with any LLM: swap google/gemini-3.8-flash for openai/gpt-6.1-sol, anthropic/claude-sonnet-5-5, ollama/llama3.3, or any other of the 12 built-in providers.


Highlights

  • A coding agent in one call. createHarnessAgent() assembles a workspace with file tools and a shell, a todo list, SKILL.md skills, Markdown subagents and commands, AGENTS.md, the permission engine, compaction, long tool results saved as files, tool_search for many tools and parallel read-only calls. Presets coding and assistant, every piece overridable, the result plain values you can read.
  • Agents that work as a team. Eight swarm strategies (hierarchy, round-robin, consensus, pipeline, debate, auction, negotiation, and agent teams with a shared task board and mailboxes), handoffs and agents as tools, plus DAG workflows with human approval, sagas and map-reduce.
  • Workflows and agent runs that outlive the process. Checkpoints, approvals and timers live in Redis or Postgres, so a workflow resumes from its last checkpoint after a restart or on another machine. Durable agent runs keep a checkpoint after every step, and recoverRuns() continues them on another process without running a finished tool twice. File checkpoints snapshot the workspace before every message, so rewind() takes the conversation, memory and files back to an earlier message in one operation. Streams resume too: a client that loses the connection reconnects with Last-Event-ID and gets what it missed.
  • Rules you can read, decisions you can audit. Claude Code compatible allow, ask and deny rules from .claude/settings.json, permission modes from plan to bypass, an auto mode with a classifier model, every decision in the thread's log, and session budgets that pause a run instead of failing it.
  • Local commands inside the operating system's sandbox. OsSandbox runs a workspace's commands under Seatbelt on macOS or bubblewrap on Linux: writes only in the workspace, reads everywhere but what you deny, network only through a proxy that checks each host, settings, hooks and git config out of reach. It reads the sandbox section of .claude/settings.json as it is, and a sandboxed command runs without an approval. delete_file moves files to the workspace trash, and removing a critical path always asks.
  • Subagents and commands, as your repository already has them. .claude/agents/*.md subagents behind one agent tool, with tool lists, models, permission modes that only narrow, approvals that bubble up through nested checkpoints, background runs continued by id and git worktree isolation, and .claude/commands/*.md templates expanded from /name args.
  • Plugins, in Claude Code's format (experimental). A Claude Code plugin with its skills, commands, agents, hooks and .mcp.json loads unchanged, a Cogitator manifest adds code that runs in a process of its own under a permissions manifest the permission engine enforces, secrets in the system keychain and Studio panels. Generations reload without breaking what works, dependencies load in order, and cogitator plugin installs from marketplaces, npm and git pinned to the exact commit or integrity, and runs plugin evals.
  • Routines that start themselves (experimental). A saved task on an agent or a workflow runs on a cron schedule in any time zone, on an API call with its own token, or on a signed webhook, GitHub delivery, inbound mail or Slack event. What the event brings reaches the model as untrusted data after the task, each firing starts exactly one run however often it is delivered, and results, failures and approvals land in an inbox you read in Studio, the CLI, a chat or a webhook. Agents schedule themselves too, and every scheduler of the runtime now runs on one core.
  • Hooks and project instructions, as your repository already has them. The hooks of Claude Code's settings.json (commands, HTTP endpoints, model prompts, MCP tools) run before and after tool calls, at session start and when the agent would stop, and AGENTS.md and CLAUDE.md load into the system prompt with their imports and path-scoped rules.
  • Untrusted code, contained. Docker and WASM sandboxes with resource limits, and 18 pre-built WASM tools for hashing, parsing, conversions and more.
  • A debugger, not just logs. Cogitator Studio shows the trace and cost of every run, lets you approve tool calls, rerun a workflow from a node and fork a run from any step. Traces also export to OpenTelemetry and Langfuse.
  • Memory that keeps its sources. Six storage backends, BM25 plus vector hybrid search, knowledge graphs, and facts extracted from conversations, each tied to the quote it came from. Forget or redact a turn and what memory made of it goes too. With embeddings, every turn recalls the earlier turns and memory items it needs by default, chosen on seven long-memory benchmarks.
  • Speaks the protocols. MCP as client and server (2026-07-28 with multi round-trip requests, tasks, OAuth and MCP Apps, and 2025-11-25), Google's A2A in both directions, AG-UI for CopilotKit and other agent frontends, an OpenAI-compatible API, and adapters for Express, Fastify, Hono, Koa, Next.js and Tetsu.
  • More than prompting. Prolog-style logic and Z3/SAT solving for verifiable plans, tree-of-thought and causal reasoning.

What Can You Build?

Use Case What happens Try it
Chatbot with memory Agent remembers your name, preferences, past conversations examples/memory/01-basic-memory.ts
Research assistant Agent uses tools, reasons step by step, returns structured answers examples/core/01-basic-agent.ts
Content pipeline Researcher → Writer → Editor, each agent builds on the previous examples/swarms/02-pipeline-swarm.ts
Dev team simulation Manager delegates frontend/backend to specialists, synthesizes results examples/swarms/03-hierarchical-swarm.ts
REST API server Mount agents as HTTP endpoints with Swagger, SSE streaming, WebSocket examples/integrations/01-express-server.ts
Multi-user support agent One agent serves many users through your own MCP server, each with their own token and threads examples/mcp/03-per-user-mcp.ts
Data processing workflow Analyze documents in parallel, aggregate with map-reduce examples/workflows/03-map-reduce.ts
Knowledge graph Extract entities from text, build a graph, traverse relationships examples/memory/04-knowledge-graph.ts
Agent that keeps notes Agent writes notes under /memories it reads in later conversations, searches old turns and cites them examples/memory/05-memory-files.ts
Agent that learns between runs Memory tidies itself in the background: repeats go stale, lessons become playbook rules, facts become observations examples/memory/06-memory-upkeep.ts
Agent that forgets on request Forget or redact a turn, a thread or a user, and the summaries, facts and notes memory made of them go with it examples/memory/07-forget-and-redact.ts
Agent with skills Agent finds SKILL.md skills, loads one when a task needs it, plans with a todo list and searches for tools it lacks examples/core/23-skills-and-todos.ts
Agent you can steer mid-run Steer or follow up a run going on, a tool that pauses to ask a person, a second message that interrupts the first examples/core/24-run-control.ts
Agent with fast, visible tools Safe tool calls run together, a write runs alone, tools report progress and rich results, calls stream as the model writes them examples/core/25-tool-execution.ts
Agent with guard rails you set Claude Code compatible allow, ask and deny rules, plan mode before edits, an audit log, session budgets that pause the run examples/core/26-permissions.ts
Repository that guards itself Claude Code hooks from .claude/settings.json refuse a push to main, AGENTS.md lands in the system prompt examples/core/27-hooks.ts
Lead with specialist subagents .claude/agents reviewers and releasers behind one agent tool, an approval that bubbles up, a /review command examples/core/28-subagents.ts
Coding agent in one call createHarnessAgent() puts workspace tools, a shell, todos, skills, subagents, AGENTS.md and approvals together, fixes a bug examples/core/29-harness-agent.ts
Agent that survives a crash A run killed with SIGKILL mid-tool is recovered by another process from its last step, the lost call reported, not repeated examples/core/30-durable-runs.ts
Undo for an agent's edits Each message takes a file checkpoint, a rewind brings back conversation, memory and files, a fork takes files along examples/core/31-rewind.ts
Claude Code plugins, hot loaded Loads a Claude Code plugin unchanged, runs plugin code in its own process under a permissions manifest, reloads by generation examples/core/32-plugins.ts
Routines on schedules and webhooks A cron routine, an API call with an injection that stays data, a signed GitHub delivery delivered twice and started once, an inbox examples/core/33-triggers.ts
Agent team on a task board A lead plans tasks, members claim them, work concurrently and talk through mailboxes, live in Studio examples/swarms/05-agent-team.ts
RAG Q&A system Load docs, chunk, embed, retrieve relevant context, answer questions examples/rag/01-basic-retrieval.ts
Agent evaluation Measure accuracy, compare models, run A/B tests with LLM judges examples/evals/01-basic-eval.ts
Personal AI assistant Your own AI running 24/7 on Telegram, Discord, Slack, Bluesky, Threads, GitHub, email, Teams - manage via chat commands cogitator.yml config
Cross-framework agents Expose your agent via Google's A2A protocol, consume external agents examples/a2a/01-a2a-server.ts
Agent UI with CopilotKit Serve an agent to AG-UI frontends: streamed text, subagents, shared state, interrupts examples/agui/01-agui-server.ts


How It Compares

Cogitator Mastra LangChain.js + LangGraph.js Vercel AI SDK OpenAI Agents SDK
License MIT Apache-2.0, ee/ parts need a license MIT Apache-2.0 MIT
Core dependencies 7 30 7 (@langchain/core) 3 4
LLM providers 12 built in, Ollama included 220 through a model router 30+ provider packages 45+ first-party packages OpenAI, others through adapters
Multi-agent 8 swarm strategies, agent teams, Markdown subagents, handoffs Supervisor, A2A subagents Supervisor and swarm packages, handoffs Subagents as tools, recipes Handoffs, agents as tools
Durable workflows DAG with Redis or Postgres checkpoints, approvals, sagas Graph workflows, snapshots, Inngest/Temporal Graphs with checkpointers, human-in-the-loop WorkflowAgent on Workflow DevKit Resumable run state, no graphs
Memory and RAG 6 backends, hybrid search, knowledge graphs, RAG pipeline About 20 stores, semantic recall, RAG Checkpoint memory, long-term store, 40+ loaders Embeddings, no memory store Sessions, hosted file search
MCP / A2A Client and server / both ways Client and server / both ways Client / in hosted Agent Server Client / community provider Client / no
Code sandbox Docker, WASM and native, built in Local OS isolation, Docker via integrations Hosted sandboxes only In-memory bash, hosted Docker, hosted
Local debugger Cogitator Studio, no account Mastra Studio Studio, needs a LangSmith key DevTools viewer No, traces go to OpenAI
Evals Built in Built in openevals, the rest in LangSmith No Hosted on the OpenAI platform
Messaging channels Telegram, Discord, Slack, WhatsApp, WebChat, Bluesky, Threads, GitHub, email, Microsoft Teams 8 through Vercel Chat SDK No Separate Chat SDK No

Checked against each project's docs and npm on 2026-10-22. Something out of date? Open an issue.

Every project here is good at something. Reach for LangChain for the widest integration catalog, the AI SDK for streaming UIs, the OpenAI Agents SDK for OpenAI's realtime voice, and Mastra for the broadest provider coverage and an optional hosted platform. Cogitator is for teams that want the whole stack in one self-hosted, MIT-licensed runtime with a small core, with swarm strategies, sandboxes and a debugger included.


Packages

Install only what you need. Everything is a separate npm package.

Package What it does Example
@cogitator-ai/core Agents, tools, LLM backends, streaming, everything you need to start 26 core examples
@cogitator-ai/memory Your agents remember things. Redis, Postgres, SQLite, MongoDB, Qdrant, in-memory 7 memory examples
@cogitator-ai/models Dynamic model registry with pricing, capabilities, provider metadata model registry example
@cogitator-ai/swarms 8 swarm strategies - hierarchy, round-robin, consensus, pipeline, debate, auction, negotiation, team 5 swarm examples
@cogitator-ai/workflows DAG workflows with branching, human approval gates, map-reduce 3 workflow examples
@cogitator-ai/a2a Google's Agent-to-Agent protocol - expose agents as services, consume external ones 3 a2a examples
@cogitator-ai/app-server Typed JSON-RPC app-server on stdio: threads, turns, steering, approvals, reviews, with a generated client app-server client
@cogitator-ai/acp Agent Client Protocol both ways: Cogitator agents in Zed, JetBrains, Neovim and VS Code (cogitator acp), Claude Code, Codex and Gemini CLI as agents of an app-server 2 acp examples
@cogitator-ai/bridge Agent bridge (experimental): Claude Code, Codex and agents on any model hand each other jobs, ask questions and report back, each in its own window (cogitator bridge) bridge example
@cogitator-ai/mcp Connect to any MCP server and use its tools 7 mcp examples
@cogitator-ai/sandbox Run untrusted code in Docker, WASM or the OS sandbox (Seatbelt, bubblewrap), agent workspaces in Docker, E2B, Daytona or Vercel Sandbox sandbox example
@cogitator-ai/wasm-tools 18 pre-built tools running in WASM sandbox (calc, json, hash, csv, markdown...) wasm example
@cogitator-ai/self-modifying Agents that generate new tools at runtime and evolve their own architecture self-modifying example
@cogitator-ai/neuro-symbolic Prolog-style logic, constraint solving, knowledge graphs for agents neuro-symbolic example
@cogitator-ai/rag RAG pipeline - document loaders, chunking, retrieval, reranking 3 rag examples
@cogitator-ai/evals Evaluation framework - metrics, LLM judges, A/B testing, assertions, agent tool calls, retrieval and experiment tracking 5 eval examples
@cogitator-ai/voice Voice/Realtime agent capabilities - STT, TTS, VAD, replies spoken while generated, realtime sessions, Twilio phone calls 5 voice examples
@cogitator-ai/browser Browser automation - Playwright, stealth, vision, network control 4 browser examples
@cogitator-ai/deploy Deploy your agents to Docker or Fly.io deploy example
@cogitator-ai/channels Personal AI assistant on Telegram, Discord, Slack, WhatsApp, Bluesky, Threads, GitHub, email, Microsoft Teams, posts to social feeds 8 channel examples
@cogitator-ai/cli cogitator init / add / dev / mcp / doctor / eval / up / deploy, headless run -p CLI workflows
@cogitator-ai/studio Cogitator Studio: chat with agents, traces and costs, approvals, workflow reruns, forks studio guide
@cogitator-ai/test-utils Mock LLM backends, fixtures, helpers and a conformance kit for LLM backends testing example

Server adapters - mount agents as REST APIs with one line:

express · fastify · hono · koa · tetsu · next · ai-sdk · openai-compat

Every adapter comes with Swagger docs, SSE streaming and WebSockets, and shares one protocol from server-shared: the same request validation, response shape and stream events, held to one conformance suite. Clients cannot set system-prompt context or add system thread messages unless the server allows it (acceptContext, threadMessageRoles), and non-JSON bodies are refused with 415. See the integration examples.


Run an Assistant from a YAML File

Run an assistant around the clock on Telegram, Discord, Slack or WhatsApp from one cogitator.yml, then move to the TypeScript API when you outgrow it.

cogitator wizard

The interactive wizard walks you through everything: LLM provider, model, channels, capabilities, memory, MCP servers. It generates a cogitator.yml:

name: Jarvis
personality: 'You are Jarvis, a sharp personal assistant.'
llm:
  provider: google
  model: gemini-3.8-flash
channels:
  telegram:
    ownerIds: ['YOUR_TG_ID']
capabilities:
  webSearch: true
  fileSystem:
    paths: [~/Documents, ~/Projects]
  scheduler: true
  browser: true
memory:
  adapter: sqlite
  path: ~/.cogitator/memory.db
  compaction:
    threshold: 50
stream:
  flushInterval: 600
  minChunkSize: 30

The wizard asks your name, picks channels, configures capabilities, and writes everything to cogitator.yml + .env. Then start it:

cogitator up                    # foreground with live dashboard
cogitator daemon start          # background process (logs in .cogitator/)
cogitator daemon install        # user service with restart on crash (systemd/launchd)

You can also use cogitator init to scaffold a full project with package.json, TypeScript config, and source files if you prefer the programmatic API over YAML.

Manage it from the chat, no web dashboard needed:

Command What it does
/status Uptime, model, sessions, messages today
/sessions Recent conversations
/model gpt-6.1-sol Switch model on the fly (or per user)
/pair ABC123 Approve a new user
/users Owners and approved users
/compact Compress conversation history
/restart Restart the assistant
/help All available commands

What you get out of the box:

  • Multi-channel: same assistant on Telegram + Discord + Slack + WhatsApp simultaneously
  • Streaming: real-time typing with chunked message editing
  • Voice messages: automatic STT via Deepgram, Groq, OpenAI, or local Whisper
  • Image understanding: photos sent to the bot are analyzed via vision
  • Access control: owner/authorized/public levels, pairing codes for new users
  • Scheduled tasks: "remind me in 2 hours" with cron/interval/one-shot support
  • Memory: persistent conversations with auto-compaction and knowledge graphs
  • Lifecycle hooks: 12 event points for logging, analytics, custom behavior
  • Skills: extend with tool bundles (cogitator skill add)
  • MCP servers: connect any Model Context Protocol tool server

See @cogitator-ai/channels README for the full programmatic API and @cogitator-ai/cli for all CLI commands.


Features at a Glance

Click a category to expand it.

LLM & Models
Feature What it means
Any provider OpenAI, Anthropic, Google, Ollama, vLLM, Azure, Bedrock, Mistral, Groq, Together, DeepSeek, OpenRouter
Structured outputs JSON mode and JSON Schema validation across all providers
Vision & audio Send images, transcribe audio, generate speech
Cost-aware routing Auto-pick cheap models for easy tasks, expensive for hard ones
Cost prediction Know how much a run will cost before you execute it
Fallback models When a provider fails, the turn moves to the next model behind a circuit breaker, the run goes on
Typed tool deps Hand tools a DB client or the signed-in user per run, type-checked and never shown to the model
Memory & Knowledge
Feature What it means
6 storage backends Redis, Postgres, SQLite, MongoDB, Qdrant, in-memory
Semantic search BM25 + vector hybrid search with Reciprocal Rank Fusion
Knowledge graphs Extract entities, build graphs, traverse multi-hop relationships
Memory items Facts extracted after each run, tied to the quote they came from and to when they held
Memory files Notes an agent keeps under /memories with the memory tool, native on Claude, every edit a version
Memory search tools The agent searches old turns and memory items itself and cites only what it opened
Pre-turn brief A cheap model reads what memory found and hands the turn a few cards, each quoting its source
Consolidation Between runs memory marks repeats stale, folds lessons into a playbook and writes observations of entities
Forget and redact Delete or redact a turn, a thread or a user, and every summary, item, fact and file that stands on them goes too
RAG pipeline Document loaders, smart chunking, hybrid retrieval, reranking
Context management Auto-compress long conversations to fit model limits
Multi-Agent
Feature What it means
8 swarm strategies Hierarchical, consensus, round-robin, auction, pipeline, debate, negotiation, team
DAG workflows Build pipelines with branching, retries, compensation, human approval
A2A Protocol Google's standard for agents talking to agents across frameworks
Agent-as-Tool Use one agent as a tool for another - simple delegation
Messaging Channels
Feature What it means
10 platforms Telegram, Discord, Slack, WhatsApp, WebChat, Bluesky, Threads, GitHub, email, Microsoft Teams: one agent everywhere
YAML config + CLI cogitator.yml + cogitator up - personal assistant without writing code
Gateway routing Sessions, streaming, middleware, media processing through one unified entry point
Owner commands Manage your assistant from chat - /status, /model, /pair, /compact
Access control DM policy with 4 modes (open, allowlist, pairing, disabled) + authorization levels
Media processing Photos → vision, voice → STT (Deepgram, Groq, OpenAI, local Whisper)
Streaming Real-time message editing with smart chunking and platform-aware splitting
Status reactions Emoji progress indicators (queued → thinking → tool → done) on user messages
Lifecycle hooks 12 event points for logging, analytics, and custom behavior
Scheduler Cron (time zones, presets, 6 fields), interval and one-shot jobs on the core scheduler, with retries and backoff
Daemon mode Run as system service with cogitator daemon install (systemd/launchd)
Safety & Security
Feature What it means
Constitutional AI Auto-filter harmful inputs/outputs with critique-revision loops
Prompt injection detection Catch jailbreaks, DAN attacks, encoding tricks
PII masking Emails, cards, keys and the like never reach the model provider
Sandboxed execution Docker and WASM isolation for untrusted code
Workspaces Files and commands confined to one directory, local or Docker, local commands under Seatbelt or bubblewrap, a trash to restore from
Tool guards Block dangerous commands, validate paths, require approval
Run middleware Hooks around every model and tool call, tripwires stop a run
Advanced
Feature What it means
Self-modifying agents Agents detect missing capabilities and generate new tools at runtime
Tree of Thoughts Explore multiple reasoning paths with backtracking
Causal reasoning Pearl's Ladder - association, intervention, counterfactuals
Self-reflection Agents learn from their actions and improve over time
Agent optimizer DSPy-style instruction tuning from execution traces
Time-travel debugging Checkpoint, replay, fork agent executions like git bisect
Neuro-symbolic Prolog engine, Z3/SAT solving, graph queries, verified plans
Developer Experience
Feature What it means
OpenTelemetry Full tracing to Jaeger, Grafana, Datadog
Langfuse LLM-native tracing of runs, generations and tools
Prompt versions Deploy, roll back and A/B test agent instructions
Tool caching Cache tool results (exact or semantic matching)
Agent serialization Save agents to JSON, restore later
Debug mode Full request/response logging for LLM calls
Evals framework Metrics, LLM judges, A/B testing, assertions
Plugins Claude Code plugins load unchanged, isolated code, marketplaces, cogitator plugin
Routines and inbox Cron, API, webhook, GitHub, email and Slack triggers, results in an inbox
Cogitator Studio Local debugger: chat, traces with costs, approvals, workflow reruns, time-travel forks
cogitator add Add RAG, MCP, workflows, evals, memory or deploy to a project, merging your edits
Agent-ready projects AGENTS.md, bundled docs and an MCP server for Claude Code, Cursor and Codex

128 Runnable Examples

Every major feature has a working example you can run right now.

npx tsx examples/core/01-basic-agent.ts
All example folders
Category Count What you'll learn
core/ 33 Agents, tools, streaming, caching, tree-of-thought, reflection, optimization, time-travel, cost routing, constitutional AI, prompt injection, causal reasoning, approvals, handoffs, decision models, provider errors and pricing, the tool contract, fallback models, tool deps, run middleware, workspaces, SKILL.md skills with todos and tool search, steering runs, tool interrupts and double-texting, tool execution, permissions and budgets, hooks and project instructions, subagents and commands, harness agents, durable runs, rewind, plugins, triggers and the inbox
memory/ 7 In-memory storage, context building, semantic search, knowledge graphs, memory files and memory search tools, memory between runs, forgetting and redacting
swarms/ 5 Debate, pipeline, hierarchical coordination, negotiation, agent teams
workflows/ 3 DAG workflows, human-in-the-loop, map-reduce
a2a/ 3 A2A server and client, A2A 1.0 REST
agui/ 1 An AG-UI client against the /agents/:name/agui route: events, an interrupt and its resume, shared state
app-server/ 1 The generated client of the JSON-RPC app-server, in the process or over cogitator app-server
acp/ 2 An editor driving a Cogitator agent over ACP, and an external ACP agent next to a native one, its permissions decided by the rules
bridge/ 11 The agent bridge: a job between two sessions (inbox, question and answer, limits, verification, the journal) a job for an agent the bridge hosts, the tools Claude Code and Codex call the bridge with, leave for a call decided by the project's rules, an agent or the person, a job in a git worktree of its own with its checks and its work taken back, the context a job is handed over with and the board of notes agents share, a recipe that has a job done, reviewed by another agent and fixed, a debate of agents on a question, a plan two agents write apart and settle on together, the scoreboard that says who a job should go to, and the agents of the bridge offered as an A2A service and as MCP tools
mcp/ 7 MCP client and server integration, per-user tokens, agents as MCP servers, rounds, tasks and OAuth of MCP 2026-07-28, MCP Apps
rag/ 3 Basic retrieval, chunking strategies, agent with RAG
evals/ 5 Basic evaluation, LLM judge, A/B comparison, agent eval with tool calls, turns and pass@k, experiment tracking with run files and reports
testing/ 1 Mock LLM backend, scripted tool calls, request inspection with no API keys
voice/ 5 Voice pipeline, realtime sessions, voice agents, a phone agent
browser/ 4 Web scraping, form automation, stealth agents, crypto price scraper
integrations/ 10 Express, Fastify, Hono, Koa, Next.js, OpenAI compat, AI SDK, Tetsu on Bun, Deno, Cloudflare Workers
infrastructure/ 8 Redis, PostgreSQL, job queues, Docker deploy, sandbox execution, workspaces in E2B, Daytona and Vercel sandboxes, local commands under Seatbelt or bubblewrap
channels/ 8 Telegram assistant, multi-channel super-assistant, WebChat bot, social feed publisher, Bluesky and Threads bot, GitHub issue and review bot, email bot that answers in the thread, Microsoft Teams bot
device-tools/ 6 Local screenshots, clipboard, notifications, URL opening, shell execution, device skill setup
create-cogitator-app/ 1 Programmatic project scaffolding
config/ 1 YAML configuration, environment variable overrides, runtime initialization
advanced/ 3 Self-modifying agents, neuro-symbolic reasoning, WASM tools

The cli/ folder adds step-by-step cogitator CLI walkthroughs on top of these.

The examples run on Google Gemini 3.5 Flash-Lite (google/gemini-3.5-flash-lite), free tier, no credit card. They make many calls in a row, and Flash-Lite is cheaper and answers more reliably under load than Gemini 3.8 Flash. See examples/README.md for setup.


Contributing

# Fork on GitHub, then:
git clone https://github.com/YOUR_USERNAME/Cogitator-AI.git
cd Cogitator-AI && pnpm install && pnpm dev

See CONTRIBUTING.md for guidelines.

Contributors

Thanks to everyone who has contributed to Cogitator!

Want to join them? Pick an issue labeled good first issue or help wanted.


All npm packages
Package Description Version
@cogitator-ai/core Core runtime (Agent, Tool, Cogitator) npm
create-cogitator-app Interactive project scaffolding (npx create-cogitator-app) npm
@cogitator-ai/cli CLI tool (cogitator init/add/dev/mcp/doctor/eval/up/deploy) npm
@cogitator-ai/studio Cogitator Studio, the local debugger (cogitator dev) npm
@cogitator-ai/types Shared TypeScript interfaces npm
@cogitator-ai/config Configuration management npm
@cogitator-ai/memory Memory adapters (Postgres, Redis, SQLite, MongoDB, Qdrant) npm
@cogitator-ai/models Dynamic model registry with pricing npm
@cogitator-ai/workflows DAG-based workflow engine npm
@cogitator-ai/swarms Multi-agent swarm coordination npm
@cogitator-ai/mcp MCP (Model Context Protocol) support npm
@cogitator-ai/a2a A2A Protocol 1.0 and 0.3 - cross-agent interoperability over JSON-RPC and REST npm
@cogitator-ai/app-server Typed JSON-RPC app-server: threads, turns, reviews over stdio npm
@cogitator-ai/acp Agent Client Protocol: agents for editors, external agents as providers npm
@cogitator-ai/bridge Agent bridge: Claude Code, Codex and hosted agents hand each other jobs (experimental) npm
@cogitator-ai/sandbox Docker/WASM sandboxed execution npm
@cogitator-ai/redis Redis client (standalone + cluster) npm
@cogitator-ai/worker Distributed job queue (BullMQ) npm
@cogitator-ai/openai-compat OpenAI-compatible server: Chat Completions, Responses npm
@cogitator-ai/wasm-tools WASM-based sandboxed tools (18 built-in) npm
@cogitator-ai/self-modifying Self-modifying agents with meta-reasoning npm
@cogitator-ai/neuro-symbolic Neuro-symbolic reasoning with SAT/SMT npm
@cogitator-ai/rag RAG pipeline with loaders, chunking, retrieval, reranking npm
@cogitator-ai/evals Evaluation framework with metrics, A/B testing, assertions npm
@cogitator-ai/voice Voice/Realtime agents (STT, TTS, VAD, realtime sessions) npm
@cogitator-ai/browser Browser automation (Playwright, stealth, vision, 33 tools) npm
@cogitator-ai/next Next.js App Router integration npm
@cogitator-ai/ai-sdk Vercel AI SDK adapter (bidirectional) npm
@cogitator-ai/express Express.js REST API server npm
@cogitator-ai/fastify Fastify REST API server npm
@cogitator-ai/hono Hono multi-runtime server (Edge, Bun, Deno, Node.js) npm
@cogitator-ai/koa Koa middleware-based server npm
@cogitator-ai/tetsu Tetsu controller on Bun (SSE, WebSocket, OpenAPI) npm
@cogitator-ai/deploy Deployment engine (Docker, Fly.io) npm
@cogitator-ai/channels Messaging channels (GitHub, email and Microsoft Teams too) and social feeds (Bluesky, Threads) npm
@cogitator-ai/server-shared Shared protocol, validation, conformance for server adapters npm
@cogitator-ai/test-utils Testing utilities: mocks, fixtures, backend conformance kit npm

Not published to npm: packages/dashboard (the cogitator.app website: landing, docs, cookbook), packages/e2e (end-to-end test suite) and packages/gauntlet (integration proving ground that runs every package together on real models).


Security

Found a vulnerability? Please don't open a public issue, report it privately so it can be fixed before it is disclosed.

Report a vulnerability

See SECURITY.md for what to include and how reports are handled.


License

MIT - see LICENSE.


Built for engineers who trust their agents to run while they sleep.

Star on GitHub · Docs · Discussions

探索相关项目

加载中…