Midas

v1.1.1
io.github.vornicx/midas Checked 1 hour ago Published 6 days ago

Local-first, source-traceable agent memory with offline capture and recall

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

remember Remember

Store a memory for later recall. content: text to remember (a fact, decision, preference, or conversation turn). kind: note | chat | fact | preference | constraint | mission. importance: 1-5 (higher is weighted up in recall and protected from forgetting). 0 = auto-derive from content (no LLM) — concrete facts score higher than chit-chat. session: conversation/thread id used to group related memories. provenance: planning | action | observation | user_confirmation. Use user_confirmation only when the user explicitly confirmed the content; external actions…

ParameterTypeDescription
content *string
actorstring
importanceinteger
kindstring
namespacestring
provenancestring
sessionstring

capture Capture turn

Offer a turn to memory; Midas decides whether to keep it (no LLM). Forward anything that might be durable — a fact, decision, preference, constraint, or correction. Midas scores its importance and keeps it only if it clears the relevance policy and isn't a duplicate, so you can capture freely without polluting memory. Returns whether it was stored and why (so you learn the bar). This is the workhorse for hands-off, automatic remembering. kind: note | chat | fact | preference | constraint | mission. provenance: planning | action | observation | user_confirmation.

ParameterTypeDescription
content *string
actorstring
kindstring
namespacestring
provenancestring
sessionstring

remember_code Remember code memory

Capture a CODE memory tagged by category + project, for the coding-agent views. code_kind: one of architecture_decision | dependency_choice | convention | bug_fixed | recurring_failure | forbidden_action | command_worked | command_failed. Use forbidden_action for rules the agent must not violate (they gate `check_forbidden_action`); afterwards `project_state` shows the live state by category. No LLM. Set provenance="user_confirmation" only when the user explicitly confirmed it.

ParameterTypeDescription
code_kind *string
content *string
project *string
importanceinteger
namespacestring
provenancestring
sessionstring

recall Recall

Retrieve relevant memories with deterministic, source-traceable evidence. Returns exact stored text plus provenance/source/timestamps and, by default, score components (relevance, importance_norm, recency). No LLM rewrites or rationales are generated. Set hybrid=true to fuse BM25 lexical matching with semantic recall — useful when the query is an exact identifier (an error code, a function name) rather than a paraphrase. as_of: ISO date (YYYY-MM-DD) for a HISTORICAL query — "what did memory say on that date": later records are excluded and revised beliefs resolve t…

ParameterTypeDescription
query *string
as_ofstring
explainboolean
fusionstring
hybridboolean
kind
limitinteger
min_importanceinteger
min_relevancenumber
namespacestring
poolinteger

inspect_memory Inspect memory

Inspect one stored memory by id without search, mutation, or embedding exposure.

ParameterTypeDescription
memory_id *string

build_context Build context

Assemble a budgeted, prompt-ready context block for a query. Highest-value memories first, with same-session neighbours pulled in, trimmed to token_budget. Drop the returned string straight into an LLM prompt. It uses lean memory lines by default; call `recall` or `inspect_memory` when you need full provenance/source evidence. Each line is dated and the header anchors today's date so the reader can resolve relative time. Standing user directives ("from now on…", "always…") are pinned in regardless of query relevance.

ParameterTypeDescription
query *string
hybridboolean
limitinteger
namespacestring
token_budgetinteger

memory_state Memory state

The CURRENT durable state of a project/scope: the live (non-superseded) decisions, constraints, facts, and preferences, newest first. Use this to ONBOARD into a project or before planning — when a broad 'what's the current state?' has no single matching turn, so `recall` under-retrieves. Not a similarity search and no LLM. kinds: optional comma list (constraint,fact,preference,mission) to narrow; empty = all durable kinds.

ParameterTypeDescription
kindsstring
limitinteger
namespacestring

memory_diff Memory diff

What CHANGED in memory in the last `hours`: beliefs newly added, and beliefs revised (old -> new). The 'what's new since our last session' view for resuming long-horizon work without re-reading everything. Deterministic, no LLM.

ParameterTypeDescription
hoursnumber
namespacestring

resume Resume session

START OF SESSION: everything needed to pick up where the last session left off, in ONE call — pinned standing directives, live forbidden rules, what changed in the last `hours` (default: a week), the current durable state, open commitments, and unresolved memory conflicts. `context` is prompt-ready and token-budgeted; use it silently, then work. Complements `build_context` (which needs a query): resume is the query-less session start. Deterministic, no LLM.

ParameterTypeDescription
hoursnumber
namespacestring
projectstring
token_budgetinteger

memory_conflicts Memory conflicts

Live beliefs that CONTRADICT each other with neither superseding the other — the multi-agent failure mode where two clients wrote opposite facts into the shared memory and both stayed live. Returns ranked candidate pairs (NLI-scored when the local NLI model is enabled, else a same-slot heuristic: numbers disagree / one side negates). Midas never resolves these silently: verify with the user, then `forget` the wrong one or capture the corrected value (which supersedes). No LLM.

ParameterTypeDescription
limitinteger
namespacestring

open_loops Open loops

Unresolved commitments — work someone said WOULD be done and never closed — oldest (most overdue) first. Continuity is not only facts: check this when resuming so promised work isn't silently dropped. Record one with `remember_commitment`; close it with `close_loop`.

ParameterTypeDescription
limitinteger
namespacestring
projectstring

remember_commitment Remember commitment

Record a commitment (an OPEN LOOP): work you or the user said WILL be done — a promised fix, a follow-up, a migration to finish. It stays visible in `open_loops`/`resume` until closed with `close_loop`, so promises survive across sessions. due: optional free-text deadline.

ParameterTypeDescription
content *string
duestring
namespacestring
projectstring
sessionstring

close_loop Close loop

Close an open commitment: records the resolution and supersedes the open loop with it, so `open_loops` stops returning it while the promise -> resolution history stays auditable. Get `loop_id` from `open_loops` (the record id).

ParameterTypeDescription
loop_id *string
resolution *string

project_state Project state

The current code-state of a project for a coding agent, grouped by code_kind (architecture_decision, bug_fixed, convention, forbidden_action, dependency_choice, ...). Live (non-superseded) memories only — call this to ONBOARD into a project, or to see what is decided and what is forbidden before acting. Deterministic, no LLM. Capture code memories with the SDK's `midas.coding.remember_*` helpers (they tag `code_kind` + `project`).

ParameterTypeDescription
project *string
limitinteger

check_forbidden_action Check forbidden action

Before a code action, check it against the project's live `forbidden_action` rules. Two tiers, by confidence (deterministic, no LLM; superseded/retired rules ignored): - `forbidden` (HIGH confidence, lexical match) → do NOT do it; refuse and cite `rules`. - `possibly_forbidden` (ADVISORY, semantic/paraphrase match) → ASK the user before proceeding; the semantic signal is noisy (~31% false positives, `eval.forbidden_eval`), so it warns, not blocks. Separate from the provenance/currency gate (`check_memory_use`).

ParameterTypeDescription
action *string
project *string

audit_use Audit memory use

The compliance audit artifact for a memory-justified use: the guard decision + the full provenance and belief-revision history of every supporting memory + an attributability score (fraction of evidence with both a source and an actor). Hand this to an auditor to prove WHY an action is or isn't justified. Source-traceable, deterministic, no LLM.

ParameterTypeDescription
query *string
intended_usestring
namespacestring

memory_policy Memory policy

Return the exact MCP-injected memory policy text and guard parameters.

check_memory_use Check memory use

Decide whether recalled memory may justify the intended use. intended_use: planning | answer | external_action | destructive_action. External/destructive actions require user_confirmation provenance; otherwise ask the user first.

ParameterTypeDescription
query *string
acting_agentstring
intended_usestring
limitinteger
namespacestring

forget Forget memory

Delete a single memory by id (ids come from `recall`). Supersession chains through the deleted record are relinked, so belief-revision history stays walkable.

ParameterTypeDescription
memory_id *string

forget_matching Forget matching

Topic-level erasure ("forget what you know about X") with a reviewable audit. Matches memories at relevance >= min_relevance. By default this is a DRY RUN: it returns what *would* be deleted so you (or the user) can review; call again with dry_run=false to delete. Deletion bypasses durability protections — an explicit erasure request outranks retention — and returns the full list of removed memories as the audit trail.

ParameterTypeDescription
query *string
dry_runboolean
limitinteger
min_relevancenumber
namespacestring

forget_all Forget all

Clear this project's memories, or the whole store in shared mode.

maintain Maintain memory

Run a no-LLM memory-maintenance pass and return the deletion audit. Bounds storage and keeps recall clean without sending anything to an LLM — the enterprise retention / "right to be forgotten" lever, with a full audit of exactly what was removed: - consolidate_threshold: if > 0, dedup near-duplicate restatements at this cosine (e.g. 0.95). - max_records: if > 0, forget the lowest-value tail until at most this many remain. - min_value: if > 0, forget every (non-durable, unprotected) memory scoring below this value. - ttl: age-based retention, "kind=days" comm…

ParameterTypeDescription
consolidate_thresholdnumber
max_recordsinteger
min_valuenumber
ttlstring

stats Memory stats

Memory stats: total count, breakdown by kind, namespace, and the temporal-tier distribution. tiers: short (<= 1 day) / medium (<= 1 week) / long (older) — the short/medium/multi-day horizons. Pass namespace to scope the counts to one project/agent scope.

ParameterTypeDescription
namespacestring