artemis-memory-mcp) is a Python Model Context Protocol server built on the official MCP SDK. It exposes the canonical Postgres/Neon memory ledger to agents as four typed tools, and authorizes every call through the GovernedGate — combining a capability grant (memory:read or memory:write) with a per-namespace scope check.
Use this server when you want agents to read and write the durable memory ledger under governance, with strict ATP validation and namespace isolation, rather than talking directly to an Obsidian vault.
This is a different surface from the Agentic Memory Layer (MCP server). The Agentic Memory Layer is a Node.js REST shell backed by an Obsidian vault;
artemis-memory-mcp is a Python MCP server backed by the Postgres/Neon ledger, with Obsidian and the vector index treated as best-effort projections. Both can run side by side.When to use it
Chooseartemis-memory-mcp when you need:
- A governed memory surface where every call is validated as an ATP envelope, checked against a principal’s capability grants, and scoped to one namespace.
- The Postgres/Neon ledger as the source of truth, with Obsidian and the vector index as durable-outbox projections.
- Structured, typed tool schemas (
write-memory,read-memory,search-memory,get-memory-status) rather than a REST surface. - A native MCP transport (
stdiofor local co-processes, authenticated Streamable HTTP for network deployments).
Tools
The server exposes four MCP tools. Each takes a typed input that includes anAtpEnvelope, and returns a typed result. Content and metadata are stored on the canonical Postgres ledger; projections (Obsidian, vector) are written best-effort through the durable outbox.
Governance and namespace scopes
Every tool call is authorized throughGovernedGate in two layers:
- Capability grant. The caller must hold
memory:readfor read-side tools, ormemory:writeforwrite-memory. - Namespace scope. The caller must additionally hold
memory:namespace:{namespace}for the exact namespace being addressed, or the wildcardmemory:namespace:*for all namespaces.
memory:write or memory:read grant on its own is not sufficient — every call also needs the matching namespace scope. This makes it possible to grant an agent read/write access to one namespace without exposing every other tenant’s memory on the same ledger.
Grants are supplied as a comma-separated list in ARTEMIS_MCP_CAPABILITIES for the stdio transport, or in ARTEMIS_MCP_HTTP_SCOPES for the HTTP transport.
Projection status semantics
write-memory commits the record to the canonical Postgres ledger and then dispatches best-effort projections (for example, Obsidian and vector). get-memory-status reports the delivery status of each projection for one immutable record version, using four values:
A projection failure never removes the committed SQL record. If Obsidian or the vector backend is unreachable, the Postgres ledger row is still the source of truth, and the failed projection can be retried from the outbox.
Transports
The server supports two transports. The default isstdio for local co-process deployments; --http runs an authenticated Streamable HTTP endpoint at /mcp.
stdio
Best for embedding the server as a subprocess of a local agent or CLI. The transport principal is the process itself, and capabilities are supplied through the environment.Streamable HTTP
Best for network deployments where multiple clients hit one server. The transport authenticates every request with a bearer token, and the token is mapped to a synthetic principal whose capability grants come fromARTEMIS_MCP_HTTP_SCOPES.
ARTEMIS_MCP_HTTP_SCOPES must include the transport-wide artemis:memory scope in addition to the capability and namespace grants. Requests presenting a bearer token without artemis:memory are rejected at the transport before any tool call.
Configuration
Nothing is opened at import time. Configuration is validated and connections are built lazily per operation, so a misconfigured deployment fails on the first tool call rather than at process startup.Database migrations
The server targets a specific schema. Before pointingARTEMIS_MEMORY_DATABASE_URL at any database, apply the two migrations in order:
0001_memory_write_through.sql— creates the base ledger, outbox, and provenance tables.0002_memory_server_contract.sql— evolves the schema for namespace/key identity, principal and provenance columns, thevectoroutbox target, and thememory_completion_provenancetable.
0001 applied will fail at the first tool call.
Example: end-to-end write and status check
The following sequence starts the server over stdio, writes one memory record, and then checks its projection status. It assumes the target database has both migrations applied.write-memory with an ATP envelope in the agents namespace, receives a WriteMemoryResult containing the new record_id and projection_states, and can call get-memory-status with the same record_id to see whether each projection has reached succeeded, is still pending, or has failed and is queued for retry.
Related
- Agentic Memory Layer (MCP server) — the Node.js REST shell backed by an Obsidian vault.
- Artemis Agentic Memory Layer — the Python client and trust-aware wrapper for the Obsidian-backed layer.
- Hybrid Memory Bus — how the memory subsystem composes ledger, projections, and retrieval.
