Integration guide

AtMem separates the model-agnostic memory engine, a host-neutral control contract, and automated host-specific adapters.

Python

from atmem import Memory

memory = Memory("memories.db")
memory.remember("user-1", "My preferred editor is Vim.", session_id="s1")
records = memory.recall("user-1", "preferred editor", limit=5)
report = memory.audit("user-1")
memory.close()

The canonical database remains usable without an external embedding provider. In 2.2 AtMem creates a dependency-free local vector sidecar automatically; installing a higher-quality local embedding provider is optional.

MCP

atmem mcp --db ~/.atmem/memories.db --subject user-1
ToolPurpose
memory_rememberAdmit authenticated text through policy and provenance checks.
memory_observeAdmit a typed, quarantined text observation of host-controlled media.
memory_recallLegacy diagnostic search; its ranking does not authorize prompt injection.
memory_recall_decisionReturn the shared governed retrieval decision and revalidated context package.
memory_get_recordRead one canonical record by ID.
memory_get_sourceRead the source episode associated with a record.
memory_recall_blockRender bounded recall for direct context injection.
memory_personaRender a bounded subject persona.
memory_context_packRender a cache-aware persona and recall context pack.
memory_captureRecord an interpreted memory and bind it to source evidence.
memory_listList canonical memories and lifecycle status.
memory_forgetDelete matching memory and return a receipt.
memory_forget_artifactDelete all memory derived from one exact media byte-stream digest.
memory_promoteApprove a quarantined memory for recall.
memory_auditRead the evidence timeline for a subject.
memory_verifyVerify audit and storage integrity.
memory_graph_statusInspect the derived graph index.
memory_graph_mergesList reviewer-gated graph merge proposals.
memory_graph_historyInspect graph entity and merge history.
memory_log_actionBind a host action or response digest to the audit timeline.

An MCP connection alone does not authenticate the user or prove that returned context reached the model. The host must supply authenticated identity and bind actual context delivery and response evidence.

Generic control adapter

atmem control shadow --host generic --memory-db ~/.atmem/memories.db
atmem control mcp

The generic host MCP records authenticated memory candidates, returns a bounded context decision, confirms exact exposure, and records model/tool/turn events. It starts fail-closed in shadow and returns inject: false until an operator activates it. Use atmem control operator-mcp only from a trusted operator process for search, review, verification, export, acknowledgement, topology, activation, and return-to-shadow actions.

The MCP process cannot observe the model request by itself. The host must emit truthful events and inject only the exact context AtMem authorized. See the generic adapter contract.

OpenClaw control adapter

atmem openclaw install
atmem control status
atmem control activate
atmem control restore

The OpenClaw adapter automates the host-specific parts: complete native-memory discovery, historical copy, ongoing shadow synchronization, prompt and response binding, semantic model interpretation, native-path protection, gateway verification, and exact native-state restore.

Pydantic AI and LangGraph

AtMem ships optional automatic lifecycle adapters for Pydantic AI and LangChain agents running on LangGraph. See the framework adapter guide for installation, identity, capture, injection, exposure, tool, failure, and multi-agent examples.

AtBot intelligence companion

AtBot is maintained in this repository under packages/atbot, but ships as a separate process and wheel so model-framework dependencies never enter AtMem's authority runtime:

# 2.2 repository development
python -m pip install -e './packages/atbot' -e '.'
atmem atbot setup

The 2.2 AtMem distribution declares the exact AtBot version as a required dependency. There is no longer a separate AtBot opt-in extra; model selection and remote egress remain explicit user choices. The packages remain separate wheels and processes, and AtMem authority code does not import AtBot.

AtMem discovers and calls AtBot over its loopback companion protocol. AtBot does not import AtMem or open its database, and AtMem retains deterministic capture and hybrid-retrieval fallback when the companion is unavailable.

Building another host adapter

A complete adapter must implement:

  1. authenticated user and session identity;
  2. enumeration and verified copy of all existing host memory;
  3. shadow synchronization without changing model context;
  4. model-semantic capture of user intent rather than transcript keyword scraping;
  5. bounded recall and proof of actual context injection;
  6. response/tool receipt binding;
  7. atomic activation with capability checks;
  8. restore material captured before mutation;
  9. verified restore, including handling divergent files or state;
  10. honest reporting of any evidence the host cannot expose.

The generic adapter supplies the control and evidence protocol but cannot prove that an implementation reports its boundaries truthfully. Describe native-state migration and restore as complete only when the host adapter also meets the copy, mutation, and restore requirements above.