Documentation

Cognetivy is an open-source state layer for AI coding assistants. It adds versioned workflows, run tracking, step events, and schema-backed collections - all stored locally in a .cognetivy/ workspace. No LLMs inside the engine; your editor's agent uses it via Skills and MCP. This guide covers installation, core concepts, the CLI, onboarding, and how to connect your coding agent. For the full open-source reference, see the Cognetivy repository.

Overview

Cognetivy gives your AI coding assistant an operational layer: versioned workflows, run tracking, step events, and schema-backed collections. All state lives in a local .cognetivy/ workspace - no cloud, no LLMs inside the engine. Your agent (Cursor, Claude Code, OpenClaw, or any MCP client) drives the CLI or MCP server; you inspect everything in Studio.

  • Workflows - Directed acyclic graphs of nodes (prompts, inputs/outputs). Versioned and validated; no cycles.
  • Runs - One execution of a workflow. Tracked with status, current node(s), and next-step hints for the agent.
  • Events - NDJSON log per run (step_started, step_completed, run_completed, custom).
  • Collections - Schema-backed data per run (sources, ideas, outputs). Optional traceability: citations, derived_from, reasoning.

Install

Run once with npx (no global install required):

npx cognetivy

The interactive installer will create a .cognetivy/ workspace in the current directory, prompt you to choose your coding agent(s), install the Cognetivy skill where needed, optionally apply a workflow template, and open Studio in your browser.

For use from any directory and for MCP, install globally:

npm install -g cognetivy

After a global install, run cognetivy install <target> to add the skill to Cursor, Claude Code, OpenClaw, or workspace. See Set up your agent below.

Set up your agent

Choose your coding agent for step-by-step setup (agent skills and/or MCP):

Core concepts

Cognetivy organizes agent work into workflows, runs, and collections. The run engine computes the next step from the workflow DAG and current run state; your agent follows the hint (run_node, run_nodes_parallel, complete_node, complete_run).

Workflow structure

A workflow is a single connected DAG: nodes (prompts) connected by input/output collections. Cycles are not allowed and are rejected at validation. Each node can declare required_skills and required_mcps. Workflows are versioned; the workspace has a current workflow and current version.

Run lifecycle

Start a run with run start --input <file>. The CLI (and MCP) return COGNETIVY_NEXT_STEP with action, node_id(s), and hint. Use run step to start the next node or complete a node with collection payload. When the action is run_nodes_parallel, spawn one sub-agent per runnable node unless the user says otherwise. End with event append run_completed and run complete.

Collections and traceability

Collection schema is workflow-scoped (kinds and item_schema). Every kind except run_input supports optional citations, derived_from, and reasoning. Populate these so outputs are traceable to sources and chain of thinking. Use Markdown in long text fields for better display in Studio.

Create a workflow and run it

Once your agent is connected, ask it to create a workflow and start a run. Example prompts:

“Create a workflow with three nodes: one that gathers requirements, one that writes a plan, one that writes a summary. Save it as the current workflow.”

Then start a run:

“Start a run with input topic ‘user onboarding’.”

Open Studio to inspect the run, events, and collected data.

Onboarding: choose a template in the CLI

When you run npx cognetivy, the installer creates your workspace and installs skills. As part of onboarding, it then prompts you to choose a workflow template from the CLI. You pick one (e.g. bug triage, PR review, product PRD), and Cognetivy creates a workflow from that template and sets it as the current one. You can skip or change it later via cognetivy workflow apply-template.

Studio

Studio is the read-only web UI for your workspace. Open it with cognetivy studio or from the installer. You can:

  • View the workflow DAG, node prompts, and collection schema
  • Browse runs, run detail, and event timeline
  • Inspect collections and collection items (with traceability)
  • Compare workflow versions and apply templates from the gallery

More →

CLI reference

Commands are run from the project root (directory containing .cognetivy/). MCP tools mirror the CLI.

Entry & setup

CommandDescription
cognetivyOpen Cognetivy in your browser (cloud app; sign in to use workflows and runs)
cognetivy init [--workspace-only] [--force]Initialize local .cognetivy workspace and optional skill install (interactive)
cognetivy install <cursor|claude|openclaw|workspace>Install Cognetivy skill into the given target
cognetivy studio [--port <port>]Open local Studio in the browser (for local .cognetivy workspace)
cognetivy mcpStart MCP server over stdio (for Cursor and other MCP clients; requires local workspace)

Workflow

CommandDescription
cognetivy workflow listList all workflows in the workspace
cognetivy workflow create --name <string> [--id <string>] [--description <string>]Create a new workflow (v1 + default schema)
cognetivy workflow select --workflow <id>Set the current workflow
cognetivy workflow get [--workflow <id>] [--version <id>]Print workflow version JSON
cognetivy workflow versions [--workflow <id>]List versions for a workflow
cognetivy workflow set --file <path> [--workflow <id>] [--name <string>]Set workflow version from JSON (creates new version, sets current)
cognetivy workflow templates [--list]Interactive template picker (TTY) or JSON list
cognetivy workflow apply-template [--id <template-id>] [--name <string>]Apply a built-in template (creates workflow, sets current)
cognetivy workflow template --id <template-id>Print template JSON to stdout

Run

CommandDescription
cognetivy run start --input <path> [--name <string>]Start a run; prints run_id and COGNETIVY_NEXT_STEP
cognetivy run status --run <id> [--json]Show run state, nodes, collections, next_step
cognetivy run step --run <id> [--node <id>] [--collection-kind <kind>]Start next node or complete node (payload via stdin)
cognetivy run complete --run <id>Mark run as completed
cognetivy run set-name --run <id> --name <string>Set or update run display name

Event

CommandDescription
cognetivy event append --run <id> [--file <path>] [--by <string>]Append event (JSON file or stdin). Step events: data.step = node id

Collection schema

CommandDescription
cognetivy collection-schema get [--workflow <id>]Print workflow-scoped collection schema
cognetivy collection-schema set --file <path> [--workflow <id>]Set schema from JSON

Collection

CommandDescription
cognetivy collection list --run <id>List collection kinds that have data for the run
cognetivy collection get --run <id> --kind <kind>Get all items of a kind
cognetivy collection set --run <id> --kind <kind> [--file <path>] --node <id> --node-result <id>Replace all items of a kind
cognetivy collection append --run <id> --kind <kind> [--file <path>] --node <id> --node-result <id>Append one item

Node & node-result

CommandDescription
cognetivy node start --run <id> --node <id>Emit step_started and create started node result
cognetivy node complete --run <id> --node <id> [--collection-kind <kind>] [--output ...]Node result + optional collection + step_completed
cognetivy node-result list --run <id>List node results for run
cognetivy node-result get --run <id> --node <id>Get node result for a node
cognetivy node-result set --run <id> --node <id> --status <started|completed|failed|needs_human> [--output ...]Create or replace node result

Skills

CommandDescription
cognetivy skills listList skills from configured sources
cognetivy skills info <name>Show one skill (path, frontmatter, body preview)
cognetivy skills check [path]Validate SKILL.md
cognetivy skills pathsPrint discovery and install target paths
cognetivy skills install [source]Install a skill from path/URL into project or target
cognetivy skills update [name] [--all]Update skill(s) from recorded origin