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 higherScaffolding 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 devcreate-cogitator-app asks what to build, or takes it from flags. It starts from one of 16 presets:
| Preset | What you get |
|---|---|
basic | One agent with real tools in your terminal |
assistant | Workspace files with approvals, long-term memory, a scheduler and evals |
memory | Conversations that survive restarts, in SQLite |
api-server | Express with Swagger UI, token auth and persistent threads |
hono | Agents behind a small, fast HTTP API |
tetsu | Bun-native controller with OpenAPI and WebSocket |
nextjs | Streaming chat with tool calls, approvals and saved threads |
channels | One assistant on Telegram, Discord, Slack, WebChat, Bluesky, Threads, GitHub, email or Microsoft Teams |
rag | Answers grounded in the files of docs/ |
mcp | Tools from an MCP server, your agents served over MCP |
swarm | A researcher and a writer under a reviewing supervisor |
workflow | A multi-step pipeline of agents |
durable-workflow | A saga with compensation, an approval step and crash recovery |
a2a | An agent other frameworks call over the Agent-to-Agent protocol |
voice-realtime | Speech in, speech out over WebSocket |
evals | Measure 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 --yesThen 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 zodOptional 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/mcpSome 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
cogitatorunlessPOSTGRES_*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 -dAt 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