Skip to main content

Self-contained memory vault for any AI agent — vector search, session diaries, and agent-agnostic hooks. The better MemPalace.

Project description

Memorius

Universal memory vault for any AI agent.

Memorius is a self-contained, agent-agnostic memory system that gives LLMs and AI agents persistent, searchable memory with a hierarchical knowledge organization. Drop-in replacement for MemPalace with multi-backend vector storage, pluggable embeddings, built-in MCP + REST servers, and agent-agnostic hooks.

pip install memorius

Quick Start

# Initialize a vault
memorius init

# Store a memory
memorius store "The sky is blue because Rayleigh scattering scatters shorter wavelengths more" --vault main --shelf science --folder physics

# Semantic search
memorius search "why is the sky blue"

# Mine memories from a conversation
memorius mine transcript.txt --vault conversations

# Check status
memorius status

# Write a diary entry
memorius diary --session "session-001" --title "Research findings"

Architecture

┌─────────────────────────────────────────────────────────┐
│                      Memorius                           │
├─────────────────────────────────────────────────────────┤
│  CLI        memorius init | store | search | mine | ... │
│  MCP        JSON-RPC protocol server (stdin/stdout)     │
│  REST       FastAPI HTTP server (optional)              │
│  Hooks      Agent-agnostic lifecycle hooks              │
├─────────────────────────────────────────────────────────┤
│  Vault Engine                                           │
│  ├── ChromaStore    Vector search (ChromaDB)            │
│  ├── SQLiteStore    Metadata & hierarchy (SQLite)       │
│  └── Embeddings     Pluggable providers                 │
├─────────────────────────────────────────────────────────┤
│  Vault  >  Shelf  >  Folder  >  Note  hierarchy         │
│  Diaries          Session diary entries                 │
│  Mine             Extract memories from transcripts     │
├─────────────────────────────────────────────────────────┤
│  Plugin Gen    →  Generate per-agent plugins            │
│  Normalizers   →  Import Discord/Telegram/WhatsApp/etc  │
└─────────────────────────────────────────────────────────┘

Configuration

Config lives at ~/.memorius/config.yaml (auto-created on memorius init):

storage:
  path: ~/.memorius/data

embeddings:
  provider: chroma-default  # chroma-default | sentence-transformers | openai
  model: all-MiniLM-L6-v2

vault:
  default: main

server:
  mcp_port: 8910
  rest_port: 8912
  host: 127.0.0.1

Environment variable overrides:

Variable Overrides
MEMORIUS_STORAGE_PATH storage.path
MEMORIUS_EMBEDDINGS_PROVIDER embeddings.provider
MEMORIUS_DEFAULT_VAULT vault.default
MEMORIUS_MCP_PORT server.mcp_port
MEMORIUS_REST_PORT server.rest_port
MEMORIUS_HOST server.host
MEMORIUS_OPENAI_API_KEY embeddings.openai.api_key

Embedding Providers

Provider Requirement Quality
chroma-default ChromaDB (bundled ONNX) Good (384d)
sentence-transformers pip install memorius[local-embeddings] Better (768d+)
openai OPENAI_API_KEY env var Best (1536d)

CLI Reference

Usage:
  memorius init                Initialize a new vault
  memorius status              Show vault status
  memorius store <text>        Store a memory
    --vault, -v                  Vault name (default: main)
    --shelf, -s                  Shelf name (default: default)
    --folder, -f                 Folder name (default: default)
    --note, -n                   Note name (default: default)
  memorius search <query>      Semantic search
    --vault, -v                  Filter by vault
    --shelf, -s                  Filter by shelf
    --limit, -l                  Max results (default: 10)
  memorius mine <file|text>    Extract memories from transcript
    --vault, -v                  Target vault (default: main)
  memorius diary <session>     Write a diary entry
    --title, -t                  Entry title
    --summary, -s                Entry summary
    --vault, -v                  Vault name (default: main)
  memorius diaries              List recent diary entries
  memorius ls                   Explore vault hierarchy
  memorius serve                Start MCP server (stdio)
  memorius serve-rest           Start REST API server
  memorius --version            Show version

MCP Protocol

MCP is the primary interface for AI agents to interact with Memorius. Connect any MCP-compatible client (Claude Code, Cursor, Codex CLI, Gemini CLI, etc.) by pointing it at the MCP server:

{
  "mcpServers": {
    "memorius": {
      "command": "memorius",
      "args": ["serve"]
    }
  }
}

Available MCP tools:

Tool Description
memorius_status Memory vault status
memorius_store Store content in vault/shelf/folder/note hierarchy
memorius_search Semantic search across vault
memorius_mine Extract memories from conversation
memorius_diary_write Write session diary entry
memorius_diary_list List diary entries
memorius_vault_ls Browse vault hierarchy

REST API

Start the REST server:

memorius serve-rest

Endpoints:

Method Path Description
GET /health Health check
POST /store Store a memory
POST /search Semantic search
POST /mine Extract memories
GET /status System status
POST /diary Write diary entry
GET /palace Browse hierarchy

Agent Hooks (optional)

Memorius includes agent-agnostic lifecycle hooks. Hook scripts are generated per agent:

memorius-plugin-gen init
# Edit universal-manifest.yaml
memorius-plugin-gen generate

This generates plugins for Claude Code, Codex CLI, Cursor, Gemini CLI, Windsurf, and more.

Plugin Generator (optional)

memorius-plugin-gen list          # Show supported agents
memorius-plugin-gen init          # Create universal-manifest.yaml
memorius-plugin-gen generate      # Generate plugins for all agents

Conversation Normalizers (optional)

memorius-normalize input.json     # Auto-detect and normalize
memorius-normalize input.json --format discord

Supported formats: Discord, Telegram, WhatsApp, generic JSON, plain text.

Development

git clone https://github.com/Dream-Pixels-Forge/memorius.git
cd memorius
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

# Run tests
pytest

# Run end-to-end
memorius init
memorius store "test memory"
memorius search "test"

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

memorius-0.1.0.tar.gz (43.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

memorius-0.1.0-py3-none-any.whl (42.3 kB view details)

Uploaded Python 3

File details

Details for the file memorius-0.1.0.tar.gz.

File metadata

  • Download URL: memorius-0.1.0.tar.gz
  • Upload date:
  • Size: 43.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for memorius-0.1.0.tar.gz
Algorithm Hash digest
SHA256 22908b435e79cde2ae5b468b0130d06d7dcff091cfad5cc418de88de0181d75d
MD5 e57fd35bfec0377692049f6642404d7b
BLAKE2b-256 04fb83950895a850068332fae395206ed180ab0c06a17e32d93a45d212c366fc

See more details on using hashes here.

File details

Details for the file memorius-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: memorius-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 42.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for memorius-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a65ce4d807f869aee393487dcf72bca12d5a2e1622c192041d7625c2baed758
MD5 4232b8ec79830f3ac7a50c99a8797061
BLAKE2b-256 79caa22b365111dc42a5aa2892cf3a3c7d59b266ba9868a77762ce0330ce3782

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page