mcasdfgf/mcp-roo-memory

🧠 Knowledge & Memory
0 Views
0 Installs

🐍 🏠 🍎 πŸͺŸ 🐧 - Persistent fractal graph memory for AI coding agents via MCP. Semantic vector search, hot/cold/archive context tiers, decision tracking, and Docker-based deployment with Qdrant.

Quick Install

One-Click IDE Configuration
claude_desktop_config.json
{
  "mcpServers": {
    "mcasdfgf-mcp-roo-memory": {
      "command": "npx",
      "args": [
        "-y",
        "mcasdfgf-mcp-roo-memory"
      ]
    }
  }
}
Or

Using an AI coding agent (Claude Code, Cursor, etc.)? Copy a ready-made prompt that tells it to fetch the setup instructions and install this server for you.

Documentation Overview

MCP Roo Memory

Persistent, graph-based memory for Roo Code via the Model Context Protocol (MCP).

LLMs have a short memory. Every new conversation starts from scratch β€” context windows overflow, past decisions fade, and reasoning chains disappear.

MCP Roo Memory gives your AI agent a structured, persistent brain:

  • Graph memory β€” knowledge is not a flat dump, but a fractal graph of tasks, entities, facts, and decisions
  • Semantic search β€” find what matters by meaning, not keywords (50+ languages)
  • Context window control β€” hot/cold/archive tiers so you don't drown in tokens
  • Knowledge evolution β€” decisions can be superseded, facts can be updated, stale data gets archived
  • Temporal awareness β€” time as first-class citizen: chronological walks, session timelines, temporal vector filters

Python 3.11+ MIT Status Docker

⚠️ Disclaimer

This is an experimental project β€” a search for form and architecture. It works, it has tests, but treat it as a Proof of Concept (PoC). The software is provided "AS IS", without any warranty of any kind. Use it at your own risk. See LICENSE for details.


Quick Start

🐳 Docker (recommended)

Zero system dependencies β€” just Docker. Everything runs in containers; no Python, no venv, no pip.

1. Start the stack

git clone https://github.com/mcasdfgf/mcp-roo-memory.git
cd mcp-roo-memory
docker compose up -d

This starts two containers:

ContainerWhat it does
cortex-qdrantVector database (port 6333)
cortex-mcpCortex server (idle, waits for MCP connections)

2. Global MCP configuration

Add Cortex as a global MCP server for all your projects. The server is always running in Docker, so any project can connect.

Edit ~/.config/VSCodium/User/globalStorage/rooveterinaryinc.roo-cline/settings/mcp_settings.json (or the equivalent path for VS Code):

{
  "mcpServers": {
    "cortex": {
      "command": "docker",
      "args": ["exec", "-i", "cortex-mcp", "python3", "-m", "src.cortex"]
    }
  }
}

VSCode users: replace VSCodium with Code in the path above.

3. Project-level configuration (for workspace isolation)

If you want memory isolated per project, copy the reference .roo/ directory into your project:

cp -r ./mcp-roo-memory/.roo ./your-project/

Then edit .roo/mcp.json in your project and add --workspace your-project-name:

{
  "mcpServers": {
    "cortex": {
      "command": "docker",
      "args": [
        "exec", "-i", "cortex-mcp", "python3",
        "-m", "src.cortex", "--workspace", "your-project-name"
      ],
      "alwaysAllow": ["desktop_open", "graph_add_node", "vector_search", "graph_get_node",
                       "graph_add_relation", "graph_search", "desktop_focus",
                       "desktop_history", "graph_traverse", "graph_walk",
                       "graph_decompose", "graph_update_node", "graph_supersede",
                       "graph_delete_node", "vector_store",
                       "temporal_walk", "session_timeline"]
    }
  }
}

Replace your-project-name with a unique identifier β€” mcp-roo-memory, researcher, ai-pulse, etc.

How isolation works:

  • desktop_open() and graph_add_node() β€” always write to your project's workspace
  • vector_search() without workspace_id β€” searches across all projects (cross-project recall)
  • vector_search(workspace_id="project") β€” narrows search to one project

4. Done

Restart Roo Code. Your agent now has persistent memory β€” zero system pollution.


🏠 Native pip (advanced)

If you prefer running without Docker β€” or you're developing Cortex itself:

# Requirements: Python 3.11+
git clone https://github.com/mcasdfgf/mcp-roo-memory.git
cd mcp-roo-memory
python -m venv .venv
source .venv/bin/activate
pip install -e .

# Qdrant is still needed:
docker run -d --name qdrant -p 6333:6333 qdrant/qdrant

MCP config:

{
  "mcpServers": {
    "cortex": {
      "command": "python",
      "args": ["-m", "src.cortex"],
      "env": {
        "CORTEX_DB_PATH": "/path/to/cortex.db",
        "CORTEX_QDRANT_HOST": "localhost",
        "CORTEX_QDRANT_PORT": "6333"
      }
    }
  }
}

Problems This Solves

ProblemHow Cortex solves it
Flat memory β€” facts are stored as unrelated chunksFractal graph β€” tasks decompose into subtasks, facts connect to decisions, entities index files
Context window overflow β€” everything grows unboundedDesktop Viewport β€” Hot (always loaded) / Cold (on focus) / Archive (search only) tiers
No navigation β€” can't walk a reasoning chainGraph traversal β€” follow supersedes, derives_from, leads_to relations like a path
Stale facts linger β€” old decisions pollute contextMutation strategy β€” Update (typo fix) / Supersede (approach changed) / Stale-cascade (rework)
Keyword search fails β€” "auth implementation" doesn't find "JWT with RS256"Semantic vector search β€” multilingual embeddings (50+ languages) via Qdrant + fastembed
No time axis β€” can't answer "what happened in what order"Temporal layer β€” chronological walks, session timelines, temporal vector filters

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              MCP Client (Roo Code)            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚ stdio (MCP protocol)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚               CortexServer                     β”‚
β”‚         17 tools Β· 4 resources                 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Graph    β”‚ Vector   β”‚ Desktop  β”‚ Database    β”‚
β”‚ CRUD,    β”‚ Qdrant + β”‚ Hot/     β”‚ SQLite      β”‚
β”‚ traverse,β”‚ fastembedβ”‚ Cold/    β”‚ graph +     β”‚
β”‚ walk     β”‚ semantic β”‚ Archive  β”‚ history     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Three layers of intelligence:

  1. Graph (SQLite) β€” who relates to who, what decomposes into what
  2. Vector (Qdrant) β€” what does this mean, what's semantically similar
  3. Desktop (viewport) β€” what fits in the context window right now

Using as Primary Roo Memory

Make Cortex your agent's default memory system by copying the .roo/ directory into your project:

# Copy reference config from this repo
cp -r ./mcp-roo-memory/.roo ./your-project/

The .roo/ directory contains ready-to-use reference configs:

File / DirPurpose
custom_instructions.mdCortex bootstrap β€” mandatory sequence, core principles
mcp.jsonReference MCP server config (edit --workspace for your project)
rules/Boot, save, templates, triggers β€” memory lifecycle
rules-architect/Memory rules for Architect mode
rules-ask/Memory rules for Ask mode
rules-code/Memory rules for Code mode
rules-coding-teacher/Memory rules for Coding Teacher mode
rules-debug/Memory rules for Debug mode
rules-documentation-writer/Memory rules for Documentation Writer mode
rules-orchestrator/Memory rules for Orchestrator mode
rules-project-research/Memory rules for Project Research mode

For deep understanding of the memory model, see CONCEPT.md.


Tools Overview

ToolWhat it does
desktop_openOpen/restore a workspace session
desktop_focusBring a node into hot context
desktop_historyGet navigation history for a workspace
graph_add_nodeStore any knowledge: entity, fact, decision, task...
graph_get_nodeRetrieve a node with its relations
graph_add_relationCreate a relation between two nodes
graph_traverseWalk the graph from a starting node
graph_walkWalk along a reasoning chain
graph_decomposeBreak a task into structured subtasks
graph_update_nodeUpdate a node's data in-place
graph_supersedeReplace outdated knowledge (keeps history)
graph_delete_nodeDelete a node and its vector
vector_searchFind things by meaning, across 50+ languages
vector_storeStore text with automatic vectorization
graph_searchHybrid: semantic + graph subgraph expansion
temporal_walkChronological graph traversal (time axis)
session_timelineFlat timeline of all events in a session
That's all 17 toolsSee full list in CONCEPT.md Β§8

Configuration

All via CORTEX_* environment variables:

VariableDefaultDescription
CORTEX_DB_PATHcortex.dbSQLite database path
CORTEX_QDRANT_HOSTlocalhostQdrant host
CORTEX_QDRANT_PORT6333Qdrant port
CORTEX_QDRANT_TIMEOUT30Connection timeout (s)
CORTEX_COLLECTION_NAMEcortex_memoryQdrant collection name
CORTEX_EMBEDDING_MODELsentence-transformers/paraphrase-multilingual-MiniLM-L12-v2Embedding model (50+ languages)
CORTEX_ARCHIVE_DAYS_THRESHOLD7Days before auto-archive
CORTEX_DESKTOP_HOT_LIMIT5Max hot nodes in viewport
CORTEX_DESKTOP_HISTORY_LIMIT10Max history entries

Project Structure

.
β”œβ”€β”€ docker-compose.yml    ← Two services: cortex + qdrant
β”œβ”€β”€ Dockerfile            ← Multi-stage, python:3.11-slim
β”œβ”€β”€ .dockerignore
β”œβ”€β”€ src/cortex/
β”‚   β”œβ”€β”€ __init__.py    β€” Cortex factory (component assembly)
β”‚   β”œβ”€β”€ __main__.py    β€” MCP server entry point (stdio)
β”‚   β”œβ”€β”€ config.py      β€” Configuration (pydantic-settings)
β”‚   β”œβ”€β”€ db.py          β€” DatabaseManager (SQLite)
β”‚   β”œβ”€β”€ desktop.py     β€” DesktopManager (viewport + timeline)
β”‚   β”œβ”€β”€ graph.py       β€” GraphManager (CRUD, navigation, mutation, temporal)
β”‚   β”œβ”€β”€ models.py      β€” Pydantic models (Node, Relation, Viewport)
β”‚   β”œβ”€β”€ server.py      β€” MCP server (17 tools, 4 resources)
β”‚   └── vector.py      β€” VectorManager (Qdrant, embeddings, temporal filters)
└── tests/

Deep Dive

DocumentWhat you'll find
CONCEPT.mdFull philosophy, data model, node taxonomy (17 types), relation taxonomy (22 types), SQL schema
ADR-001Fractal memory architecture decision
ADR-002SQLite + JSON for graph instead of Neo4j/Cayley
ADR-003Qdrant for vectors (existing)
ADR-004fastembed for embeddings (paraphrase-multilingual-MiniLM-L12-v2)
ADR-005Desktop Viewport β€” context window strategy
ADR-006Knowledge evolution: update / supersede / stale
ADR-007Regression search: meaning β†’ context β†’ files
ADR-008Temporal layer β€” time as first-class citizen
CHANGELOG.mdProject release history
CONTRIBUTING.mdDevelopment guidelines

Development

# Native install (inside venv)
pip install -e .
pip install pytest pytest-asyncio

# Run all tests (188+ tests)
pytest tests/ -v

# With coverage
pytest tests/ --cov=src.cortex -v

Tests cover every component: models (17), config (19), database (26), graph (19), desktop (14), vector (19), server (19), integration (3) β€” 136+ total.

See CONTRIBUTING.md for guidelines.


License

MIT Β© 2026

Related MCP Servers

modelcontextprotocol/server-memoryVerified

πŸ“‡ 🏠 - Knowledge graph-based persistent memory system for maintaining context

🧠 Knowledge & Memory2 views
0xshellming/mcp-summarizer

πŸ“• ☁️ - AI Summarization MCP Server, Support for multiple content types: Plain text, Web pages, PDF documents, EPUB books, HTML content

🧠 Knowledge & Memory0 views
20alexl/claude-engram

🐍 🏠 - Persistent memory and session intelligence for Claude Code. Auto-tracks mistakes, decisions, and context via hooks. Mines session history for patterns and cross-session search. Loop detection, pre-edit warnings, context compaction survival. Runs locally with Ollama.

🧠 Knowledge & Memory0 views
a2cr/a2cr

🐍 ☁️ 🏠 🍎 πŸͺŸ 🐧 - MCP server for AI-agent handoffs. Saves client-encrypted WorkBaton checkpoints and WorkStash notes so Codex, Claude Code, Roo Code, and other MCP clients can resume work without passing full chat history.

🧠 Knowledge & Memory0 views

Engagement

Views
0
Installs
0
Upvotes
0

Views and upvotes are unique per visitor network (hashed IP). Installs count copy actions.

Status

Health: Not checked yet

We have not completed a health check for this listing yet.

No check timestamp yet.

Unclaimed listing (imported or pending owner verification). Claim it β†’
β˜… Spotlight Slot

Feature Your MCP Server

Get maximum visibility for your server across our directory, search results, and detail pages.

Spotlight Your Server

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to get the verified badge and attach your website.

Claim this listing

Promote this listing

Optional paid placement. Free listings stay free forever.

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.