Cogitator
Getting Started

Installation

Install Cogitator and set up your development environment.

Prerequisites

  • Node.js 22.12+ — Download
  • pnpm (recommended) — npm install -g pnpm; npm, yarn and bun work too
  • Docker (optional) — for Redis, Postgres and sandboxed execution
  • Ollama (for local LLMs) — Download, or use a hosted provider such as OpenAI, Anthropic or Google
node --version    # v22.12.0 or higher

Scaffolding a Project

The fastest way to start is the project scaffolder. It generates the project and installs its dependencies:

npx create-cogitator-app my-agent
cd my-agent
npm run dev

create-cogitator-app asks what to build, or takes it from flags. It starts from one of 16 presets:

PresetWhat you get
basicOne agent with real tools in your terminal
assistantWorkspace files with approvals, long-term memory, a scheduler and evals
memoryConversations that survive restarts, in SQLite
api-serverExpress with Swagger UI, token auth and persistent threads
honoAgents behind a small, fast HTTP API
tetsuBun-native controller with OpenAPI and WebSocket
nextjsStreaming chat with tool calls, approvals and saved threads
channelsOne assistant on Telegram, Discord, Slack, WebChat, Bluesky, Threads, GitHub, email or Microsoft Teams
ragAnswers grounded in the files of docs/
mcpTools from an MCP server, your agents served over MCP
swarmA researcher and a writer under a reviewing supervisor
workflowA multi-step pipeline of agents
durable-workflowA saga with compensation, an approval step and crash recovery
a2aAn agent other frameworks call over the Agent-to-Agent protocol
voice-realtimeSpeech in, speech out over WebSocket
evalsMeasure an agent on a dataset and gate CI on the score

Pass flags to skip the prompts, or pick the stack yourself:

npx create-cogitator-app my-agent --preset swarm --provider openai --pm pnpm
npx create-cogitator-app my-api --app server --server fastify --memory postgres --features rag,evals --yes

Then npm run dev:studio opens Cogitator Studio to chat with the agents and read their traces, and npx cogitator add <feature> adds more later.

See Project Scaffolding for every flag. For a config-driven personal assistant with Telegram, Discord or Slack, use the CLI (cogitator wizard or cogitator init) instead.

Manual Installation

Add Cogitator to an existing project:

pnpm add @cogitator-ai/core zod

Optional packages depending on your needs:

# Memory adapters (Redis, Postgres, SQLite, MongoDB, Qdrant)
pnpm add @cogitator-ai/memory

# RAG pipeline
pnpm add @cogitator-ai/rag

# Multi-agent swarms
pnpm add @cogitator-ai/swarms

# Workflow orchestration
pnpm add @cogitator-ai/workflows

# Server adapters
pnpm add @cogitator-ai/express    # or fastify, hono, koa, tetsu, next

# cogitator.yml and environment loading
pnpm add @cogitator-ai/config

# MCP protocol
pnpm add @cogitator-ai/mcp

Some providers and adapters load optional peer dependencies on demand: @aws-sdk/client-bedrock-runtime for Bedrock, pg for Postgres, better-sqlite3 for SQLite, @cogitator-ai/sandbox for sandboxed tools, langfuse for the Langfuse exporter.

Docker Services

Projects scaffolded with Docker Compose (the default answer, or --docker) get a docker-compose.yml with:

  • Redis (port 6379) - short-term memory, pub/sub, job queues, when Redis memory or the queue worker needs it
  • Postgres (port 5432) - long-term memory (user, password and database cogitator unless POSTGRES_* variables are set), with Postgres memory or the pgvector store
  • Ollama (port 11434) - local LLM inference, only when Ollama is the chosen provider
docker compose up -d

At a terminal with Docker running, the scaffolder offers to start them right after it creates the project and waits until they are healthy. The Ollama container pulls the model after that, in the background: docker compose logs -f ollama-pull shows when it is done.

The postgres:16-alpine image has no pgvector extension. For semantic search in Postgres, switch the image to pgvector/pgvector:pg16.

With Ollama as the provider, the compose file also pulls the project's model (qwen3.5:9b unless you chose another) into the Ollama container. With Ollama installed on your machine instead, pull it yourself:

ollama pull qwen3.5:9b

On this page