dark-memory-mcp

v4.0.0
io.github.Opita-Code/dark-memory-mcp Checked 34 minutes ago Published 2 days ago

Persistent 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).

ParameterTypeDescription
display_name *stringHuman-readable label (1-128 chars).
project_id *stringKebab-case public id (3-64 chars, lowercase alnum + hyphen, must start and end with alnum).
constitution_idstringOptional constitution id to bind the project to (INV-7 constitution scoping).
constitution_verstringOptional constitution version (paired with constitution_id).
default_agent_idstringOptional 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.…
descriptionstringOptional free-form description (max 512 chars).
nli_configobjectOptional 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.

ParameterTypeDescription
operator *stringOperator id (human or agent) starting the session.
project_id *stringProject namespace (INV-7). Use 'default' for the legacy project.
constitution_idstring
constitution_verstring
notesstring

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.

ParameterTypeDescription
session_id *stringThe 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.

ParameterTypeDescription
session_id *string

dark_memory_session_close

Close the active session. Returns the write/run/item summary.

ParameterTypeDescription
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.

ParameterTypeDescription
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.

ParameterTypeDescription
operator *stringThe human/agent identity to recover for (e.g. dark-agent).
lookbackstringSearch 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.

ParameterTypeDescription
lookbackstringUsed only in discovery form. Default 24h.
operatorstringUsed only in discovery form (original_session_id empty).
original_session_idstringThe closed_aborted session to resurrect from. If empty, discovery form: operator + lookback find the latest candidate.
reasonstringOptional reason: explicit_recovery, harness_restart, ...

dark_memory_research_topic

Run a research query against the registered ResearchBackend set. Returns deduplicated, confidence-ranked items.

ParameterTypeDescription
query *stringThe natural-language research query.
intentstringOptional intent tag (e.g. 'cve', 'academic'). Default 'general'.
max_itemsintegerCap on returned items. Default 20.
thread_idstringOptional 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.

ParameterTypeDescription
query *string
max_tokensintegerToken budget for the response. Default 4000.
min_confidencenumberDrop 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.

ParameterTypeDescription
query *stringThe follow-up query.
thread_id *stringExisting thread id to resume.
max_itemsinteger

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.

ParameterTypeDescription
surface *stringWhich resource group to read
force_embeddedbooleanIf true, bypass DARK_AGENT_BOOTSTRAP_DIR and use the embedded copy. Diagnostic; mostly for drift tests.
targetstringFor 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.

ParameterTypeDescription
artifact *object
spec *object
async_drift_checkbooleanDefault 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_checkbooleanDefault true. Set false to skip drift_judge.
session_idstring

dark_memory_vibe_spec

Create a new spec with structured task validation (unique ids, no cycles, depends_on consistency).

ParameterTypeDescription
tasks *
vibe_case *string
constitutionstring
session_idstring
specstring

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.

ParameterTypeDescription
artifact_id *integer

dark_memory_resolve_drift

Operator gate action on a drift report: accept (artifact correct as-is) or reject (artifact wrong).

ParameterTypeDescription
decision *string
drift_id *integer
operator_id *string
notestring

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).

ParameterTypeDescription
spec_id *integervibe_specs.id to compile.
optionsobject

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.

ParameterTypeDescription
intent *stringWhat the work is. The candidates are ranked against it, and the judge validates it.
spec_id *integerThe spec this plan describes. The plan is a spec with a plan on it.
max_candidatesintegerCap on the shortlist. Default 8. The shortlist is a proposal, not a catalogue.
max_judge_callsintegerOverride the tier's proposed judge-call budget.
max_tool_callsintegerOverride the tier's proposed tool-call budget.
session_idstringThe 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.

ParameterTypeDescription
session_idstringThe session that owns the call.
spec_idintegerThe 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.

ParameterTypeDescription
decision *stringexecute approves the plan; edit reopens it with a prompt; cancel stops it.
decided_bystringWho decided. Defaults to the human.
edit_promptstringThe reviewer's prompt. Required when decision is edit.
session_idstringThe session that owns the call.
spec_idintegerThe 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.

ParameterTypeDescription
provider *stringOAuth provider to authenticate with. 'google' = Google Gemini (60 RPM, 1500 RPD free). 'huggingface' = HuggingFace Hub (1000 RPD free, supports Device Code Flow for headless).
scopesarrayOverride 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.

ParameterTypeDescription
providerstringOptional: 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).

ParameterTypeDescription
provider *string

dark_memory_artifact_context

Return the context projection of an artifact: id, type, spec, brand, jurisdiction, disclosure, validation status, timestamps. Read-only.

ParameterTypeDescription
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.

ParameterTypeDescription
spec_id *integer

dark_memory_session_context

Return the context projection of a session. Read-only.

ParameterTypeDescription
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.

ParameterTypeDescription
scope *string
project_idstringOptional. Defaults to active project.
session_idstringRequired when scope=session.
since_tokenintegerOptional 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.

ParameterTypeDescription
content *stringThe memory payload. Required.
kind *string
operator *stringOperator id (for ownership + audit). Required.
agent_idstringMem0 agent_id (LLM that owns the memory). Optional. v2.3.0.
bind_sessionbooleanIf true, tag the row with the active session id. Default false (v2.3.0 change; pre-v2.3.0 was implicitly true).
expires_atstringRFC3339. Optional TTL hint (sweeper follow-up).
memory_typestringMem0 three-class taxonomy. Optional; empty = unclassified. v2.3.0.
pinnedboolean
project_idstringExplicit 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_idstringSession 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…
tagsstringComma-separated, normalized lowercase.
titlestring

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).

ParameterTypeDescription
agent_idstringRequired for scope=agent (Mem0 agent_id). v2.3.0.
include_archivedboolean
kindstring
limitinteger
memory_typestringMem0 three-class taxonomy filter. v2.3.0.
operatorstringCaller identity for scope=operator resolution. v2.3.0.
pinned_onlyboolean
project_idstringExplicit 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.
scopestring
session_idstringSession 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…
tagstring

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.

ParameterTypeDescription
operator *stringOperator 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 *stringFTS5 search query. Alphanumeric + . - _ / + * only; AND/OR/NOT/NEAR rejected.
agent_idstringOptional. Scopes results to rows where agent_id == this value (Mem0 agent_id). v2.3.0.
kindstringOptional. Filter to one operator-kind (note, observation, decision, ...).
limitinteger
memory_typestringOptional. Mem0 three-class taxonomy filter. v2.3.0.
project_idstringExplicit 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.
scopestringOwnership 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_idstringSession 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).

ParameterTypeDescription
id *integerRow id.
project_idstringExplicit 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_idstringSession 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.

ParameterTypeDescription
id *integer
operator *stringOperator id (INV-1 audit). Required.
contentstring
expires_atstring
memory_typestringMem0 three-class taxonomy. Empty string clears. v2.3.0.
pinnedboolean
project_idstringExplicit 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_idstringSession 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…
tagsstring
titlestring

dark_memory_agent_memory_archive

Soft-delete an agent memory (sets archived_at). Recoverable with list(include_archived=true).

ParameterTypeDescription
id *integer
operator *stringOperator id (INV-1 audit). Required.
project_idstringExplicit 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_idstringSession 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…

ParameterTypeDescription
operator *stringOperator id (INV-1 audit). Required.
subagent_id *stringOpaque uuid the parent generates for this sub-agent. Required.
task_description *stringWhat the sub-agent should do. Used for context selection. Required.
include_pinnedbooleanInclude pinned memories in the delegation context.
include_todosbooleanInclude open todos in the delegation context.
max_tokensintegerContext recap token budget. 0 = no context, just session metadata.
register_subagentbooleanRegister 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_secondsintegerSubagent 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.

ParameterTypeDescription
id *integerRow 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.

ParameterTypeDescription
operator *stringOperator id (INV-1 audit). Required.
subagent_id *stringOpaque uuid the principal generated when spawning the subagent. Required.
parent_agent_idstringPrincipal's resolved agent_id for audit provenance. Optional; defaults to projects.default_agent_id.
ttl_secondsintegerTTL 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.

ParameterTypeDescription
operator *stringOperator id (must match the one used in subagent_register). Required.
subagent_id *stringThe 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.

ParameterTypeDescription
query *stringFree-text query. BM25 seeds come from SearchAgentMemory(query). Empty/whitespace returns (nil, nil) — no error.
depthintegerHop count: 0 (seeds only), 1 (default — direct neighbors), 2 (neighbors-of-neighbors). 3+ returns ErrDepthOutOfRange.
hop_limitintegerMax rows added per hop. 0 → default 50.
seed_limitintegerMax BM25 seeds to start the BFS from. 0 → default 20.
total_limitintegerCap 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.

ParameterTypeDescription
new_mem_id *integermem_id of the row that supersedes (must stay 'active').
old_mem_id *integermem_id of the row being superseded (becomes decision_state='superseded').
reason *stringRequired human-readable reason. Stored on decision_transitions.reason.
evidencestringOptional evidence pointer (URL, file path, audit row id). NULL when empty.
triggerstringTrigger label for the transition row. Default 'operator_action'. Free-form.
valid_timestringRFC3339Nano — 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.

ParameterTypeDescription
t *stringRFC3339Nano — the 'as-of' timestamp. The result includes rows whose valid_time <= t.
kindstringOptional kind filter (decision, observation, ...). Empty = any kind.
limitintegerMax 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).

ParameterTypeDescription
task_description *stringWhat the subagent should do. Becomes the seed for procedural composition.
vibe_case *string
model_floorstringMinimum capability for the subagent (sonnet|opus|haiku|inherit). Optional.
operatorstringOperator 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…

ParameterTypeDescription
task_description *string≥10 char description of the work to be routed.
vibe_case *stringCanonical vibe_case (C1..C7 per spec.go:14-16).
operatorstringOperator id (INV-1 audit owner). Empty defaults to orchestrator_delegate.
parent_agent_idstringOptional parent agent id (CURATE subagent binding). Empty when not chained from a vibe_publish.
parent_session_idstringOptional 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.

ParameterTypeDescription
key *stringThe API key value.
provider *stringCanonical provider id: anthropic, openai, google, deepseek, minimax, minimax-cn, zhipu, moonshot, qwen.
validatebooleanRun 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.

ParameterTypeDescription
providerstringOptional 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).

ParameterTypeDescription
provider *stringCanonical 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.

ParameterTypeDescription
endpoint *stringOpenAI-compatible /v1/chat/completions URL.
provider_id *stringProvider id. Must start with 'judge-' (LLMJudge, Phase 14 T-301) or 'chat-' (NLI, Phase 13 T-201). Other prefixes are rejected.
auth_tokenstringBearer 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_revstringBest-effort model revision identifier (e.g. 'MiniMax-M3'). Optional.
timeout_msintegerPer-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.

ParameterTypeDescription
auth_tokenstringOverride auth_token. Used together with endpoint when provider_id is empty.
endpointstringOverride endpoint. Required when provider_id is empty.
provider_idstringProbe the active project's primary binding for this provider_id. Looks up endpoint + auth_token from NLIConfig.
timeout_msintegerPer-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…

ParameterTypeDescription
eval_type *string
agent_idstringv2.4.2: optional Mem0 agent_id (LLM identity). Resolved priority: caller input > projects.default_agent_id > empty string.
artifact_refobjectv2.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…
contentstringText 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).
modelstring
no_enrichbooleanv2.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_idstringv2.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_intentstringv2.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_idstring
target_typestring
vibe_casestringv2.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.

ParameterTypeDescription
eval_type *string
agent_idstringv2.4.2: forwarded to all N Judge samples for consistent agent-scoped enrichment.
artifact_refobjectv2.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.
contentstringText 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.
modelstring
nintegerSample count. Default 3, clamped to [1, 7].
no_enrichbooleanv2.4.2: forwarded to all N Judge samples for consistent opt-out semantics. Default false.
persona_idstringv2.17.0 (spec 1155): explicit persona id; forwarded to all N samples.
spec_intentstringv2.17.0 (spec 1155): spec intent; forwarded to all N samples. Required for drift_judge with artifact_ref.
target_idstring
target_typestring
vibe_casestringv2.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.

ParameterTypeDescription
eval_typestringFilter by eval type. Empty = all.
limitintegerMax rows. Default 50.
target_idstringFilter 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.

ParameterTypeDescription
constitution_id *string
versionstringVersion 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.

ParameterTypeDescription
actorstringFilter by actor. Empty = all.
limitintegerMax rows. Default 50.
session_idstringFilter 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.

ParameterTypeDescription
kindstringFilter by kind (fatal | gate). Empty = all.
limitintegerMax 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.

ParameterTypeDescription
actorstringFilter by actor.
key_idstringKey id to stamp on chain_key_id (must be in keyring). Default v1.
limitintegerMax rows. 0 = no limit.
project_idstringFilter by project_id. Empty = all projects.
session_idstringFilter by session_id.
since_idintegerid > this value; 0 = all rows.
write_pathstringFilter 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.

ParameterTypeDescription
stream *stringJSONL stream from dark_memory_audit_export (raw string, not base64).
key_idstringOverride 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).

ParameterTypeDescription
cross_projectbooleanWhen 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.
domainstringClassification axis. Empty = all.
limitintegerMax rows. Default 50, max 200.
operatorstringCaller operator id for cross-project allow-list check. Empty = resolve from the active session.
resolvedbooleanFilter by triage state. Omitted = unresolved only (backlog default). true = resolved only.
session_idstringFilter by session. Empty = all.
severitystringImpact axis. Empty = all.
sincestringRFC3339: only events with last_seen_at >= this. Empty = all.
tool_namestringFilter 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).

ParameterTypeDescription
id *integerRow id.
cross_projectbooleanWhen 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.
operatorstringCaller 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.

ParameterTypeDescription
hoursintegerRecent 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}.

ParameterTypeDescription
id *integerCluster id to resolve.
cross_projectbooleanWhen 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…
notestringResolution note (root cause, fix ref, ...). Optional.
operatorstringCaller 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.

ParameterTypeDescription
actorstringFilter by actor (system | agent_id | operator:<name>).
kindstringFilter by kind (modification | progress).
limitintegerMax rows to return. Default 1000, clamped to 10000.
process_idstringFilter by process_id (drift-<artifactID> | delegate-<taskID>).
session_idstringFilter by session_id (LangFuse trace).
since_idintegerCursor: return rows with id > since_id (LangFuse flush pattern).
target_row_idintegerFilter by target_row_id (the row being modified).
target_tablestringFilter 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.

ParameterTypeDescription
event_id *integerRoot event id (the id of the root event itself, not its parent).
include_childrenbooleanDefault 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).

ParameterTypeDescription
days_oldintegerGC rows older than N days. 0 = no time-based GC.
dry_runbooleanReport counts only, no delete.
tablesarrayRestrict 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).

ParameterTypeDescription
event *stringCanonical event name. Use 'drift_log' with verdict=aligned/drift_detected/needs_human.
session_id *stringThe session id (matches dark_memory_session_start's return value).
minsetstringCurrent minset mode (Recon/Exploit/Adjudicate/Synthesize/Hunt). Empty = none.
verdictstringRequired 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.

ParameterTypeDescription
text *stringText 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.

ParameterTypeDescription
text *stringText 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.

ParameterTypeDescription
content *stringRaw content bytes (text) that were signed
public_key *stringEd25519 public key as 64-char hex (32 bytes)
signature *stringEd25519 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.

ParameterTypeDescription
content *stringRaw content bytes (text)
hash_hex *stringExpected 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.

ParameterTypeDescription
traceparent *stringW3C traceparent header to validate