Get the FREE Ultimate OpenClaw Setup Guide →

cortexgraph

Temporal memory system for AI assistants with human-like forgetting curves. All data stored locally in human-readable formats: JSONL for short-term memory, Markdown (Obsidian-compatible) for long-term. Memories naturally decay unless reinforced. Features knowledge graphs, smart prompting, and MCP server integration for Claude.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio prefrontal-systems-cortexgraph python -m cortexgraph \
  --env LOG_LEVEL="INFO (default) or DEBUG" \
  --env COREFOLDER="path to CortexGraph config/data (optional)"

How to use

CortexGraph is an MCP server that provides a human-like memory system for AI assistants. It stores memories as structured data and applies a temporal decay model so memories fade over time unless reinforced by use, mirroring human forgetting curves. The server exposes MCP endpoints to add, retrieve, update, and query memories, and it leverages a two-layer architecture (short-term STM memory and long-term memory) with a reinforcement mechanism driven by usage frequency and recency. Tools under cortexgraph.tools implement various MCP actions such as adding memories, retrieving relevant memory fragments, updating memory strengths, and exporting memories for external analysis. You can integrate CortexGraph with your AI agent to automatically capture conversational context, reinforce important memories through repeated references, and progressively promote frequently used memories to long-term storage. Start the server and connect your MCP client to the server-name you configured (cortexgraph in the default setup).

How to install

Prerequisites:

  • Python 3.10+ installed on your system
  • Git installed to clone the repository
  • Optional: virtual environment support (venv) for isolating dependencies

Step-by-step installation:

  1. Clone the repository
git clone https://github.com/prefrontal-systems/cortexgraph.git
cd cortexgraph
  1. Create and activate a virtual environment (optional but recommended)
python -m venv venv
# On Windows
venv\Scripts\activate.bat
# On macOS/Linux
source venv/bin/activate
  1. Install dependencies
pip install -r requirements.txt
  1. Verify installation (optional)
python -m cortexgraph --version
  1. Run the MCP server
python -m cortexgraph

Notes:

  • The server exposes an MCP API; ensure your environment allows network connections on the configured port (default is typically 8000/HTTP or as configured in your app).
  • If you need a different entrypoint, you can adjust by running the specific module or script provided by the project.

Additional notes

Tips and common considerations:

  • Environment variables: COREFOLDER can point to a directory for config/data; LOG_LEVEL controls verbosity. Adjust as needed for debugging in development vs production.
  • Data persistence: CortexGraph stores memories in JSONL/SQLite locally; ensure the configured data directory is writable.
  • Tuning: Familiarize yourself with the core decay model parameters (half-life, beta, tau_forget, tau_promote). See docs/scoring_algorithm.md for detailed references.
  • Networking: If deploying behind a reverse proxy or in a container, open/forward the port CortexGraph uses and secure access as appropriate.
  • Upgrades: The project is under active development; when upgrading, review release notes for changes to MCP endpoints or memory schema.

Related MCP Servers

Sponsor this space

Reach thousands of developers