# Memory OS

> A seven-layer, locally hosted memory stack for Hermes Agent that combines workspace files, searchable session history, scored facts, a Qdrant vector store and a self-curating wiki, then injects only the relevant context into each turn

- Category: Agents & Automation / Agent Memory
- Language: Python
- Licence: MIT
- Repository: https://github.com/ClaudioDrews/memory-os
- Canonical page: https://ai-tldr.dev/tools/memory-os/

## In short

Memory OS is a memory system for Hermes Agent, built to stop the agent from starting every session as if it had never met you. It sits in the Agent Memory category of the Agents & Automation tools and is open-source, written in Python and licensed MIT. To get started: run the one-command installer.

## Overview

Memory OS is a memory system for Hermes Agent, built to stop the agent from starting every session as if it had never met you. Its author describes it as a memory operating system rather than a single plugin: seven layers, from plain Markdown workspace files up to a vector database, work together so that past projects, decisions and preferences are brought back into the prompt when they are relevant. The memory infrastructure runs entirely on your own machine, and it works with any LLM provider Hermes supports, including OpenRouter, OpenAI, Anthropic and Ollama.

The layers each hold a different kind of memory. Workspace files (MEMORY.md, USER.md, CREATIVE.md) are injected every turn; session history lives in SQLite with FTS5 full-text search; durable facts sit in a separate SQLite store with entity resolution and trust scores that a feedback loop adjusts over time; a heavily modified fork of the Icarus plugin adds LLM-powered session extraction and cross-session recall through 16 fabric tools; Qdrant provides hybrid dense plus BM25 search with a four-level fallback down to SQLite, alongside a weekly decay scanner and semantic deduplication; and an auto-curated wiki vault is continuously ingested into Qdrant.

The seventh layer is the one the README stresses most. A Ground Truth hierarchy, written into the agent's SOUL.md and rulebook.md, tells the agent to treat injected memory as authoritative, so it does not spend tokens re-searching for context that is already in its prompt. Recall itself happens in a pre_llm_call hook that pulls from fabric, Qdrant, sessions and facts, gated by relevance thresholds, deduplicated per session and skipped for trivial social messages; post_llm_call and on_session_end hooks extract and store what was learned. The stack needs Hermes Agent, Docker (for Qdrant, Redis and an ARQ worker) and Python 3.11+, and is MIT-licensed.

## What it does

- Seven memory layers: workspace files, SQLite FTS5 session search, a trust-scored fact store, Icarus fabric recall, a Qdrant vector database, an auto-curated LLM wiki and a Ground Truth hierarchy
- Automatic context injection before each LLM call from four sources, gated by relevance thresholds and deduplicated per session
- Qdrant hybrid search (dense vectors plus BM25 sparse) with a hybrid → dense → lexical → SQLite fallback cascade
- Housekeeping built in: a weekly decay scanner, semantic deduplication that merges near-duplicates, and archival
- A bundled, heavily modified Icarus plugin fork with LLM-powered session extraction and 16 fabric tools such as fabric_recall and fabric_write
- Local memory infrastructure with any LLM provider Hermes supports, and a one-command, idempotent installer

## Getting started

Memory OS assumes Hermes Agent (0.14.0 or later) is already installed, plus Docker with Compose v2 and Python 3.11+. An OpenRouter key is only needed if you use OpenRouter for embeddings; local providers such as Ollama do not need one. The project recommends 16 GB of RAM (8 GB minimum).

1. Run the one-command installer

   The setup script installs the whole stack: the Docker services (Redis, Qdrant and the worker), the Icarus plugin, the SQLite databases, the wiki vault and environment variables. It is safe to re-run, and it detects an existing OpenRouter key, prompting only if one is missing.

```bash
curl -sSL https://raw.githubusercontent.com/ClaudioDrews/memory-os/main/setup.sh | bash
```

2. Or clone the repo and install by hand

   For manual control, clone the repository and follow setup/install.md, which walks through each step with validation checkpoints. The first steps copy the bundled Icarus fork into Hermes and create the two SQLite databases (state.db and memory_store.db).

```bash
git clone https://github.com/ClaudioDrews/memory-os.git
cd memory-os
cp -r icarus/ ~/.hermes/plugins/icarus/
pip install -r requirements.txt
python setup/setup_db.py
```

3. Enable Icarus in Hermes

   Register the plugin under enabled in ~/.hermes/config.yaml, then restart the gateway. hermes status should report the Icarus plugin with its 16 tools and 4 hooks.

```yaml
enabled:
  - icarus

# then:
# hermes gateway restart
# hermes status
```

4. Verify the stack

   From the docker directory, check that qdrant, redis and the worker are healthy, that Qdrant answers its health check, and that Hermes sees the plugin.

```bash
docker compose ps
curl -s http://localhost:6333/healthz
hermes plugins list | grep icarus
```

5. Add content to the wiki vault

   Drop Markdown files into the vault's raw folder (adjust the path to your vault). The worker detects and indexes new files automatically, and from the next Hermes session onward the agent recalls past decisions, searches your vault and cross-references facts you have mentioned.

```bash
mkdir -p ~/vault/wiki/raw
echo "# My notes" > ~/vault/wiki/raw/notes.md
```

## When to use it

- Reach for it when a Hermes Agent keeps losing your preferences, project context and past decisions between sessions
- Reach for it when you want long-term agent memory that stays on your own machine instead of a hosted memory service
- Reach for it when you keep notes or documents in a Markdown vault and want the agent to search them alongside its conversation history
- Reach for it when you want structured facts about your stack and projects stored with trust scores rather than as loose transcript
