dark-memory-mcp
v4.0.0Persistent memory + vibe-loop engine for AI agents.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
dark_memory_project_create
Create a new project (INV-7 tenant primitive). Idempotent on project_id — re-creating an existing project returns the existing row. The 'default' project is seeded on Open and cannot be re-created (returns ErrAlreadyExists).
| Parameter | Type | Description |
|---|---|---|
display_name * | string | Human-readable label (1-128 chars). |
project_id * | string | Kebab-case public id (3-64 chars, lowercase alnum + hyphen, must start and end with alnum). |
constitution_id | string | Optional constitution id to bind the project to (INV-7 constitution scoping). |
constitution_ver | string | Optional constitution version (paired with constitution_id). |
default_agent_id | string | Optional v2.4.1 Mem0 agent_id (LLM identity) that owns the project. session_start and publish_vibe resolve agent_id with priority (caller input > this default > empty). Empty = no default agent (v2.4.… |
description | string | Optional free-form description (max 512 chars). |
nli_config | object | Optional v2.20.0 T07 per-project NLI configuration. When enabled, the project's drift_judge uses the configured primary (and optional fallback) NLI provider instead of falling through to nli.Config{}.… |
dark_memory_session_start
Start an operational session. Returns the session_id. Use session_close to terminate.
| Parameter | Type | Description |
|---|---|---|
operator * | string | Operator id (human or agent) starting the session. |
project_id * | string | Project namespace (INV-7). Use 'default' for the legacy project. |
constitution_id | string | |
constitution_ver | string | |
notes | string |
dark_memory_session_resume
Resume an existing session by session_id. Validates the session exists, sets the active project to match, and returns the session row.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | The session id to resume (format: sess-XXXXXXXX). |
dark_memory_session_status
Return the current state of a session (id, operator, project, status, timestamps). Read-only. Includes closing_soon + seconds_until_close so harnesses can warn before the sweeper closes an idle session.
| Parameter | Type | Description |
|---|---|---|
session_id * | string |
dark_memory_session_close
Close the active session. Returns the write/run/item summary.
| Parameter | Type | Description |
|---|---|---|
session_id * | string |
dark_memory_session_heartbeat
Refresh a session's last_heartbeat_at so the sweeper does not auto-close it. Call every ~30s during long reasoning pauses or read-only stretches (>60m between writes would otherwise demote the session to closed_aborted). Returns the new last_heartbeat_at.
| Parameter | Type | Description |
|---|---|---|
session_id * | string |
dark_memory_session_recover
Detect the most-recent closed_aborted session for an operator within a lookback window (INV-8). Read-only: never creates a session. Returns the candidate + requires_consent=true when found, so the caller can decide to follow up with session_resurrect.
| Parameter | Type | Description |
|---|---|---|
operator * | string | The human/agent identity to recover for (e.g. dark-agent). |
lookback | string | Search window (default 24h). Formats: 24h, 7d, 30m, or Go duration. |
dark_memory_session_resurrect
Resurrect a closed_aborted session (INV-8): creates a new session inheriting the original's constitution binding + active mods. The original stays untouched. Use session_recover first to discover the candidate. Returns the new session_id + inheritance audit.
| Parameter | Type | Description |
|---|---|---|
lookback | string | Used only in discovery form. Default 24h. |
operator | string | Used only in discovery form (original_session_id empty). |
original_session_id | string | The closed_aborted session to resurrect from. If empty, discovery form: operator + lookback find the latest candidate. |
reason | string | Optional reason: explicit_recovery, harness_restart, ... |
dark_memory_research_topic
Run a research query against the registered ResearchBackend set. Returns deduplicated, confidence-ranked items.
| Parameter | Type | Description |
|---|---|---|
query * | string | The natural-language research query. |
intent | string | Optional intent tag (e.g. 'cve', 'academic'). Default 'general'. |
max_items | integer | Cap on returned items. Default 20. |
thread_id | string | Optional thread id for multi-turn research continuation. |
dark_memory_research_recall
Recall previously stored research items by query, with a token budget. Runs the Atlan 5-bucket economy pipeline.
| Parameter | Type | Description |
|---|---|---|
query * | string | |
max_tokens | integer | Token budget for the response. Default 4000. |
min_confidence | number | Drop items below this confidence (0..1). Default 0.3. |
dark_memory_research_resume_thread
Continue a multi-turn research thread by re-running ResearchTopic with the same thread_id.
| Parameter | Type | Description |
|---|---|---|
query * | string | The follow-up query. |
thread_id * | string | Existing thread id to resume. |
max_items | integer |
dark_memory_agent_bootstrap
Return the markdown content of a dark-agent self-bootstrap resource by surface+target. Surfaces: system_prompt | compatibility_matrix | install_guide (requires target) | companion (requires target) | all. The resource URIs are also exposed via resources/read for harnesses that prefer the standard MCP path.
| Parameter | Type | Description |
|---|---|---|
surface * | string | Which resource group to read |
force_embedded | boolean | If true, bypass DARK_AGENT_BOOTSTRAP_DIR and use the embedded copy. Diagnostic; mostly for drift tests. |
target | string | For install_guide: claude-desktop | claude-code | opencode | cline | cursor | continue. For companion: dark-research | [FUTURE-MCP-N]. Required for those surfaces; ignored otherwise. |
dark_memory_agent_recommend_companions
Reads the harness's clientInfo and returns a structured list of recommended companion MCPs (dark-research, [FUTURE-MCP-N]). Read-only: never auto-installs. Use this on first connect to learn what the harness should install for full functionality.
dark_memory_agent_detect_environment
Returns what the MCP can infer about the harness's runtime: spec version negotiated, client name/title/version, source of clientInfo (initialize handshake vs _meta per-request), negotiated capabilities (resources/tools/prompts/logging), transport. Use this when debugging harness compatibility or filing an issue.
dark_memory_vibe_publish
Publish an artifact under a spec. Runs the full vibe-flow loop: spec_create + artifact_log + brand_match (optional) + compliance_check (optional) + drift_judge + drift_log. Returns verdict + next_action.
| Parameter | Type | Description |
|---|---|---|
artifact * | object | |
spec * | object | |
async_drift_check | boolean | Default false. When true, drift_judge runs in the background and vibe_publish returns immediately (verdict=pending); poll pipeline_status for the final verdict. |
auto_drift_check | boolean | Default true. Set false to skip drift_judge. |
session_id | string |
dark_memory_vibe_spec
Create a new spec with structured task validation (unique ids, no cycles, depends_on consistency).
| Parameter | Type | Description |
|---|---|---|
tasks * | ||
vibe_case * | string | |
constitution | string | |
session_id | string | |
spec | string |
dark_memory_pipeline_status
Return the latest drift report for an artifact_id (or nil if none). Read-only. With DARK_FEDERATION_PEER_DSN configured, also probes the dark-research peer when the local lookup misses.
| Parameter | Type | Description |
|---|---|---|
artifact_id * | integer |
dark_memory_resolve_drift
Operator gate action on a drift report: accept (artifact correct as-is) or reject (artifact wrong).
| Parameter | Type | Description |
|---|---|---|
decision * | string | |
drift_id * | integer | |
operator_id * | string | |
note | string |
dark_memory_vibe_compile
Compile a persisted vibe_spec into an executable bash script that drives the 6-phase vibe-loop-git protocol (OSINT → SPEC → ARTIFACT → DRIFT_JUDGE → RESOLVE_DRIFT → ATOMIC_MIRROR) with operator-approval gates between phases. Bash is the artifact — auditable, replay-able, deterministic. Honors 'every loop requires operator approval' (SKILL.md:59).
| Parameter | Type | Description |
|---|---|---|
spec_id * | integer | vibe_specs.id to compile. |
options | object |
dark_memory_plan_create
Propose a plan for a spec: the tool candidates with their weights, the depth tier and the consumable budget. The plan starts in draft; a human approves it with plan_decide.
| Parameter | Type | Description |
|---|---|---|
intent * | string | What the work is. The candidates are ranked against it, and the judge validates it. |
spec_id * | integer | The spec this plan describes. The plan is a spec with a plan on it. |
max_candidates | integer | Cap on the shortlist. Default 8. The shortlist is a proposal, not a catalogue. |
max_judge_calls | integer | Override the tier's proposed judge-call budget. |
max_tool_calls | integer | Override the tier's proposed tool-call budget. |
session_id | string | The session that owns the call. It decides which project the plan lands in. |
dark_memory_plan_get
Read the plan of a spec: its status, its candidates, its tier and its effective budget. Without spec_id, it reads the open plan of the session.
| Parameter | Type | Description |
|---|---|---|
session_id | string | The session that owns the call. |
spec_id | integer | The spec whose plan to read. Omit to read the open plan of the session. |
dark_memory_plan_decide
Record the human decision on a plan: execute (approve it), edit (reopen it with a prompt) or cancel (stop it). The decision is recorded in write_audit.
| Parameter | Type | Description |
|---|---|---|
decision * | string | execute approves the plan; edit reopens it with a prompt; cancel stops it. |
decided_by | string | Who decided. Defaults to the human. |
edit_prompt | string | The reviewer's prompt. Required when decision is edit. |
session_id | string | The session that owns the call. |
spec_id | integer | The spec whose plan is being decided. Omit to decide on the open plan of the session. |
dark_memory_judge_options
List the OAuth providers available for self-authenticated drift_judge. Each provider includes display name, supported flows, scopes, endpoint, model, and free tier limits. After reviewing the list, call dark_memory_oauth_connect({provider}) to initiate authentication with your own provider account.
dark_memory_oauth_connect
Initiate an OAuth 2.0 + PKCE flow for the given provider (google|huggingface). Returns auth_url and state — open auth_url in any browser, approve, and return to your harness. The callback server listens on localhost:9335 (configurable via DARK_OAUTH_CALLBACK_PORT) and accepts the redirect automatically. If the callback arrives, tokens are persisted to the OS keyring (or env-var fallback) and the next dark_memory_vibe_publish / dark_memory_judge call uses the provider's free tier.
| Parameter | Type | Description |
|---|---|---|
provider * | string | OAuth provider to authenticate with. 'google' = Google Gemini (60 RPM, 1500 RPD free). 'huggingface' = HuggingFace Hub (1000 RPD free, supports Device Code Flow for headless). |
scopes | array | Override default scopes for this provider. Leave empty to use defaults (generative-language.retriever for Google; openid profile inference-api for HuggingFace). |
dark_memory_oauth_status
List the OAuth connections currently stored on this machine. Each connection shows status (connected|expired|error|disconnected), expiry timestamp, and free-tier limits. Use this to verify dark_memory_oauth_connect succeeded before publishing an artifact with drift_judge.
| Parameter | Type | Description |
|---|---|---|
provider | string | Optional: filter by provider. Empty = list all. |
dark_memory_oauth_disconnect
Disconnect an OAuth provider: revoke the access_token (best-effort, depends on provider) and delete all keyring entries (access, refresh, metadata). The next dark_memory_vibe_publish call will fall back to the next available tier (BYOK or self-hosted).
| Parameter | Type | Description |
|---|---|---|
provider * | string |
dark_memory_artifact_context
Return the context projection of an artifact: id, type, spec, brand, jurisdiction, disclosure, validation status, timestamps. Read-only.
| Parameter | Type | Description |
|---|---|---|
artifact_id * | integer |
dark_memory_spec_context
Return the context projection of a spec: id, case, constitution id+ver, intent (truncated), task count. Read-only.
| Parameter | Type | Description |
|---|---|---|
spec_id * | integer |
dark_memory_session_context
Return the context projection of a session. Read-only.
| Parameter | Type | Description |
|---|---|---|
session_id * | string |
dark_memory_recall
Scoped recall: returns the assembled atomic frames for the requested scope plus an incremental delta (write_audit rows since since_token). scope=global|project|session.
| Parameter | Type | Description |
|---|---|---|
scope * | string | |
project_id | string | Optional. Defaults to active project. |
session_id | string | Required when scope=session. |
since_token | integer | Optional cursor for delta. Returns writes with id > since_token. |
dark_memory_agent_memory_save
Save an agent memory. Mem0-aligned. Scoped to the active project. By default (bind_session=false) the row survives session close; set bind_session=true to tag the row with the active session. v2.3.0.
| Parameter | Type | Description |
|---|---|---|
content * | string | The memory payload. Required. |
kind * | string | |
operator * | string | Operator id (for ownership + audit). Required. |
agent_id | string | Mem0 agent_id (LLM that owns the memory). Optional. v2.3.0. |
bind_session | boolean | If true, tag the row with the active session id. Default false (v2.3.0 change; pre-v2.3.0 was implicitly true). |
expires_at | string | RFC3339. Optional TTL hint (sweeper follow-up). |
memory_type | string | Mem0 three-class taxonomy. Optional; empty = unclassified. v2.3.0. |
pinned | boolean | |
project_id | string | Explicit project id. SPEC-203: a narrowing, never a widening. If it contradicts the session project, the session wins on writes and the read is refused with ErrCrossProjectAccess. Optional. |
session_id | string | Session id (from session_start). SPEC-203: the project of the write/read is resolved from this session, so the row lands in the project of the session that asked for it even when another client moved… |
tags | string | Comma-separated, normalized lowercase. |
title | string |
dark_memory_agent_memory_list
List agent memories in the active project. v2.3.0: scope default is 'project' (was implicit session); scope=operator now requires the explicit operator parameter; scope=agent is new (Mem0 agent_id).
| Parameter | Type | Description |
|---|---|---|
agent_id | string | Required for scope=agent (Mem0 agent_id). v2.3.0. |
include_archived | boolean | |
kind | string | |
limit | integer | |
memory_type | string | Mem0 three-class taxonomy filter. v2.3.0. |
operator | string | Caller identity for scope=operator resolution. v2.3.0. |
pinned_only | boolean | |
project_id | string | Explicit project id. SPEC-203: a narrowing, never a widening. If it contradicts the session project, the session wins on writes and the read is refused with ErrCrossProjectAccess. Optional. |
scope | string | |
session_id | string | Session id (from session_start). SPEC-203: the project of the write/read is resolved from this session, so the row lands in the project of the session that asked for it even when another client moved… |
tag | string |
dark_memory_agent_memory_recall
BM25-ranked search over content+title+tags in the active project's agent_memory. v2.3.0 NEW. Lexical-only (FTS5). Vector search is v2.4.0+. Use this tool instead of re-implementing FTS5 escape in client code.
| Parameter | Type | Description |
|---|---|---|
operator * | string | Operator id (INV-1 audit + result attribution). NOT an ownership filter by default — recall searches the whole active project. Pass scope='operator' to narrow to this operator's rows. v2.21.0 (spec… |
query * | string | FTS5 search query. Alphanumeric + . - _ / + * only; AND/OR/NOT/NEAR rejected. |
agent_id | string | Optional. Scopes results to rows where agent_id == this value (Mem0 agent_id). v2.3.0. |
kind | string | Optional. Filter to one operator-kind (note, observation, decision, ...). |
limit | integer | |
memory_type | string | Optional. Mem0 three-class taxonomy filter. v2.3.0. |
project_id | string | Explicit project id. SPEC-203: a narrowing, never a widening. If it contradicts the session project, the session wins on writes and the read is refused with ErrCrossProjectAccess. Optional. |
scope | string | Ownership axis. Default 'project' (all operators/sessions). 'operator' narrows to the operator's rows; 'agent' to agent_id's rows; 'session' to the active session. v2.21.0 (spec 1200 T2). |
session_id | string | Session id (from session_start). SPEC-203: the project of the write/read is resolved from this session, so the row lands in the project of the session that asked for it even when another client moved… |
dark_memory_agent_memory_get
Get an agent memory by id. Cross-project reads return ErrNotFound (INV-7).
| Parameter | Type | Description |
|---|---|---|
id * | integer | Row id. |
project_id | string | Explicit project id. SPEC-203: a narrowing, never a widening. If it contradicts the session project, the session wins on writes and the read is refused with ErrCrossProjectAccess. Optional. |
session_id | string | Session id (from session_start). SPEC-203: the project of the write/read is resolved from this session, so the row lands in the project of the session that asked for it even when another client moved… |
dark_memory_agent_memory_update
Update an agent memory's mutable fields (content/title/tags/pinned/expires_at/memory_type). Operator + project + agent_id are immutable.
| Parameter | Type | Description |
|---|---|---|
id * | integer | |
operator * | string | Operator id (INV-1 audit). Required. |
content | string | |
expires_at | string | |
memory_type | string | Mem0 three-class taxonomy. Empty string clears. v2.3.0. |
pinned | boolean | |
project_id | string | Explicit project id. SPEC-203: a narrowing, never a widening. If it contradicts the session project, the session wins on writes and the read is refused with ErrCrossProjectAccess. Optional. |
session_id | string | Session id (from session_start). SPEC-203: the project of the write/read is resolved from this session, so the row lands in the project of the session that asked for it even when another client moved… |
tags | string | |
title | string |
dark_memory_agent_memory_archive
Soft-delete an agent memory (sets archived_at). Recoverable with list(include_archived=true).
| Parameter | Type | Description |
|---|---|---|
id * | integer | |
operator * | string | Operator id (INV-1 audit). Required. |
project_id | string | Explicit project id. SPEC-203: a narrowing, never a widening. If it contradicts the session project, the session wins on writes and the read is refused with ErrCrossProjectAccess. Optional. |
session_id | string | Session id (from session_start). SPEC-203: the project of the write/read is resolved from this session, so the row lands in the project of the session that asked for it even when another client moved… |
dark_memory_agent_memory_delegate
Prepare a delegation context for a sub-agent spawn (v2.9.3). Registers the subagent binding (C2) and returns a ready-to-inject markdown block — session metadata + curated pinned memories + open todos — that the parent embeds in the sub-agent's task prompt so the sub-agent inherits dark-memory context instead of starting blind. Gated by DARK_MEMORY_V280=1. The binding is resolved by OPERATOR, so while it is alive it also captures the parent's own agent_memory writes; pass register_subagent=false for a context-only handoff (the parent then calls subagent_register itself if it wants the isola…
| Parameter | Type | Description |
|---|---|---|
operator * | string | Operator id (INV-1 audit). Required. |
subagent_id * | string | Opaque uuid the parent generates for this sub-agent. Required. |
task_description * | string | What the sub-agent should do. Used for context selection. Required. |
include_pinned | boolean | Include pinned memories in the delegation context. |
include_todos | boolean | Include open todos in the delegation context. |
max_tokens | integer | Context recap token budget. 0 = no context, just session metadata. |
register_subagent | boolean | Register the C2 subagent binding so the sub-agent's agent_memory writes are tagged with subagent_id. Default true. Set false for a CONTEXT-ONLY handoff: the binding is resolved by operator (not by cal… |
ttl_seconds | integer | Subagent binding TTL (clamp 60..86400; default 3600 = 1h). |
dark_memory_agent_memory_entities
Get the extracted entity list for one agent_memory row. v2.9.0-alpha PR-3. Returns {id, entities: [{entity, source, confidence, model}]} or nil entities when the row has none. Read-only.
| Parameter | Type | Description |
|---|---|---|
id * | integer | Row id (agent_memory.id). Returns nil entities when the row has no entities. |
dark_memory_subagent_register
Register or refresh an active subagent binding. v2.8.0-alpha C2. After this call, the subagent's agent_memory_save writes are tagged with subagent_id (NOT the principal's agent_id) so they never leak into the principal's ContextRecap. Defense-in-depth against arxiv:2605.08460 inheritance attacks. Gated by DARK_MEMORY_V280=1.
| Parameter | Type | Description |
|---|---|---|
operator * | string | Operator id (INV-1 audit). Required. |
subagent_id * | string | Opaque uuid the principal generated when spawning the subagent. Required. |
parent_agent_id | string | Principal's resolved agent_id for audit provenance. Optional; defaults to projects.default_agent_id. |
ttl_seconds | integer | TTL in seconds (clamp 60..86400; default 3600 = 1h). |
dark_memory_subagent_unregister
Clear an active subagent binding. v2.8.0-alpha C2. After this call, subsequent agent_memory_save calls fall through to projects.default_agent_id (or empty). Idempotent: returns ErrNotFound if no binding matches. Gated by DARK_MEMORY_V280=1.
| Parameter | Type | Description |
|---|---|---|
operator * | string | Operator id (must match the one used in subagent_register). Required. |
subagent_id * | string | The subagent_id to clear. Required. |
dark_memory_prograph_query
Run a ProGraph 2-layer entity-graph BFS over agent_memory (ADR-015). Returns rows that share at least one entity with the BM25 seeds, up to `depth` hops (0=seeds only, 1=direct neighbors, 2=neighbors-of-neighbors). C1/C2/C5/C6 use depth=1; C3/C4 use depth=2. The BFS expands via the entity graph (case-insensitive noun phrases extracted from content + title + tags at Save time when ExtractEntities=true). Read-only; emits a write_prograph_query audit row.
| Parameter | Type | Description |
|---|---|---|
query * | string | Free-text query. BM25 seeds come from SearchAgentMemory(query). Empty/whitespace returns (nil, nil) — no error. |
depth | integer | Hop count: 0 (seeds only), 1 (default — direct neighbors), 2 (neighbors-of-neighbors). 3+ returns ErrDepthOutOfRange. |
hop_limit | integer | Max rows added per hop. 0 → default 50. |
seed_limit | integer | Max BM25 seeds to start the BFS from. 0 → default 20. |
total_limit | integer | Cap on the total result size. 0 → default 100. |
dark_memory_mark_superseded
Mark one agent_memory decision row as superseded by another (alpha.20 Chunk 8.7 Bitemporal, ADR-014). Both rows must be kind=decision in the active project (INV-7). Old row gets decision_state='superseded', supersedes_id=newMemID, valid_to=validTime (default NOW). Records a row in decision_transitions with trigger+reason+evidence. Returns ErrInvalidSupersession on self-supersede, missing rows, non-decision kinds, or cross-project supersession.
| Parameter | Type | Description |
|---|---|---|
new_mem_id * | integer | mem_id of the row that supersedes (must stay 'active'). |
old_mem_id * | integer | mem_id of the row being superseded (becomes decision_state='superseded'). |
reason * | string | Required human-readable reason. Stored on decision_transitions.reason. |
evidence | string | Optional evidence pointer (URL, file path, audit row id). NULL when empty. |
trigger | string | Trigger label for the transition row. Default 'operator_action'. Free-form. |
valid_time | string | RFC3339Nano — when the supersession takes effect (old.valid_to). Default NOW (UTC). |
dark_memory_recall_bitemporal
Bitemporal 'as-of' query (alpha.20 Chunk 8.7, ADR-014). Returns agent_memory rows in the active project whose valid_time <= t (the moment in semantic-clock time the operator is asking about). Archived rows are excluded. For decision-kind rows, includes active ones and excludes superseded ones whose successor had valid_from <= t. Read-only; emits a write_audit_search_canonical row.
| Parameter | Type | Description |
|---|---|---|
t * | string | RFC3339Nano — the 'as-of' timestamp. The result includes rows whose valid_time <= t. |
kind | string | Optional kind filter (decision, observation, ...). Empty = any kind. |
limit | integer | Max rows returned. 0 → default 50. Negative → 0. |
dark_memory_mindset_apply
v2.7.0-alpha: Procedurally compose a subagent system_prompt for the given (vibe_case, task_description) and validate it via LLM-as-judge before returning. Cached in agent_memory (TTL via DARK_MINDSET_CACHE_TTL, default 1h). Composition iterates up to DARK_MINDSET_MAX_ITERATIONS (default 3) if the judge rejects the first attempt. Returns a ready-to-inject system_prompt plus tools_recommended and model_recommended for the harness to spawn the subagent. Use case: the harness spawns the subagent via its Task/Agent tool; dark-memory provides the mindset (role + goal + backstory + constraints).
| Parameter | Type | Description |
|---|---|---|
task_description * | string | What the subagent should do. Becomes the seed for procedural composition. |
vibe_case * | string | |
model_floor | string | Minimum capability for the subagent (sonnet|opus|haiku|inherit). Optional. |
operator | string | Operator id for audit trail (INV-1). Defaults to 'orchestrator_mindset'. |
dark_memory_delegate_intent
Phase 9 alpha.20 (Chunk 8.1): delegate_intent runs the v4alpha DECIDE→EXTRACT→MIND→CURATE pipeline (alpha.19 Chunk 7.1). DECIDE is deterministic (refusal markers / coordination markers / C7 / length>200). EXTRACT (NEW over alpha.18.1) invokes the LLM via the judge-delegator persona when DECIDE=delegate AND length>200 OR vibe_case=C7; validated by drift_judge (eval_type=subtask_extraction). Failures surface as needs_human with alternatives[] (the harness picks one). MIND composes the system_prompt per subtask via composeSystemPrompt. CURATE registers subagent bindings via agent_memory.Sav…
| Parameter | Type | Description |
|---|---|---|
task_description * | string | ≥10 char description of the work to be routed. |
vibe_case * | string | Canonical vibe_case (C1..C7 per spec.go:14-16). |
operator | string | Operator id (INV-1 audit owner). Empty defaults to orchestrator_delegate. |
parent_agent_id | string | Optional parent agent id (CURATE subagent binding). Empty when not chained from a vibe_publish. |
parent_session_id | string | Optional parent session id (CURATE subagent binding). Empty when outside a session context. |
dark_memory_llm_key_add
Store an LLM provider API key in the OS keyring (Windows Credential Manager / Keychain / Secret Service). Validates the key against the provider's free probe by default. The key value is never returned by any tool.
| Parameter | Type | Description |
|---|---|---|
key * | string | The API key value. |
provider * | string | Canonical provider id: anthropic, openai, google, deepseek, minimax, minimax-cn, zhipu, moonshot, qwen. |
validate | boolean | Run the free probe (GET /models) before storing. Default true. |
dark_memory_llm_key_list
List LLM provider key status. NEVER returns the key value — only whether a key exists, its source (keyring/env/none), and validation state.
| Parameter | Type | Description |
|---|---|---|
provider | string | Optional filter: one canonical provider id. Empty = all. |
dark_memory_llm_key_remove
Delete a stored LLM provider key from the OS keyring. If the provider also has an env-var key, that one stays (the env is owned by the harness and cannot be modified here).
| Parameter | Type | Description |
|---|---|---|
provider * | string | Canonical provider id to remove from the keyring. |
dark_memory_llm_provider_status
Return the LLM provider routing view: active provider (last successful judge call), per-provider key/cooldown/health, and the DARK_JUDGE_PROVIDER pin. Read-only, no key values.
dark_memory_llm_provider_bind
Bind an LLM provider to the ACTIVE project's NLIConfig (Phase 14 T-303). provider_id must start with 'judge-' (LLMJudge path) or 'chat-' (NLI path). Persists endpoint + timeout_ms + model_rev (NEVER the secret: the API key lives in the OS keyring and the config keeps only the provider_id). auth_token is optional: when given it is stored in the OS keyring, when omitted a credential must already exist there (use llm_key_add). auth_token is NEVER echoed in the result.
| Parameter | Type | Description |
|---|---|---|
endpoint * | string | OpenAI-compatible /v1/chat/completions URL. |
provider_id * | string | Provider id. Must start with 'judge-' (LLMJudge, Phase 14 T-301) or 'chat-' (NLI, Phase 13 T-201). Other prefixes are rejected. |
auth_token | string | Bearer token. Optional: when omitted, a credential must already exist in the OS keyring for this provider (call llm_key_add). When given it is stored in the OS keyring, NEVER in the project config. NE… |
model_rev | string | Best-effort model revision identifier (e.g. 'MiniMax-M3'). Optional. |
timeout_ms | integer | Per-request timeout in milliseconds. If 0/missing, defaults to 30000. |
dark_memory_llm_provider_probe
Probe an LLM provider (Phase 14 T-303). Sends a tiny /v1/chat/completions request with system='reply with pong', user='ping'. Resolves endpoint+auth_token from active project's NLIConfig when provider_id is given; uses explicit endpoint+auth_token otherwise. Returns latency_ms + status + body excerpt. NO persistence.
| Parameter | Type | Description |
|---|---|---|
auth_token | string | Override auth_token. Used together with endpoint when provider_id is empty. |
endpoint | string | Override endpoint. Required when provider_id is empty. |
provider_id | string | Probe the active project's primary binding for this provider_id. Looks up endpoint + auth_token from NLIConfig. |
timeout_ms | integer | Per-request timeout in milliseconds. Defaults to 5000. |
dark_memory_judge
Run a single LLM-as-judge verdict on content. Eval types: drift_judge, brand_match, compliance_check, pii_detect, prompt_injection_scan, grounding_check, mindset_compose, mindset_quality, spec_test_alignment, mutation_score_check, test_quality_review, security_coverage, resilience_check, oracle_quality. v2.20.0 T12 (spec 1276): for drift_judge, supply artifact_ref instead of content — the judge resolves the artifact (file/git_sha/url/spec_id/artifact_id) and NLI-anchors the verdict. The Content field is ignored on this branch. For other eval_types, Content remains the canonical input. v2.4.2…
| Parameter | Type | Description |
|---|---|---|
eval_type * | string | |
agent_id | string | v2.4.2: optional Mem0 agent_id (LLM identity). Resolved priority: caller input > projects.default_agent_id > empty string. |
artifact_ref | object | v2.20.0 T12 (spec 1276): artifact reference for drift_judge. Anchors the judge to a resolved artifact (file/git_sha/url/spec_id/artifact_id). Required for drift_judge (the Content field is ignored whe… |
content | string | Text to evaluate. Required for non-drift_judge eval_types. For drift_judge, supply artifact_ref instead — the Content field is ignored when artifact_ref is set (v2.20.0 T12, spec 1276). |
model | string | |
no_enrich | boolean | v2.4.2: opt-out escape hatch. Default false (enrichment runs for brand_match + compliance_check). When true, Judge passes raw content to the LLM. |
persona_id | string | v2.17.0 (spec 1155): explicit persona id. If empty, the registry resolves by eval_type default (lex-smallest ID wins). Use judge_list_personas to enumerate available personas. |
spec_intent | string | v2.17.0 (spec 1155): one-paragraph description of what the artifact should be. Included in the user prompt as the 'Spec intent' section. Required for drift_judge with artifact_ref (the hypothesis). |
target_id | string | |
target_type | string | |
vibe_case | string | v2.12.0: vibe-flow case of the artifact (C1=code, C2=text, ...). When set, the judge uses a G-Eval rubric for that case (technical criteria for code). Empty = legacy generic prompt. |
dark_memory_consensus
Run N-shot LLM-as-judge and return modal verdict + confidence interval. N clamped to [1, 7]. v2.4.2: forwards agent_id + no_enrich to all N samples so each gets the same agent-scoped enrichment. v2.17.0: forwards persona_id and spec_intent to all N samples so each uses the same persona. v2.20.0 T09 (spec 1276): for drift_judge, supply artifact_ref to anchor consensus to a resolved artifact (recommended). The Content field is then ignored.
| Parameter | Type | Description |
|---|---|---|
eval_type * | string | |
agent_id | string | v2.4.2: forwarded to all N Judge samples for consistent agent-scoped enrichment. |
artifact_ref | object | v2.20.0 T09 (spec 1276): artifact reference for drift_judge consensus. Required for the artifact-anchored path (recommended for drift_judge). Ignored for other eval_types. |
content | string | Text to evaluate. Required for non-drift_judge eval_types. For drift_judge, supply artifact_ref instead — the Content field is ignored when artifact_ref is set. |
model | string | |
n | integer | Sample count. Default 3, clamped to [1, 7]. |
no_enrich | boolean | v2.4.2: forwarded to all N Judge samples for consistent opt-out semantics. Default false. |
persona_id | string | v2.17.0 (spec 1155): explicit persona id; forwarded to all N samples. |
spec_intent | string | v2.17.0 (spec 1155): spec intent; forwarded to all N samples. Required for drift_judge with artifact_ref. |
target_id | string | |
target_type | string | |
vibe_case | string | v2.12.0: vibe-flow case (C1=code, C2=text, ...). Forwarded to all N samples so each uses the same G-Eval rubric. Empty = legacy. |
dark_memory_judgment_history
List recent SSD evaluations (judge verdicts) for an eval_type + target. Read-only.
| Parameter | Type | Description |
|---|---|---|
eval_type | string | Filter by eval type. Empty = all. |
limit | integer | Max rows. Default 50. |
target_id | string | Filter by target id. Empty = all. |
dark_memory_judge_list_personas
List the registered persona registries (compiled defaults + Markdown overrides). Read-only. v2.17.0 (spec 1155).
dark_memory_active_policy
Return the active policy snapshot: constitution id+ver+sha, drift status, active mods, canary presence. Read-only.
dark_memory_load_constitution
Return the full constitution row (label, source, parsed JSON) for the given id+version. Read-only.
| Parameter | Type | Description |
|---|---|---|
constitution_id * | string | |
version | string | Version string. Empty = latest. |
dark_memory_memory_state
Return the runtime memory snapshot: driver, schema version, table list, per-table counts, active project, canary presence. Read-only.
dark_memory_writes
List recent write_audit rows (every Save emits one, per INV-1). Read-only.
| Parameter | Type | Description |
|---|---|---|
actor | string | Filter by actor. Empty = all. |
limit | integer | Max rows. Default 50. |
session_id | string | Filter by session_id. Empty = all. |
dark_memory_anomalies
List recent anomaly events from the Error Observatory: severity=fatal clusters + domain=gate refusals (INV-3 canary hits, INV-5 cache mismatches, capability/scope refusals). Read-only. Kind filter: fatal | gate. Empty = both.
| Parameter | Type | Description |
|---|---|---|
kind | string | Filter by kind (fatal | gate). Empty = all. |
limit | integer | Max rows. Default 50. |
dark_memory_health_ping
Return the runtime health snapshot (server identity, DB connectivity, schema version, canary, registry counts, uptime, latency). Read-only, no audit side-effects, safe to call from a liveness probe.
dark_memory_audit_export
Export the write_audit chain as a HMAC-chained JSONL stream (ADR-016). Operators can save the stream to disk and verify it offline via dark_memory_audit_verify or any tool that recomputes HMAC-SHA256 over (chain_prev || canonical_row_bytes). Read-only; emits a write_audit_export audit row. Requires DARK_AUDIT_HMAC_KEY env var to be set at boot — otherwise returns ErrAuditNoKeyring.
| Parameter | Type | Description |
|---|---|---|
actor | string | Filter by actor. |
key_id | string | Key id to stamp on chain_key_id (must be in keyring). Default v1. |
limit | integer | Max rows. 0 = no limit. |
project_id | string | Filter by project_id. Empty = all projects. |
session_id | string | Filter by session_id. |
since_id | integer | id > this value; 0 = all rows. |
write_path | string | Filter by write_path. |
dark_memory_audit_verify
Verify a HMAC-chained JSONL audit stream against the local keyring (ADR-018). Returns one of: ok | broken | unknown_key | malformed. On broken/unknown_key/malformed, first_bad_id points to the first row that failed verification. Read-only; emits a write_audit_verify audit row. Requires DARK_AUDIT_HMAC_KEY env var to be set at boot — otherwise returns ErrAuditNoKeyring.
| Parameter | Type | Description |
|---|---|---|
stream * | string | JSONL stream from dark_memory_audit_export (raw string, not base64). |
key_id | string | Override the key id to use (must be in keyring). Empty = use whatever the stream declares. |
dark_memory_error_list
List error_events backlog rows (durable, classified error clusters). Filters: domain, severity, resolved, session_id, tool_name, since. Newest-first (last_seen_at DESC). Read-only. Pass cross_project=true to list across project boundaries (admin elevation — requires DARK_ERROR_OBS_OPERATOR_OVERRIDE=armed OR the caller's operator id in DARK_ERROR_OBS_ADMIN_OPERATORS).
| Parameter | Type | Description |
|---|---|---|
cross_project | boolean | When true, returns rows from ALL projects instead of filtering by the active project_id. Requires DARK_ERROR_OBS_OPERATOR_OVERRIDE=armed OR the caller's operator id in DARK_ERROR_OBS_ADMIN_OPERATORS. |
domain | string | Classification axis. Empty = all. |
limit | integer | Max rows. Default 50, max 200. |
operator | string | Caller operator id for cross-project allow-list check. Empty = resolve from the active session. |
resolved | boolean | Filter by triage state. Omitted = unresolved only (backlog default). true = resolved only. |
session_id | string | Filter by session. Empty = all. |
severity | string | Impact axis. Empty = all. |
since | string | RFC3339: only events with last_seen_at >= this. Empty = all. |
tool_name | string | Filter by originating tool. Empty = all. |
dark_memory_error_get
Get one error_events cluster by id (Error Observatory). Returns null when the id does not exist in the active project (INV-7 existence-leak parity). Read-only. Pass cross_project=true to look up across project boundaries (admin elevation).
| Parameter | Type | Description |
|---|---|---|
id * | integer | Row id. |
cross_project | boolean | When true, looks up the row across all projects (admin elevation). Requires DARK_ERROR_OBS_OPERATOR_OVERRIDE=armed OR the caller's operator id in DARK_ERROR_OBS_ADMIN_OPERATORS. |
operator | string | Caller operator id for cross-project allow-list check. Empty = resolve from the active session. |
dark_memory_error_summary
Return aggregate Error Observatory metrics: total clusters, unresolved, errors in the last N hours (default 1h), counts by domain + severity, top-5 recurring unresolved clusters. GLOBAL scope (cross-project) so operators see overall health. Read-only.
| Parameter | Type | Description |
|---|---|---|
hours | integer | Recent window for errors_last_hour. Default 1. Max 168 (7d). |
dark_memory_error_resolve
Mark an error_events cluster as resolved with an operator note (backlog triage). Idempotent: resolving an already-resolved cluster returns ok. Returns ErrNotFound when the id does not exist in the active project (INV-7). Operator-gated (INV-1 audit via WriteContext). Pass cross_project=true to resolve across project boundaries (admin elevation); emits a write_audit row with Actor=error_resolve_cross_project_{admin,override}.
| Parameter | Type | Description |
|---|---|---|
id * | integer | Cluster id to resolve. |
cross_project | boolean | When true, resolves the cluster across project boundaries (admin elevation). Requires DARK_ERROR_OBS_OPERATOR_OVERRIDE=armed OR the caller's operator id in DARK_ERROR_OBS_ADMIN_OPERATORS. Emits a writ… |
note | string | Resolution note (root cause, fix ref, ...). Optional. |
operator | string | Caller operator id for cross-project allow-list check. Empty = resolve from the active session. |
dark_memory_event_log
Phase 12 T-105: filterable list of events from the polymorphic events table (single table for modifications + progress, schema v32). Honors INV-7 (active project scoping). Returns rows in id ASC order (LangFuse timeline). Limit clamped to [1, 10000]. Read-only.
| Parameter | Type | Description |
|---|---|---|
actor | string | Filter by actor (system | agent_id | operator:<name>). |
kind | string | Filter by kind (modification | progress). |
limit | integer | Max rows to return. Default 1000, clamped to 10000. |
process_id | string | Filter by process_id (drift-<artifactID> | delegate-<taskID>). |
session_id | string | Filter by session_id (LangFuse trace). |
since_id | integer | Cursor: return rows with id > since_id (LangFuse flush pattern). |
target_row_id | integer | Filter by target_row_id (the row being modified). |
target_table | string | Filter by target_table (e.g. agent_memory, drift_report, delegation_trees). |
dark_memory_event_replay
Phase 12 T-105: return the event tree rooted at event_id (1-level children). Useful for inspecting a delegate_intent tree (DECIDE→EXTRACT→MIND→CURATE→COMPLETED) or an async drift_judge lifecycle (started→in_progress→completed). Returns root + direct children. Read-only.
| Parameter | Type | Description |
|---|---|---|
event_id * | integer | Root event id (the id of the root event itself, not its parent). |
include_children | boolean | Default true. When false, return only the root event. |
dark_memory_admin_migrate
Run pending schema migrations on the active Store. Returns the migration status before + after.
dark_memory_admin_schema_status
Return the current schema version, applied migrations, and the list of tables in the active Store. Read-only.
dark_memory_admin_vacuum
Run a vacuum on the active Store. SQLite: reclaims space; Postgres: no-op (autovacuum handles GC).
| Parameter | Type | Description |
|---|---|---|
days_old | integer | GC rows older than N days. 0 = no time-based GC. |
dry_run | boolean | Report counts only, no delete. |
tables | array | Restrict to these table names. Empty = all retention-policy tables. |
dark_memory_vlp_handle_event
Drive the VLP state machine by applying an event to a session. Returns the new state, turn count, and next-action hint. The single entry point that opencode/claude code/etc. use to drive a vibe-loop-protocol session through its lifecycle (idle → drafting_spec → spec_active → drift_judging → complete/needs_human/aborted).
| Parameter | Type | Description |
|---|---|---|
event * | string | Canonical event name. Use 'drift_log' with verdict=aligned/drift_detected/needs_human. |
session_id * | string | The session id (matches dark_memory_session_start's return value). |
minset | string | Current minset mode (Recon/Exploit/Adjudicate/Synthesize/Hunt). Empty = none. |
verdict | string | Required for drift_log; ignored (or omit) for all other events. |
dark_memory_embedder_setup_prompt
Return the embedder consent prompt (v2.9.1-alpha PR-2.1, row 164 §3). Tool surfaces a structured status (auto | ask) + the verbatim prompt text the harness's LLM should surface to the user when dark-memory boots without a detected provider. Single call per project lifecycle; the choice is persisted to agent_memory so dark-memory never asks again. PR-2.1: response includes Harness + HarnessSource so the LLM can suggest the harness-native rung.
dark_memory_judge_util_normalize
Run text through the T5 normalization pipeline (NFKC + zero-width strip + unicode-escape decode + Cyrillic homoglyph map + lowercase + whitespace collapse). Operator-facing primitive for inspecting what the validator sees. Deterministic and pure.
| Parameter | Type | Description |
|---|---|---|
text * | string | Text to normalize |
dark_memory_judge_util_validate_overrides
Scan text for the 10 prompt-injection override patterns. Returns the list of hits (each is a pattern id, severity, description, and a 40-char normalized context snippet). Severity=block triggers EC-003 short-circuit in the judge pipeline.
| Parameter | Type | Description |
|---|---|---|
text * | string | Text to scan for the 10 override patterns |
dark_memory_judge_util_pattern_descriptions
List the canonical 10 prompt-injection override patterns (OP-1..OP-10) with descriptions. Stable across versions.
dark_memory_judge_util_verify
Verify an Ed25519 signature over content. Returns valid=true on a clean match, valid=false otherwise. Malformed inputs return an error envelope.
| Parameter | Type | Description |
|---|---|---|
content * | string | Raw content bytes (text) that were signed |
public_key * | string | Ed25519 public key as 64-char hex (32 bytes) |
signature * | string | Ed25519 signature as base64 (64 bytes decoded) |
dark_memory_judge_util_verify_hash
Verify that the SHA-256 of content matches the supplied hex digest. Returns match=true on a clean match, match=false otherwise.
| Parameter | Type | Description |
|---|---|---|
content * | string | Raw content bytes (text) |
hash_hex * | string | Expected SHA-256 hash as 64-char lowercase hex (256 bits) |
dark_memory_judge_util_trace
Generate a fresh W3C Trace Context. Returns trace_id (32 hex), span_id (16 hex), trace_flags (01=sampled), and the canonical traceparent header.
dark_memory_judge_util_validate_trace
Validate a W3C traceparent string against the grammar. Returns valid=true on match. The W3C spec is case-insensitive for hex.
| Parameter | Type | Description |
|---|---|---|
traceparent * | string | W3C traceparent header to validate |