Setup guide

Set up Mneme in a software factory

Mneme has no adapter for a software factory as a whole. You set it up per repository and per agent: commit the decisions and the memory file, give each agent its own Mneme hook where one exists, and require the CI check on every pull request the factory opens. Keep changes to the decisions themselves behind human review.

Verify: CI check on every pull requestEnforce: each agent's hook, where it has oneDiscover: MCP, optional

You’ll end up with: a factory pipeline in which every pull request, whichever agent opened it, passes a required check against the same recorded decisions, and agents with a Mneme hook are stopped earlier.

Goal

A software factory combines a work queue, an orchestrator (the program that hands tasks to coding agents, runs them and retries failures), the agents themselves, CI and human review. Mneme is not a factory platform, and nothing in it knows about your queue or orchestrator. It reaches the factory’s output at two points it already ships: an agent’s hook, and the CI check on the pull request.

This guide places those two points in the pipeline, using only shipped checks. For the argument behind it, read the software factory’s missing decision layer.

Prerequisites

  • A factory whose agents commit to git repositories and open pull requests or merge requests.
  • At least one decision with an activated rule in each repository: steps 1 to 7 of the Claude Code setup, run once per repository.
  • Control over branch rules, so the CI check can be required and decision files can need a human approval.

Tested versions: the checks named here ran against mneme-hq 0.11.0 in the other setup guides. We have not tested a complete factory. The catalogue lists the smallest version of this, a one-issue factory, as a proposed workflow.

Configure

1. Put the decisions in each repository

Commit the decision records in docs/adr/ and the memory file, .mneme/project_memory.json. Every agent and the CI check read that one file, so they all apply the same decisions, whichever agent picks up the task.

2. Give each agent its own hook, where one exists

The factory’s orchestrator doesn’t run Mneme; the agents it launches do. Set up each agent as if a person were running it:

  • Claude Code: the plugin hook. Paperclip, which launches Claude Code in your workspace, keeps that hook (validated on paperclipai 2026.817.0). Other orchestrators that launch Claude Code are untested; check that they load your Claude Code plugins.
  • Codex CLI: the hook bundle.
  • Claude Agent SDK, LangChain agents, Kiro CLI 3.0 and Google Antigravity: the adapter on each integration page.
  • Hermes Agent and OpenCode: experimental adapters with narrow coverage (OpenCode’s is not in mneme-hq 0.11.0); see each integration page and treat CI as their check.
  • Every other agent: no Mneme hook. That includes the Copilot, Claude and Codex sessions GitHub Agent HQ runs, because Mneme has no hook inside them. CI is their check.

Make sure each agent process starts in the repository root, or can find the memory file, and that its hook is in strict mode. An agent launched from another directory with no memory file in reach runs with no checks at all.

3. Require the CI check on every factory pull request

Add the GitHub Actions workflow or GitLab CI job and require it on every branch the factory merges into. This is the one point every change passes, so it is where agents without a hook, and any write a hook missed, get checked.

4. Keep the decisions under human control

An agent that can edit an architecture decision record (ADR), the memory file or the CI workflow can change what the check enforces. Put those files behind code owners and a required human review, restrict who can bypass the required check, and don’t let the factory approve its own changes to them. Fail a pull request that breaks an ADR lists the branch settings.

5. Optional: let agents look decisions up

Agents that can start a local Model Context Protocol (MCP) server can ask Mneme’s decision server which decisions apply to the files in their task, and propose new ones for review. The decision MCP setup covers it. Proposals stay proposals until a person accepts them.

Expected result

For the example decision, ADR-001, which bans the Celery library, a factory pull request that adds a Celery worker fails the required check, whichever agent wrote it:

Recorded output
exit=2 workers/jobs.py
exit=0 workers/publish.py

The Celery file exits 2 and fails the job; the Pub/Sub file passes. If the agent was Claude Code or Codex CLI with its hook in strict mode, a native file edit adding Celery was refused earlier, while the agent was working. A shell write, a check that failed open, or warn mode still lets the file reach the pull request, where this check fails it. The Claude Code and Codex CLI guides show those refusals.

What is and isn’t enforced

  • Enforced: the required CI check, on every file a factory pull request adds or modifies; and each agent’s hook, with that hook’s own coverage.
  • Not enforced by Mneme: the queue, the orchestrator’s scheduling, sandbox permissions and network access. Mneme checks code against architectural decisions, not infrastructure policy.
  • Coverage is per agent. Shell writes, custom tools and agents without a hook reach Mneme only at CI. Each agent’s limits are on its integration page.
  • Hooks fail open by default: when a check can’t run, the change goes through instead of being blocked. Claude Code also has an opt-in mode that refuses direct file writes when the check can’t run, enabled by a reviewed change on your default branch. A crashed or slow check lets the agent continue, so CI stays required even for agents with a hook.
  • Not tested as a whole: parallel agents on one repository, subagents and agent teams. Each part is tested on its own.

Troubleshooting

An agent with a hook still opens pull requests that fail the check

The hook isn’t reaching the memory file, is in warn mode, or the write went through a path it doesn’t intercept, such as a shell command. Check the agent’s working directory and mode, then its setup guide’s troubleshooting section.

Factory pull requests merge despite a failed check

The check isn’t required on that branch, or the factory’s account can bypass it. Fix the branch rule; CI is only a gate where it is required.

The check stops failing after an agent’s change

The change may have edited a decision, the memory file or the workflow. Review the diff of those files; step 4 keeps them behind a human approval.

Next layer

Running agents at factory scale?

We work with design partners to put these checks on a real factory pipeline.