Skip to content
Mnemosyne

Cognitive memory
for AI agents.

Named for the Titaness who remembered everything. Long-term memory for your agents that knows what was true, when, and who may see it. Self-hosted, on your own Postgres.

Open source · Apache-2.0 · Postgres + pgvector

10kinds of memory
37MCP tools
49CLI commands
202REST routes

Lethe · Why it exists

Agents forget.

In the myth, the dead drank from the river Lethe and lost everything they knew. An agent does the same when a conversation ends. Pasting chunks from a vector store into the prompt hides it, and adds three problems that grow with scale.

I

No provenance

A chunk comes back, but nobody can say where it came from, how sure the system is or whether it is still true.

II

No time

“Acme is on Pro” and “Acme upgraded to Enterprise” are both just vectors. Nothing says which one holds today.

III

No isolation

Memory shared by several customers and separated only by a WHERE clause is one forgotten clause away from a leak.

The underworld had a second spring, and it was Mnemosyne’s: whoever drank from it remembered. Here it is a server. It stores typed memories with their source, their confidence and the period in which they hold, and lets the database keep each workspace apart.

It fits if your agents serve several users or customers, you need to audit what an agent knew at a given moment, or you want the memory on your own infrastructure.

It is more than you need if you have a single-user notebook that only wants similarity search. Plain pgvector will do.

The atrium · The dashboard

See what your agents remember.

Memory was a palace long before it was a database: you leave each thing in a room and walk back to it. The dashboard is that palace, and every room has one job.

The atrium: what was written and recalled today
The catalog: every memory, searchable
The columbarium: the sessions they came from
The constellation: the graph, in 2D or 3D

Also inside: the waters of Lethe to test a recall, the frieze for members, the seal for API keys, the herbarium for health and the quipu for the audit log.

The constellation · The memory graph

A graph, not a list.

The Greeks remembered the sky by drawing lines between stars. Mnemosyne does it with what your agents know: entities, episodes and decisions joined by typed relations that carry confidence and provenance. Some are stated, some are inferred by meaning, and some come from the facts two memories share.

19 entities · 10 episodes · 8 decisions · 28 relations

A workspace as the dashboard draws it. The data is fictional.

The holdings · What you get

One server, the whole memory.

The palaceMemory

Typed memory

Ten kinds, from facts and decisions to episodes and tasks, each recalled and forgotten in its own way.

Bitemporal facts

Two times on every fact: when it holds in the world and when the system learned it. History is never destroyed, and recall can answer as of any past instant.

Hybrid recall

Full-text and vector search in one call, with an optional LLM rerank.

Sessions become memories

Start a session, stream the turns and collapse it: facts, decisions and entities come out.

Conflicts and corrections

Contradicting facts are flagged for you or the agent to resolve. A correction keeps the lineage.

Reminders

A memory that comes back on its own: at a time, or when a condition shows up in a later recall.

The keepersSecurity and teams

Isolation in the database

Postgres row-level security on every tenant table: the database keeps workspaces apart.

Sensitivity tiers

public, internal, confidential and restricted on every memory. A key only reads up to its ceiling.

Privacy and erasure

Personal data is redacted when a memory is written, confidential memories are encrypted at rest, and erasing a person destroys their keys for good.

Users, roles and keys

API keys carry scopes and a ceiling, each agent can get its own policy of scopes, namespaces and rate limits, and sensitive actions can require approval.

Audit

An audit log, a timeline of what was learned and when, and export behind an approval.

Data residency

Give the server a region and each new workspace is pinned to it. A server in another region refuses to serve that workspace.

The architectureRunning it

Your own LLM

OpenAI, Anthropic, Google, Cohere, Mistral, Voyage, AWS Bedrock or a local Ollama, even one provider per task. The spend is yours, with an optional daily cap.

Many ways in

MCP server, CLI, TypeScript client, Python and Go SDKs, REST, gRPC and WebSocket.

Events out

Webhooks signed with HMAC-SHA256 and live subscriptions over WebSocket.

Federation

Two servers share facts through signed, incremental pulls over TLS 1.3. What arrives starts with the lowest trust and comes back in recall marked with its source.

Observability

Health checks, a metrics endpoint and four Grafana dashboards.

Plugins

Load the built-in plugins by name, or your own npm packages, each with its own config, state and sync schedule.

Alpha: the main paths work and are tested, and the API can still change. Several of these features are beta; the status page in the repository marks each one.

The spring of Mnemosyne · How recall works

Recall in seven stages.

A recall draws a memory back out of the water. It runs the same seven stages every time, and relevance decides the order: how recently a memory was used can only break a tie.

recall(“how often does firmware ship”)An example recall, on fictional data

I

Parse

Turns the question into an embedding and reads the filters of the call: the workspace, how many hits, what this key may see.

query → embedding + filters

query
“how often does firmware ship”
embedding
one vector, from your own model
workspace
Larkspur Robotics
hits wanted
3
key ceiling
internal

One more step is opt-in: a rerank of the page by an LLM, with rerank: true.

The columbarium · Sessions

Sessions become memories.

In a columbarium each niche keeps what is left of one life. Here each niche keeps what is left of one conversation: when it ends, the engine reads it in the background and keeps the facts, decisions and entities worth keeping.

  1. I

    Start a session

    One call when the conversation opens.

  2. II

    Send each turn

    User and assistant, as they happen.

  3. III

    Collapse it

    The engine extracts what should last. Any later session can recall it.

import { MnemosyneClient } from "@mnemo-ai/client-ts"; const memory = new MnemosyneClient({  url: "http://localhost:3939",  apiKey: process.env.MNEMO_KEY!,}); // I. Start a sessionconst session = await memory.createSession({  agentId: "ops-assistant",}); // II. Send each turnawait memory.appendTurn(session.id, {  role: "user",  content: "Robots keep stopping in aisle 14.",});await memory.appendTurn(session.id, {  role: "assistant",  content: "Reflective shelves. Firmware 4.2 fixes it.",}); // III. Collapse itawait memory.collapseSession(session.id, {  strategy: "auto",}); // Later, from any other sessionconst { hits } = await memory.recall({  query: "why do robots stop in aisle 14",  topK: 5,});

The Muses · MCP

37 tools for your agent.

Mnemosyne’s daughters were the Muses: every art, the myth says, is memory put to work. Her server gives your agent 37 tools in eight families. Connect through MCP and it gets them all; the mnemo CLI covers the same ground.

  • I

    Remember and recall

    Write a memory and get it back by meaning, by words or by date.

    6 tools
  • writes

    memory_remember

    Saves a lasting fact. Saving the same thing twice does not duplicate it.

  • reads

    memory_recall

    Brings back the most relevant memories for a question.

  • reads

    memory_search

    Searches by exact words and by meaning, with filters for kind, sensitivity and date.

  • reads

    memory_fact

    Opens one fact or decision in full, by its ID.

  • reads

    memory_timeline

    Shows what changed in a period: what your agent learned this week.

  • reads

    memory_context

    Tells the agent where it is: workspace, user, statistics and the other workspaces in reach.

  • II

    Correct and forget

    Change what is known without losing how it came to be known.

    5 tools
  • writes

    memory_update

    Corrects a fact by replacing it: the old version closes and the new one keeps the lineage.

  • writes

    memory_forget

    Archives a fact. It stops being recalled, stays in the audit trail and can be restored.

  • writes

    memory_pin

    Protects a fact from being merged away when duplicates are consolidated.

  • writes

    memory_relocate

    Moves a fact to another workspace: it closes here and a successor opens there.

  • deletes

    memory_purge

    Deletes for good. It needs its own permission and is meant for test workspaces.

  • III

    Structure

    Name the things your agent talks about and say how they relate.

    5 tools
  • writes

    memory_entity

    Creates or updates a named thing: a person, an organisation, a project, a concept.

  • writes

    memory_relate

    Links two memories with one of nine fixed verbs.

  • writes

    memory_hyperedge

    Ties three or more facts together when a pair is not enough.

  • writes

    memory_decide

    Records a decision together with the reasons behind it.

  • reads

    memory_suggest_topic_key

    Proposes a stable key for a topic, so a new value replaces the old one instead of piling up.

  • IV

    Sessions

    Turn a conversation into memories when it ends.

    3 tools
  • writes

    memory_episode_start

    Opens an episode: a named conversation the engine will read later.

  • writes

    memory_session

    Works on the open session: pin a fact, add a turn, collapse it or discard it.

  • writes

    memory_episode_end

    Closes the episode and extracts its facts from the transcript.

  • V

    Work and know-how

    Keep what the agent is doing and what it has learned to do.

    6 tools
  • writes

    memory_task

    Tracks tasks with an owner, a status and dependencies.

  • writes

    memory_event

    Writes an event to the workspace log. Events cannot be edited afterwards.

  • writes

    memory_reasoning

    Stores a chain of thought, from question to conclusion, to use it again.

  • writes

    memory_strategy

    Keeps reusable rules of the form: when this happens, do that.

  • writes

    memory_workflow

    Keeps workflow definitions the agent can run again.

  • writes

    memory_skill

    Keeps skill definitions the agent can use again.

  • VI

    Keep it clean

    Find contradictions and duplicates before they mislead.

    4 tools
  • writes

    memory_judge

    Lists facts that contradict each other and resolves them: keep one, keep both or merge.

  • reads

    memory_compare

    Puts two facts side by side: what differs and how they relate.

  • writes

    memory_consolidate

    Runs a pass that merges or retires duplicate facts.

  • writes

    memory_self_edit

    Lets the agent edit its own memory: append, replace, strengthen, weaken, reflect or link.

  • VII

    Look ahead and reflect

    Remember to remember, and know what is missing.

    4 tools
  • writes

    memory_remind_when

    Sets a reminder that fires at a time or when a condition shows up.

  • reads

    memory_anticipate

    Suggests what the agent will probably need next, from past patterns.

  • reads

    memory_introspect

    Reports what the agent knows about a subject, where the gaps are and how confidence moves.

  • writes

    memory_compose

    Derives new conclusions from recalled facts with declared inference rules.

  • VIII

    Operate

    Check that everything works and manage who is inside.

    4 tools
  • reads

    memory_status

    Health check: the server version and the state of each store.

  • reads

    memory_stats

    Workspace figures: live and archived facts, conflicts, embedding coverage and recall hit rate.

  • reads

    memory_doctor

    Runs eight diagnostics, from database access to tool registration.

  • writes

    memory_workspace

    Lists workspaces and members, or creates one, invites someone and sets roles.

Every tool and its schema

The threshold · Quickstart

Run it on your machine.

You need Docker with about 8 GB of memory and 12 GB of free disk. The local stack runs Postgres, Redis, the server and a local Ollama, so it needs no cloud API key. The first run takes 5 to 15 minutes.

I Start the stack

git clone https://github.com/lucasmailland/mnemosynecd mnemosyne/dockercp .env.example .envdocker compose up -ddocker exec mnemosyne-ollama ollama pull bge-m3docker exec mnemosyne-ollama ollama pull qwen2.5:3b

II Connect your agents

npx -y @mnemo-ai/cli install

The local stack is for trying it out: it does not isolate workspaces from each other. The production setup does.

Read the full guide