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 supports 6 templates:
| Template | Description |
|---|---|
basic | Single agent with tools |
memory | Agent with persistent memory in Redis |
swarm | Team of agents with hierarchical coordination |
workflow | Multi-step DAG pipeline of agents |
api-server | Express server exposing agents over HTTP |
nextjs | Next.js chat app with streaming |
Pass flags to skip the prompts:
npx create-cogitator-app my-agent \
--template swarm \
--provider openai \
--pm pnpmSee 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
- Postgres (port 5432) — long-term memory (user, password and database
cogitatorunlessPOSTGRES_*variables are set) - Ollama (port 11434) — local LLM inference, only when Ollama is the chosen provider
docker compose up -dThe postgres:16-alpine image has no pgvector extension. For semantic search in Postgres, switch the image to pgvector/pgvector:pg16.
Pull a model when you use Ollama:
ollama pull llama3.2