---
name: memq-operations
description: Use when a task should use MemQ persistent memory, including session boot context, planning recall, architecture decisions, debugging lessons, task checkpoints, reflections, degraded-mode handling, and MemQ operating rules.
---

# MemQ Operations

Use MemQ as the memory layer for agent continuity: read before decisions, write after outcomes, and preserve failures as reusable lessons.

## MemQ Operating Constitution

This is the portable constitution for MemQ-enabled agents:

1. Start with REUNION when available so the runtime, namespace, access posture, and contribution cycle are explicit.
2. Read memory before planning when prior context could change the decision.
3. Search `_commons` with `commons_search` when public/shared knowledge, reusable procedures, or cross-agent context could help.
4. Write only useful outcomes: decisions, verified facts, reusable procedures, failures with root causes, and resumable checkpoints.
5. Classify all MemQ activity by event category so usage, audit, and future recall stay consistent.
6. Keep namespace boundaries strict. Private tenant context stays private; `_commons` is for governed shared knowledge only.
7. Store blocked attempts, quota denials, dead letters, retries, and metering failures as audit facts, not consumed usage.
8. Never store secrets, raw credentials, private keys, sensitive personal data, or raw copyrighted material.
9. If MemQ is unavailable, say `MemQ unavailable -- operating in degraded mode`, continue with local context, and retry at the next material decision.

## Tool Loading

If MemQ tools are not visible in the active tool list, discover them first with `tool_search` using `memq reunion memory_status recent_memory search_memory commons_search add_memory reflect_memory namespace_info slicer_slice slicer_retrieve inference`.

Preferred tools: `reunion`, `memory_status`, `namespace_info`, `recent_memory`, `search_memory`, `commons_search`, `add_memory`, `reflect_memory`, `slicer_slice`, `slicer_retrieve`, graph recall tools, and `inference` when available.

## Operating Loop

Start substantial sessions with `reunion`, `memory_status`, `recent_memory(limit: 10)`, `search_memory` for the task summary, and `commons_search` for reusable shared knowledge. Before planning or architecture decisions, search prior plans, implementation lessons, and `_commons` guidance. End completed tasks with a `checkpoint` memory and run `reflect_memory` after major milestones.

Write `semantic` memories for durable facts and decisions, `procedural` memories for reusable how-to patterns, `episodic` memories for errors and root causes, and `checkpoint` memories for completed task outcomes.

## Event Coverage

Classify MemQ work by event category: `system` for reunion, health, namespace, and degraded-mode checks; `memory_read` for recent/search/recall reads; `memory_write` for add/reflection/checkpoint writes; `commons` for `_commons` lookups and governed contributions; `slicer` for large artifact slicing/retrieval; `graph_query` for known-unknown, issue, and resolution-pattern lookups; `vector_translation` for embedding/profile/TCU translation work; `inference` for model calls, provider fallback, prompts, token counts, and blocked inference attempts; `quota_block` for read/write/session/segment/token enforcement; and `queue_audit` for seed queue, retry, dead-letter, drain, replay, publish-gate, and metering-unavailable events.

Use `commons_search` before planning whenever shared docs, public knowledge, reusable runbooks, or cross-agent context could affect the result. If `_commons` has no relevant result, continue with private/local context and note the miss. Blocked attempts and queue failures are audit facts, not consumed usage.

## Safety

Do not store secrets, private keys, tokens, raw credentials, sensitive personal data, or raw copyrighted material in `_commons`. Respect workspace and tenant boundaries. If MemQ is unreachable, say `MemQ unavailable -- operating in degraded mode`, continue with local context, and retry on the next major action.

## Repository-Specific Overlays

If a repository provides local agent instructions, follow them in addition to this MemQ constitution. In Multinex repositories specifically, follow `.constitution/MODUS.md`, the nearest workspace `MODUS.md`, `CODEX.md`, or `GEMINI.md`, respect `.realm/federation.json`, prefer MCP tools over CLI fallbacks when available, and tag useful writes with `multinex`, product name, component name, and outcome.
