Agent Memory Bridge

v0.39.1
io.github.zzhang82/agent-memory-bridge Checked 1 day ago Published 14 days ago

Local MCP memory for coding agents: store decisions with their reasons, recall them on request.

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

store

Store one entry in the bridge for later retrieval or coordination. Use this tool when you want to persist a compact memory record or write a signal that another workflow can poll later. Write durable knowledge as `kind="memory"` and transient coordination events as `kind="signal"`. Returns the stored entry identifier, timestamp, and duplicate information. Repeated `memory` writes may deduplicate; `signal` writes are intended to remain append-like.

ParameterTypeDescription
content *stringMachine-readable memory payload to persist. Prefer compact claims, fixes, decisions, or signals over long transcript-style prose.
namespace *stringLogical memory bucket to write into, such as `project:<workspace>`, `domain:<name>`, or `global`.
actorOptional writer identity such as an agent, reviewer, or user profile.
client_session_idOptional external client session or thread identifier when the caller can provide one.
client_transportOptional transport label such as `stdio`, `http`, or `sse`.
client_workspaceOptional external client workspace root or project label when useful for provenance.
correlation_idOptional shared identifier used to link related writes, handoffs, or workflow events across entries.
expires_atOptional ISO-8601 expiry timestamp for a signal. Use this when a coordination event should stop being claimable after a deadline.
kindstring`memory` stores durable knowledge for later retrieval. `signal` stores pollable coordination events for handoff or workflow triggers.
session_idOptional session or thread identifier used to trace entries back to one conversation or work unit.
source_appOptional source name for the writer, such as `codex`, `codex-session-watcher`, or another local automation.
source_clientOptional external client identifier such as `codex`, `antigravity`, or `claude-code`.
source_modelOptional external model identifier such as `gpt-5.4` or `gemini-2.5-pro`.
tagsOptional stable labels for retrieval and filtering, for example `kind:gotcha`, `domain:retrieval`, or `project:demo-app`.
titleOptional short label for UI display or scanning. Keep it concise and stable when possible.
ttl_secondsOptional relative expiry in seconds for a signal. Useful for short-lived handoff or review events.

recall

Recall matching entries or poll for new signals from the bridge. Use this tool to search durable memory, filter by metadata, or poll for fresh coordination signals. For issue-like work, prefer project and domain recall before external search. For workflow polling, pass `since`, an empty query, and `kind="signal"`. Empty-query Signal recall returns a `next_since` cursor for the next polling cycle; other recall modes return `next_since=null`. The cursor tracks later insertions, not status changes to older Signals.

ParameterTypeDescription
namespace *stringNamespace to search or poll, such as `project:<workspace>`, `domain:<name>`, or `global`.
actorOptional actor filter for entries written by a specific agent or user.
correlation_idOptional correlation filter to recall entries linked to the same workflow, handoff, or task.
evidence_contextOptional caller-declared evidence labels. Only `model`, `harness`, and `chat_template` are accepted; signed receipts contain bounded SHA-256 digests, never raw values. These labels are not authenticat…
kindOptional type filter. Use `memory` for durable knowledge recall and `signal` for coordination or polling flows.
limitintegerMaximum number of entries to return. Smaller values keep context tighter.
querystringOptional text query for full-text recall. Leave empty to use filter-only retrieval or polling.
session_idOptional session filter to narrow results to one conversation or run.
signal_statusOptional status filter for signals. Useful when you want only pending handoffs, currently claimed work, or already-acked coordination events.
sinceOptional cursor for polling only entries newer than a previously seen same-namespace entry id used as a Signal polling anchor. Requires an empty query and `kind="signal"`.
tags_anyOptional OR-style tag filter. Any matching tag is enough for an entry to qualify.

browse

Browse recent items when you do not yet know what to search for. Use this tool to inspect a namespace by filters alone. It is useful when you want to see recent memory, scan a domain bucket, or confirm that signals are flowing before writing a more specific recall query.

ParameterTypeDescription
namespace *stringNamespace to inspect without a text query, such as `project:<workspace>`, `domain:<name>`, or `global`.
domainOptional domain tag to narrow the list, using the plain domain name without the `domain:` prefix.
kindOptional type filter. Use `memory` for durable knowledge and `signal` for coordination events.
limitintegerMaximum number of items to list. Smaller values keep browse output readable.
signal_statusOptional status filter when browsing signal entries.

stats

Return a quick health summary for one namespace. Use this tool when you want to inspect what is in the bridge without opening SQLite directly. It returns total item count, a kind breakdown, top domains, and the oldest and newest entry timestamps for the namespace.

ParameterTypeDescription
namespace *stringNamespace to summarize, such as `project:<workspace>`, `domain:<name>`, or `global`.

forget

Delete one stored entry by id. Use this tool to remove a bad memory, an accidental write, or a signal that should no longer exist. The response tells you whether anything was deleted and returns the removed item metadata when a match is found.

ParameterTypeDescription
id *stringExact memory identifier to remove. Use this when a record is noisy, wrong, or no longer belongs in the bridge.

feedback

Record structured retrieval feedback for one recalled memory result. Evidence is append-only/shadow-only. Provenance is caller-declared and not authenticated. This tool does not mutate memory records, recall results, or ranking behavior.

ParameterTypeDescription
memory_id *stringExact recalled memory id being evaluated.
namespace *stringNamespace used by the recall receipt, such as `project:<workspace>` or `global`.
recall_receipt *stringSigned recall receipt token returned by a durable memory text `recall` response.
result_rank *integerOne-based rank of the memory in the recalled result list.
feedback_typestringAppend-only feedback event type. Defaults to a root vote.
outcomeDeclared retrieval outcome. Required for votes and corrections; optional for retractions.
provenanceOptional declared provenance fields such as source_app, source_client, source_model, client_session_id, client_workspace, client_transport, or actor.
reasonOptional compact reason. Required for `misleading` and `outdated` outcomes.
supersedes_feedback_idCurrent feedback head id. Required for corrections and retractions; omitted for root votes.

promote

Manually promote one stored memory to a stronger durable record type. Use this tool when you know a record should be treated as a learn, gotcha, or domain note even if the reflex layer has not promoted it yet. Promotion keeps the same id and updates the stored title, tags, and structured content in place.

ParameterTypeDescription
id *stringExact memory identifier to reclassify. Use this when a stored record should be treated as a stronger kind of durable memory.
to_kind *stringTarget durable record type. Use `learn` for reusable claims, `gotcha` for pitfalls and fixes, or `domain-note` for broader synthesized guidance.

annotate

Explicitly enrich one durable memory without pretending the write was a new fact. Use this after `store` reports `duplicate_with_new_metadata`. The original content remains unchanged; title/tag changes and additional provenance are written to an auditable annotation record.

ParameterTypeDescription
id *stringExact durable memory id whose metadata should be explicitly enriched.
actorOptional identity of the human or agent performing the explicit annotation.
provenanceOptional additional provenance fields such as source_client, source_model, session_id, or correlation_id. They are retained in the annotation audit trail.
tagsOptional tags to add. Existing tags remain and the annotation is audited.
titleOptional replacement title. Content and memory identity remain unchanged.

revise

Create a new durable memory that explicitly supersedes an older record. The predecessor remains available for audit. The bridge adds an exact `supersedes` edge and records the revision receipt instead of silently mutating content in place.

ParameterTypeDescription
id *stringExact durable memory id that the new revision supersedes.
replacement_content *stringComplete replacement content for the new auditable memory revision.
actorOptional identity responsible for the revision.
provenanceOptional provenance overrides for the new revision.
reasonOptional compact reason stored with the predecessor/successor audit link.
tagsOptional tags for the new revision. Defaults to compatible predecessor tags.
titleOptional title for the new revision. Defaults to the predecessor title.

export

Export bridge content into a readable or portable format. Use this tool when you want to inspect a namespace outside the MCP client, create a human-readable snapshot, or move memory into another system without opening the database directly.

ParameterTypeDescription
namespace *stringNamespace to export, such as `project:<workspace>`, `domain:<name>`, or `global`.
formatstringOutput format for the exported memory. Use `markdown` for readable notes, `json` for structured interchange, or `text` for plain text.
kindOptional type filter for the export.
limitintegerMaximum number of entries to export in one call.
querystringOptional full-text query to narrow the export. Leave empty to export by filters alone.
signal_statusOptional status filter when exporting signal entries.
tags_anyOptional OR-style tag filter. Any matching tag is enough for an entry to be included.

begin_run

Start one explicit, stateless run and return server-minted run/work-item IDs. The bridge does not retain an implicit current run. Callers must pass the returned handles to later event, read, and completion calls. Idempotent retries return the same handles and reject conflicting payloads.

ParameterTypeDescription
goal *stringRoot goal for the run. Keep it bounded and outcome-oriented.
idempotency_key *stringCaller-generated retry key. The bridge stores only its SHA-256 digest and returns the original server-minted run for an identical retry.
workspace_key *stringDeclared workspace scope for this run, such as `project:<workspace>`. The server uses it to reject cross-workspace run access.
acceptance_criteriaOptional structured acceptance criteria with stable id or criterion_id values.
agent_idOptional declared agent or worker identifier. It is provenance, not authenticated identity.
budgetOptional bounded JSON budget metadata, such as token or time limits.
chat_template_digestOptional lowercase SHA-256 digest of the chat template.
constraintsOptional bounded constraints declared for this run.
continuation_of_run_idOptional same-workspace prior run that this run continues.
evidence_profilestringEvidence governance profile. governed-v2 requires typed events and server-minted receipts.
harness_digestOptional lowercase SHA-256 digest of the harness configuration.
memory_scopesOptional declared memory scopes available to the run. These do not grant authorization.
model_digestOptional lowercase SHA-256 digest of the model identity or configuration.
non_goalsOptional bounded non-goals declared for this run.
provenanceOptional bounded declared provenance for the run.
risk_levelstringDeclared run risk level; high and critical preflight reviews require a rollback plan.
thread_idOptional external thread or conversation identifier.
tool_schema_digestOptional lowercase SHA-256 digest of the tool schema used by the run.

record_run_event

Append one structured event to a run's durable authority ledger. Sequence allocation, event persistence, child work-item creation, and projection updates occur in one transaction. This tool never sets an implicit current run.

ParameterTypeDescription
event_type *stringStructured v1 or governed-v2 logical event type.
idempotency_key *stringCaller-generated retry key scoped to this run; only its SHA-256 digest is stored.
run_id *stringServer-minted run identifier returned by `begin_run`.
summary *stringBounded factual event summary. Raw transcript or hidden reasoning is not allowed.
workspace_key *stringDeclared workspace scope that owns the run.
agent_idOptional declared agent responsible for the event.
event_schema_versionintegerEvent payload schema version; governed-v2 runs require version 2.
evidenceOptional structured evidence references, limited to 32 KiB.
expected_database_epochDatabase epoch CAS precondition; required by governed-v2 runs.
expected_last_sequenceOptional compare-and-swap precondition. The append is rejected without writes when the authority ledger has a different latest sequence.
expected_run_generationRun generation CAS precondition; required by governed-v2 runs.
expected_work_item_statusOptional compare-and-swap precondition for an existing work item. Conflicts report the actual authority-derived status.
memory_attributionRequired receipt-bound or explicit manual memory attribution for memory_recalled, memory_applied, and memory_rejected. Recall receipt tokens are validated but never persisted.
owner_agent_idOptional declared owner for a newly created child work item.
parent_work_item_idParent work-item identifier, used only when creating a child work item.
payloadOptional structured JSON payload, limited to 32 KiB. Raw reasoning fields are rejected.
provenanceOptional bounded declared provenance for the event.
thread_idOptional external thread or conversation identifier for the event.
work_item_goalGoal for a new child work item, used only with `work_item_started`.
work_item_idExisting server-minted work-item identifier. Omit only for `work_item_started` when creating a child work item.

get_run

Read current run/work-item projections plus append-only events for reconnect or compaction recovery.

ParameterTypeDescription
run_id *stringServer-minted run identifier returned by `begin_run`.
workspace_key *stringDeclared workspace scope that owns the run.
event_limitintegerMaximum number of ordered events to return in this page.
since_sequenceintegerReturn only events whose per-run sequence is greater than this value.

complete_run

Append or correct a run outcome without changing memory ranking or policy. On new runs, `verified_success` requires a matching current server-minted governed receipt. Outcome corrections form an append-only supersession chain.

ParameterTypeDescription
evaluator_type *stringEvidence source class. Agent self-report cannot establish verified success.
idempotency_key *stringCaller-generated retry key scoped to this run; only its SHA-256 digest is stored.
outcome *stringDeclared outcome for this append-only outcome revision.
run_id *stringServer-minted run identifier returned by `begin_run`.
workspace_key *stringDeclared workspace scope that owns the run.
evaluator_digestOptional lowercase SHA-256 digest of the evaluator implementation or configuration.
evaluator_versionOptional bounded evaluator version label.
evidenceStructured outcome evidence, limited to 32 KiB.
expected_database_epochDatabase epoch CAS precondition; required by governed-v2 runs.
expected_last_sequenceCurrent run sequence CAS precondition; required by governed-v2 runs.
expected_run_generationRun generation CAS precondition; required by governed-v2 runs.
metricsOptional structured outcome metrics, limited to 32 KiB.
provenanceOptional bounded declared provenance for the outcome.
regression_of_run_idDistinct same-workspace run with a current `verified_success` outcome; required for a `regression` outcome.
supersedes_outcome_idCurrent outcome head to supersede when recording a correction.
termination_reasonOptional bounded reason the run ended.
verification_receipt_idServer-minted governed verification receipt. Ordinary MCP callers cannot mint receipts; required for verified_success on new runs.

claim_signal

Claim one signal with a short lease for lightweight work coordination. Use this when a worker should take ownership of a pending signal before it acts. If `signal_id` is omitted, the bridge claims the next eligible signal in the namespace that matches the optional filters, with a small fairness bias inside the oldest pending window so one polling consumer does not keep winning by accident.

ParameterTypeDescription
consumer *stringStable worker or agent identifier that will own the lease, for example `reviewer-a` or `worker:planner`.
namespace *stringNamespace that holds the coordination events to claim, such as `project:<workspace>`.
correlation_idOptional workflow correlation id used to claim signals from one handoff thread.
lease_secondsintegerHow long the claim lease should last before another consumer can reclaim the signal.
signal_idOptional exact signal id to claim. Leave empty to claim the next eligible signal.
tags_anyOptional OR-style tag filter used to narrow which pending signals are claimable.

extend_signal_lease

Extend the active lease on one claimed signal. Use this when a worker still owns a signal but needs more time before another consumer can reclaim it. Expired leases cannot be extended; those signals must be reclaimed instead. Hard signal expiry still takes precedence over lease renewal.

ParameterTypeDescription
consumer *stringConsumer identity that currently owns the lease. Only the active claimant can extend it.
id *stringExact signal id whose active lease should be extended.
lease_seconds *integerAdditional lease duration in seconds. The bridge extends from the current lease end when possible, but never beyond the signal's hard expiry.

ack_signal

Acknowledge one claimed or pending signal so downstream polling can stop treating it as active work.

ParameterTypeDescription
id *stringExact signal id to acknowledge after the work is done.
consumerConsumer identity that must match the owner of an active claim. It may be omitted only when acknowledging a pending, unclaimed signal.