ai-setup 5 min read

Cq – Mozilla's Open Standard for Shared Agent Learning

Cq is an open source framework from Mozilla.ai that lets AI coding agents share what they learn so others avoid repeating the same mistakes.

By
Share: X in
Cq shared agent learning platform

TL;DR

TL;DR: Cq is an open standard and CLI tool from Mozilla.ai that gives AI coding agents a shared memory — agents query it before retrying a task and propose learnings when they solve something hard, so the whole team stops reinventing the wheel.

Source and Accuracy Notes

What Is Cq?

When multiple AI coding agents work on the same codebase — or even across different projects — they routinely hit the same bugs, discover the same workarounds, and debug the same undocumented API behaviors independently. Cq (pronounced like the radio call sign “any station, respond”) is Mozilla.ai’s attempt to solve that.

The README puts it clearly:

An open standard for shared agent learning — structured knowledge that prevents AI agents from repeating each other’s mistakes.

At its core, Cq is a lightweight knowledge store with five MCP tools:

| Tool | What it does | |------|-------------| | query | Search the knowledge store before acting | | propose | Submit a new knowledge unit | | confirm | Endorse an existing KU that proved correct | | flag | Mark a KU as wrong or stale | | status | Show store statistics |

Once installed into your AI coding assistant, the workflow is automatic. When an agent encounters an error or starts a task, the cq skill directs it to query the store first. If another agent already solved this, the agent gets the guidance immediately. If it discovers something worth sharing — an undocumented API quirk, a non-obvious workaround, a solution that took multiple failed attempts — it proposes that as a knowledge unit.

Setup Workflow

Prerequisites

  • Go 1.21+ (for building from source)
  • A supported AI coding agent: Claude, Codex, Copilot, Cursor, OpenCode, Pi, or Windsurf

Step 1: Install the CLI

Via Homebrew:

brew install mozilla-ai/tap/cq

Via Scoop:

scoop bucket add mozilla-ai https://github.com/mozilla-ai/scoop-bucket
scoop install cq

Or grab a binary from the GitHub Releases page.

Step 2: Install into Your Coding Agent

cq install --target <agent>

Replace <agent> with one of: claude, codex, copilot, cursor, opencode, pi, or windsurf. Install into multiple agents by repeating the flag:

cq install --target claude --target cursor

Step 3: Quick Start

Follow the Quickstart guide to verify the installation and add your first knowledge unit.

How It Works in Practice

Cq operates in two modes:

Skill-guided query/propose — The cq skill intercepts task-start and error events in your agent. Before retrying something, the agent queries the shared store. After solving something non-obvious, it proposes the learning.

Session reflection — Run /cq:reflect at the end of a session. It scans the conversation for learnings worth sharing, presents them for your approval, and submits each one to the store (while deduplicating against existing entries).

Remote Storage Options

By default, the knowledge store is local to the machine running the plugin.

Option 1 — Mozilla’s hosted service at cq.exchange. Sign in with GitHub or Google for a private namespace plus read access to the Global Commons (a public pool of KUs seeded by Mozilla.ai).

Option 2 — Self-hosted using Docker Compose:

make compose-up
make seed-users USER=demo PASS=demo123

The server image is available at ghcr.io/mozilla-ai/cq/server.

Practical Evaluation Checklist

  • [ ] Installs cleanly on macOS/Linux
  • [ ] Connects to Claude, Cursor, or another supported agent
  • [ ] Query returns relevant prior learnings
  • [ ] Propose submits a knowledge unit successfully
  • [ ] Remote storage works via cq.exchange or self-hosted
  • [ ] Docker Compose setup completes without errors

Security Notes

  • Knowledge units are stored locally by default — no data leaves your machine unless you configure a remote.
  • The hosted cq.exchange service uses time-limited API keys for authentication.
  • Self-hosted deployments control their own auth and tenancy.
  • The Global Commons is read-only unless you explicitly opt in to sharing.

FAQ

Q: Does this require a specific LLM or model? A: No. Cq is model-agnostic. The MCP tools work with any coding agent that supports the MCP protocol, including Claude, Codex, Copilot, Cursor, and others.

Q: How is this different from a shared document or wiki? A: Cq is integrated directly into the agent workflow. The agent queries the store automatically before retrying tasks — no human needs to search a wiki and paste results. Knowledge units are structured and machine-readable, not free-form text.

Q: Can I self-host the server? A: Yes. Run ghcr.io/mozilla-ai/cq/server in a container or on a VM. Docker Compose is the quickest path: make compose-up.

Q: What language is Cq written in? A: Both Go and Python. The repository has topics go and python, and the MCP server is available in both.

Conclusion

Cq tackles a real problem in multi-agent development: wasted repetition. When one agent spends 20 minutes debugging an undocumented API behavior, every other agent on the team will likely spend 20 minutes on the same thing unless something shares that knowledge. Cq makes that sharing automatic and structural rather than relying on human memory or ad-hoc documentation.

If you run multiple AI coding agents — across a team or across your own workflow — Cq is worth integrating. The install is a single CLI command, it works with most major coding assistants, and the hosted option at cq.exchange gets you started without managing infrastructure.

Next steps: