Skip to main content
Glama

Session Memory

Persistent local memory for AI coding sessions.

Start work in Windsurf. Continue later in Cursor, Codex, or Claude without manually explaining what happened in the previous conversation.

Session Memory stores your project context locally on your machine and gives supported AI agents the information they need to continue where another session stopped.

Why Session Memory?

AI conversations normally lose context when you:

  • start a new chat

  • switch from Windsurf to Codex

  • switch from Cursor to Claude

  • restart your IDE

  • return to a project later

Session Memory solves this by keeping important project state outside the AI conversation.

A fresh AI session can retrieve:

  • what you are building

  • current implementation state

  • important decisions

  • files changed

  • tests and results

  • bugs

  • open TODOs

  • blockers

  • next recommended action

Related MCP server: ai-cortex

How It Works

AI Session A
    ↓
important work recorded
    ↓
Session Memory
    ↓
local storage
    ↓
AI Session B
    ↓
get_context()
    ↓
continue where Session A stopped

Session Memory uses four main concepts:

  • Events — important things that happened.

  • Checkpoints — the current save point of the work.

  • Memories — important knowledge or decisions that should survive across sessions.

  • Context — the compact information a new AI needs to continue.

Privacy

Session Memory is local-first.

Your memory is stored on your machine under:

~/.session-memory/

It is not automatically shared with teammates.

Each engineer using Session Memory has their own independent local memory.

Requirements

  • Python 3.10+

  • macOS, Linux, or Windows

  • A supported AI client such as Windsurf, Cursor, Codex, or Claude

Quick Start

1. Install Session Memory

macOS (recommended):

# Install pipx if you don't have it
brew install pipx
pipx ensurepath

# Install Session Memory
pipx install session-memory

Linux / virtualenv:

pip install session-memory

Windows:

# Install with pip
pip install session-memory

# If not in PATH, add Python Scripts directory to your PATH
# Then restart your terminal

Verify:

session-memory --version

2. Configure Your AI Clients

Run once on your machine:

session-memory install

Session Memory detects supported clients and configures them automatically.

For example:

Session Memory Setup

✓ Windsurf detected
✓ Cursor detected
✓ Codex detected

✓ Session Memory MCP configured

You should not normally need to manually edit MCP configuration files.

3. Initialize a Repository

Go to a project where you want persistent AI context:

cd ~/projects/my-project

Then run:

session-memory init

This configures repository-level AI instructions such as AGENTS.md.

It does not place your session history inside the repository.

Your actual memory remains under:

~/.session-memory/

4. Verify Everything

Run:

session-memory doctor

Example:

Session Memory Doctor

✓ Runtime
✓ MCP server
✓ Local storage
✓ Windsurf configured
✓ Cursor configured
✓ Project initialized

READY

5. Work Normally

Open Windsurf, Cursor, Codex, or another configured client.

You do not need to say:

  • "Start Session Memory."

  • "Save this conversation."

  • "Load my old memory."

Just work normally.

For example:

Continue implementing authentication.

The agent automatically uses Session Memory to:

start/resume session
        ↓
load previous context
        ↓
continue work
        ↓
record important events
        ↓
checkpoint progress

Example

Day 1 — Windsurf

You say:

Implement OAuth login.

During the session the agent records:

Decision:
Use PKCE.

File:
src/auth/service.py

Test:
17 passed, 2 failed.

Bug:
Refresh-token expiry handling fails.

TODO:
Fix token rotation.

Day 2 — Codex

Open the same repository and start a fresh Codex conversation.

Say:

Continue working on this project.

Codex retrieves:

Goal:
Implement OAuth login

Current State:
OAuth login works.
Refresh-token rotation is incomplete.

Decision:
Use PKCE.

Important File:
src/auth/service.py

Known Bug:
Refresh-token expiry handling fails.

Tests:
17 passed, 2 failed.

Open Task:
Fix token rotation.

Next Action:
Fix refresh-token expiry handling.

You do not need to explain yesterday's conversation.

Where Is the Data Stored?

Session Memory stores data locally:

~/.session-memory/
└── projects/
    └── <project-id>/
        ├── project.json
        ├── CURRENT.md
        ├── memories/
        └── sessions/
            └── <session-id>/
                ├── session.json
                ├── events.jsonl
                ├── checkpoints/
                └── artifacts/

Your source repository only needs the small AI instruction file such as:

AGENTS.md

Session history itself is not committed to the repository.

Main Commands

session-memory install

Configure supported AI clients on this machine.

session-memory init

Enable Session Memory instructions for the current repository.

session-memory doctor

Verify installation and configuration.

session-memory status

Show current project/session status.

session-memory uninstall

Remove Session Memory configuration from AI clients without deleting your memory by default.

MCP Workflow

Agents normally use these tools automatically:

  • start_session

  • get_context

  • append_event

  • checkpoint_session

  • resolve_todo

  • search_history

  • search_memory

  • end_session

Users normally do not need to call these manually.

What Gets Recorded?

Session Memory focuses on information useful for future continuation:

  • important decisions

  • significant file changes

  • commands and test results

  • bugs and errors

  • TODOs

  • blockers

  • discoveries

  • checkpoints

It does not attempt to store hidden model reasoning.

Agent-Assisted Capture

Session Memory does not magically observe everything happening inside an AI client.

The configured AI agent calls Session Memory tools when important work occurs.

Repository instructions such as AGENTS.md guide supported agents to do this automatically.

Cross-AI Continuity

The intended workflow is:

Windsurf
    ↓
Session Memory
    ↓
Codex
    ↓
Session Memory
    ↓
Cursor
    ↓
Session Memory
    ↓
Claude

All clients on the same machine can use the same local project memory.

Local-Only Team Usage

Multiple engineers can install Session Memory.

Each engineer gets their own independent storage:

Engineer A
→ ~/.session-memory/

Engineer B
→ ~/.session-memory/

Their session data is not automatically exchanged.

Troubleshooting

Run:

session-memory doctor

For more help see:

Important Principle

Session Memory is not a transcript database.

Its goal is simple:

A fresh AI should understand enough of the previous work to continue correctly without the user re-explaining the project.

License

MIT

Available Tools

16 tools
append_eventA

Record an important event that future AI sessions may need. Use during work for meaningful decisions, bugs, test results, TODOs, discoveries, commands, or state changes. Use user_message to capture meaningful facts, requirements, preferences, constraints, or context the user provides — the user should NOT need to say 'remember this' or 'save this'. Proactively record useful user-provided information. Do NOT record trivial conversation (hello, thanks, okay) or private chain-of-thought.

Inputs: content (required), event_type (required), actor, metadata, +2 more.

checkpoint_sessionA

Create a recovery snapshot of the current work state. Call after meaningful milestones, before ending work, or before switching to another major task. Include enough state (goal, current_state, next_action) that a fresh AI could continue from this point without needing the full conversation history.

Inputs: goal, session_id, next_action, current_state, +1 more.

end_sessionA

Finalize the current work session. Call after recording unfinished TODOs and creating a final checkpoint. Previously recorded events are already durable; this operation finalizes the session for clean handoff to the next AI.

Inputs: session_id, final_overview, workspace_path.

get_active_sessionB

Get information about the currently active session.

Inputs: workspace_path.

get_contextA

Retrieve continuation context from previous sessions for the current project. Call this IMMEDIATELY after start_session and BEFORE making significant changes. Use the returned goal, current state, decisions, bugs, TODOs, files changed, and next recommended action to continue previous work correctly. This is the most important tool for cross-session continuity. NOTE: This returns selective/compact context. If specific information is not found here, use search_memory() for durable facts or search_history() for detailed historical events.

Inputs: project_id, current_task, workspace_path, include_recent_sessions.

get_sessionA

Retrieve a session by ID with its events and checkpoint.

Inputs: session_id (required).

list_sessionsB

List recent sessions.

Inputs: limit, workspace_path.

log_activityA

Record an important activity during work. Use for: decisions (architecture/implementation choices), bugs (issues discovered), todos (unfinished work), commands (significant commands run), test_result (test outcomes), error (errors encountered). Record outcomes, not reasoning. Be specific: 'Use PKCE for OAuth' not 'Made a decision'.

Inputs: category (required), description (required), metadata, workspace_path.

log_file_changeA

Record a significant file change after the change is actually made. Include the path, what changed, and why. Do not log every temporary edit. Example: 'src/auth.py modified - Added refresh token validation before issuing new access token.'

Inputs: path (required), change_type (required), description, lines_added, +2 more.

recover_sessionB

Recover an abandoned or crashed session.

Inputs: session_id (required).

rememberA

Store a long-term memory with provenance. Memories persist across sessions and can be retrieved later.

Inputs: content (required), project_id (required), memory_type (required), tags, +2 more.

resolve_todoA

Mark a previously recorded TODO as resolved after the work has been completed. Use this when an open task from get_context has been finished. Resolved TODOs remain in history but no longer appear under Open Tasks.

Inputs: todo_text (required), resolution, todo_event_id.

search_historyA

Search exact historical session events when current context does not contain enough detail. Use for questions about previous commands, errors, file changes, test results, bugs, user-provided information, or historical actions. Returns raw events from past sessions. Call this when get_context() and search_memory() do not contain the needed information. Different from search_memory which searches curated long-term knowledge.

Inputs: query (required), limit, event_types, session_ids, +1 more.

search_memoryA

Search durable project knowledge and previous important decisions. Use when reasoning depends on why a previous architectural or implementation decision was made, or to find long-term project facts, conventions, and user preferences. Call this when get_context() does not contain the needed information.

Inputs: query (required), project_id (required), limit, memory_types.

start_sessionA

Start or resume Session Memory tracking for the current project. Call this AUTOMATICALLY at the beginning of meaningful project work (e.g., 'Continue implementing auth', 'Fix the tests', 'Work on the API'). After starting, immediately call get_context to load previous project state. Do NOT start sessions for trivial questions like 'What does this function do?'

Inputs: workspace_path (required), goal, title, force_new.

update_memoryC

Update an existing memory's content or status.

Inputs: memory_id (required), status, content, importance.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 16 tools

    Disambiguation2/5

    append_event and log_activity are near-duplicates, both recording important events/activities with overlapping examples like decisions, bugs, TODOs, and test results; remember also blurs into append_event's territory. The retrieval tools are well-differentiated, but these boundary issues create real misselection risk.

    Naming Consistency4/5

    Nearly every tool follows a clean snake_case verb_noun pattern such as start_session, search_memory, and list_sessions. The single-verb 'remember' is the main deviation, and append_event/log_activity are synonymous in style, but the overall convention is consistent.

    Tool Count3/5

    16 tools is at the heavy end for a session-memory server, especially with redundant event-recording tools like append_event and log_activity. Each cluster has a purpose, but consolidating the overlapping logging tools would make the set tighter.

    Completeness4/5

    The surface covers the full session lifecycle, event and file-change logging, TODO resolution, memory storage/update/search, and context/history retrieval. Minor omissions like explicit memory deletion are workaroundable, so agents should not hit major dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides AI coding assistants with persistent project memory to retain architectural decisions, code patterns, and domain knowledge across sessions. It stores data locally in a SQLite database, allowing agents to remember, recall, and manage project-specific context using full-text search.
      4 npm
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides durable project context for coding agents, including project maps, session history, and explicit memories, all stored locally.
      87 npm
      7
      MIT