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 supports 6 templates:

TemplateDescription
basicSingle agent with tools
memoryAgent with persistent memory in Redis
swarmTeam of agents with hierarchical coordination
workflowMulti-step DAG pipeline of agents
api-serverExpress server exposing agents over HTTP
nextjsNext.js chat app with streaming

Pass flags to skip the prompts:

npx create-cogitator-app my-agent \
  --template swarm \
  --provider openai \
  --pm pnpm

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
  • Postgres (port 5432) — long-term memory (user, password and database cogitator unless POSTGRES_* variables are set)
  • Ollama (port 11434) — local LLM inference, only when Ollama is the chosen provider
docker compose up -d

The 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

On this page