universal-memory

universal-memory

A vendor-agnostic cognitive persistence layer for AI agents. Eliminate the "repetition tax" by transporting your context, preferences, and history across sessions. Features an auto-adaptation engine that syncs global instructions to ensure operational cohesion and optimize token usage across any LLM or multi-agent workflow.

Category
Visit Server

README

<p align="center"> <img src="assets/umem-logo-transparent.png" alt="Universal Memory logo" width="720"> </p>

Universal Memory (umem)

PyPI version Python Version License: MIT

A vendor-agnostic cognitive persistence layer for AI agents. Eliminate the "repetition tax" by transporting your context, preferences, guidelines, and history seamlessly across sessions, IDEs, and LLM models.

To see the core idea visually, check out the Excalidraw design or the proposal structure:

Universal Memory MVP Proposal

Diagram Breakdown

  • Short-Term Memory (Ephemeral): Project-specific (folder-level) memories. A simple summary of recent changes, pending tasks, and project or task-level constraints.
  • Agents Behaviours: Comports the user's expected agent behaviors. Instead of requesting the same settings in every session, the agent understands the user by their traits, thoughts, and any context key to enhancing the overall experience. This encompasses:
    • Long-Term Memory
    • Short-Term Memory
    • User Preferences
  • Skill Creator: Encapsulates understanding of specific workflows. When a user explains a task pattern multiple times, the system translates it into structured, reusable agent skills.
  • Unified Instruction File (AGENT.MD): The shared persistence endpoint consumed by all local agent instances (e.g., Agent A, Agent B, Agent C).

The Problem: The "Repetition Tax"

Every time you open a new session in Claude Code, start a new chat in Cursor, spin up a terminal with OpenCode, or invoke a local AI assistant, you pay a steep cognitive tax:

  • Re-explaining your stack (e.g., "We use Python 3.12, Typer, and Ruff").
  • Repeating coding style preferences (e.g., "Prefer functional design, do not write docstrings unless requested").
  • Copy-pasting database connection schemas or module layouts.
  • Explaining workflow methodologies (e.g., "We follow Spec-Driven Development (SDD)").

Universal Memory acts as a local "Cognitive USB Drive" that automatically connects to your AI runtimes, aligning them to your exact workflow, context, and rules with zero friction.


Key Architectural Concepts

1. Dual-Memory Model

  • Short-Term Memory (Project Scope): Ephemeral, directory-specific context. Tracks what you did 10 minutes ago, current active tasks, and immediate constraints.
  • Universal Memory (Global Scope): Long-lived preferences, style guidelines, tool configurations, and identity.

2. Auto-Adaptation Engine

Instead of copy-pasting instructions, umem monitors your session context and automatically updates active project instruction manifests (AGENTS.md, CLAUDE.md, .cursor/rules/, etc.), enforcing operational consistency across all agents.

3. Model Context Protocol (MCP) Integration

Integrate umem natively with any client supporting the standard MCP (such as Claude Desktop or Cursor). AI agents can programmatically retrieve context, learn new facts, and suggest skills on the fly.

4. Agent Skills Standard

Encapsulates complex, repetitive procedural instructions into formal Agent Skills (conforming to the agentskills.io standard), complete with structured directories containing SKILL.md instructions, helper scripts/, and documentation references/.


Installation & Setup

Ensure you have Python 3.12+ installed. You can run or install umem using your preferred package manager.

Try instantly with uvx

You can run umem without installing it permanently:

uvx --from universal-memory umem --help

[!WARNING] uvx is best for quick trials. For ongoing use, install Universal Memory as a persistent tool so umem is always available and can fully manage long-lived global memories and synced agent skills:

uv tool install universal-memory

Install via PyPI

pip install universal-memory

Upgrade Universal Memory

umem update does not upgrade the Python package from PyPI. It performs local, offline maintenance for the current .umem workspace, such as schema migrations, benchmark refreshes, and skill synchronization.

To upgrade the installed umem executable, use the package manager that installed it:

# If installed with uv tool
uv tool upgrade universal-memory

# If installed with pipx
pipx upgrade universal-memory

# If installed with pip
python -m pip install --upgrade universal-memory

# If running temporarily with uvx
uvx --refresh --from universal-memory umem --version

Confirm the executable you are running:

umem --version
which umem

Quick Start Guide

1. Initialize your project

Initialize umem in the current directory and hook it to your preferred runtimes/agents:

umem init --runtime claude-code --runtime opencode --runtime cursor

This sets up a local repository configuration, hooks up the necessary workspace instructions (AGENTS.md, CLAUDE.md), and prepares native skill folders.

2. Save your first preferences and facts

Tell umem what to keep in mind. You can target either the project scope (this folder) or the global scope (across all projects):

# Save a global preference
umem remember --scope global "Yan is a solutions architect specializing in AI applications"

# Save a project-specific constraint
umem remember --scope project "Always use Tomllib instead of PyYAML for configuration files" --tag config

3. Retrieve Context

Verify the consolidated context summary generated by combining short-term facts, rules, and global preferences:

umem context --scope project

4. Check status and health

umem status

Host Integration & Support Matrix

umem maps cognitive context and agent skills directly into native runtime paths:

Runtime / Host Support Tier Config / Instructions Target
Claude Code Tier 1 (Full) CLAUDE.md, .claude/, ~/.claude/
OpenCode Tier 1 (Full) AGENTS.md, .opencode/, ~/.config/opencode/
Codex (OpenAI) Tier 1 (Full) AGENTS.md, workspace configuration files
Cursor Tier 2 (Basic) .cursor/rules/, ~/.cursor/
Antigravity / Gemini Tier 2 (Basic) GEMINI.md, ~/.gemini/

Running as an Model Context Protocol (MCP) Server

AI agents can interact directly with your memory over the Model Context Protocol.

CLI Launch Command

umem-mcp

Example Config: Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "universal-memory": {
      "command": "uv",
      "args": [
        "run",
        "--package",
        "universal-memory",
        "umem-mcp"
      ]
    }
  }
}

Safety & Guardrails

  • API Secret Scanner: umem passes all incoming facts through a passive scanner to block API keys, tokens, or credentials from being stored in your persistent cognitive base.
  • Snapshots & Rollbacks: Every automated update to your config files (AGENTS.md, CLAUDE.md) is preceded by a snapshot backup. You can rollback anytime:
    # View audit logs
    umem audit list --scope project
    
    # Revert last automated modification
    umem rollback --scope project
    
  • Update Conflict Warnings: When updating canonical skills, if umem detects manual edits in local runtime rule directories (e.g. .cursor/rules/sdd-rules.md), it prompts you interactivelly to choose whether to keep your local edits or overwrite them, preventing workflow disruption.

Managing Agent Skills

You can create, list, and sync specialized behaviors:

# List all active skills
umem skills list

# Synchronize skills into active native runtime folders
umem update --skills

# Generate a new skill template from a latent skill proposal
umem skills generate --name build-standard

License

Distributed under the MIT License. See LICENSE for more information.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured