$

Documentation

Everything you need to install, configure, and use shodh-memory. From one-command setup to full API reference.

[01]

Quick Start

Get shodh-memory running with a single command.

Claude Code (recommended)

One command. No server to run. MCP handles everything.

terminal
claude mcp add shodh-memory -- npx -y @shodh/memory-mcp

Cursor

Add to your MCP configuration file at ~/.cursor/mcp.json:

mcp.json
{
  "mcpServers": {
    "shodh-memory": {
      "command": "npx",
      "args": ["-y", "@shodh/memory-mcp"]
    }
  }
}

Python

terminal
pip install shodh-memory

Models and ONNX runtime bundled. Works on Windows, macOS, and Linux.

[02]

Installation

All platforms and package managers.

npm (MCP Server)

terminal
npx -y @shodh/memory-mcp

# Or install globally
npm install -g @shodh/memory-mcp

Python (PyPI)

terminal
pip install shodh-memory

Rust (crates.io)

Cargo.toml
[dependencies]
shodh-memory = "0.1"

Models auto-download on first use to ~/.cache/shodh-memory/ (~37MB).

Docker

terminal
docker run -d -p 3030:3030 \
  -e SHODH_HOST=0.0.0.0 \
  -v shodh-data:/data \
  roshera/shodh-memory

Binary (Linux / macOS)

terminal
# Linux x64
curl -L https://github.com/varun29ankuS/shodh-memory/releases/latest/download/shodh-memory-x86_64-linux -o shodh-memory
chmod +x shodh-memory
./shodh-memory

# macOS ARM64 (Apple Silicon)
curl -L https://github.com/varun29ankuS/shodh-memory/releases/latest/download/shodh-memory-aarch64-darwin -o shodh-memory
chmod +x shodh-memory
./shodh-memory

Platform Support

PlatformArchitectureStatus
Linuxx86_64Supported
LinuxARM64Supported
macOSx86_64 (Intel)Supported
macOSARM64 (Apple Silicon)Supported
Windowsx86_64Supported
[03]

MCP Setup

Step-by-step setup for Claude Code, Claude Desktop, and Cursor.

Claude Code (CLI)

Single command — no config files needed.

terminal
claude mcp add shodh-memory -- npx -y @shodh/memory-mcp

This registers shodh-memory as an MCP server. All 45 tools become available in your Claude Code sessions immediately.

Claude Desktop

Add to your Claude Desktop config file:

OSConfig Path
macOS~/Library/Application Support/Claude/claude_desktop_config.json
Windows%APPDATA%\Claude\claude_desktop_config.json
Linux~/.config/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "shodh-memory": {
      "command": "npx",
      "args": ["-y", "@shodh/memory-mcp"],
      "env": {
        "SHODH_API_KEY": "your-api-key"
      }
    }
  }
}

Cursor

Add to ~/.cursor/mcp.json:

~/.cursor/mcp.json
{
  "mcpServers": {
    "shodh-memory": {
      "command": "npx",
      "args": ["-y", "@shodh/memory-mcp"],
      "env": {
        "SHODH_API_KEY": "your-api-key"
      }
    }
  }
}

Verify Connection

If running the standalone server, check it's healthy:

terminal
curl http://localhost:3030/health
# {"status":"ok"}
[04]

Configuration

Environment variables for the standalone server.

Authentication

.env
# Production: multiple API keys (comma-separated)
SHODH_API_KEYS=sk-key-1,sk-key-2

# Development: single key (fallback if SHODH_API_KEYS not set)
SHODH_DEV_API_KEY=sk-shodh-dev-change-me

# Client-side: must match one of the server's accepted keys
SHODH_API_KEY=sk-shodh-dev-change-me

Server

.env
# Bind address (default: 127.0.0.1)
# Use 0.0.0.0 only behind authenticated reverse proxy
SHODH_HOST=127.0.0.1

# Port (default: 3030)
SHODH_PORT=3030

# Storage directory
SHODH_MEMORY_PATH=./shodh_memory_data

# Environment mode
SHODH_ENV=production

# Logging level
RUST_LOG=info

Rate Limiting

.env
SHODH_RATE_LIMIT=4000
SHODH_RATE_BURST=8000
SHODH_MAX_CONCURRENT=200

Defaults are high intentionally — shodh-memory is designed for LLM workloads with rapid-fire tool calls.

CORS (optional)

.env
SHODH_CORS_ORIGINS=https://your-frontend.com
SHODH_CORS_CREDENTIALS=false
[05]

Your First Memory

Store and retrieve memories using the REST API, Python, or Rust.

REST API

store a memory
curl -X POST http://localhost:3030/api/remember \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "user_id": "user-1",
    "content": "User prefers dark mode",
    "memory_type": "Decision",
    "tags": ["preferences", "ui"]
  }'
search memories
curl -X POST http://localhost:3030/api/recall \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "user_id": "user-1",
    "query": "user preferences",
    "limit": 5
  }'

Python

example.py
from shodh_memory import Memory

memory = Memory(storage_path="./my_agent_data")

# Store with types for prioritization
memory.remember("User prefers dark mode", memory_type="Decision")
memory.remember("JWT tokens expire after 24h", memory_type="Learning")
memory.remember("Deploy failed: missing env var", memory_type="Error")

# Semantic search
results = memory.recall("user preferences", limit=5)
for r in results:
    print(f"{r['content']} (importance: {r['importance']:.2f})")

# Context summary for LLM bootstrap
summary = memory.context_summary()
print(summary["decisions"])
print(summary["learnings"])

Rust

main.rs
use shodh_memory::memory::{MemorySystem, MemoryConfig, Experience, ExperienceType, Query};

fn main() -> anyhow::Result<()> {
    let config = MemoryConfig {
        storage_path: "./my_agent_data".into(),
        ..Default::default()
    };
    let memory = MemorySystem::new(config)?;

    let experience = Experience {
        content: "User prefers dark mode".to_string(),
        experience_type: ExperienceType::Decision,
        ..Default::default()
    };
    memory.remember(experience, None)?;

    let query = Query::builder()
        .query_text("user preferences")
        .max_results(5)
        .build();
    let results = memory.recall(&query)?;

    for mem in results {
        println!("{}", mem.experience.content);
    }
    Ok(())
}

Memory Types

Types affect importance scoring and decay rates:

TypeWeightUse For
Decision+0.30Choices, preferences, conclusions
Learning+0.25New knowledge acquired
Error+0.25Mistakes to avoid
Discovery+0.20Findings, insights
Pattern+0.20Recurring behaviors
Task+0.15Work items
Context+0.10General information
Conversation+0.10Chat history
Observation+0.05Low-priority notes (default)
[06]

MCP Tools

45 tools available via the Model Context Protocol.

Core Memory

ToolDescription
rememberStore a memory with type, tags, and metadata
recallSemantic search across all memories
proactive_contextAuto-surface relevant memories for current context
context_summaryCategorized overview (decisions, learnings, context)
list_memoriesList all stored memories
read_memoryRead full content of a specific memory
forgetDelete a memory by ID
memory_statsStorage and index statistics

Todo / GTD

ToolDescription
add_todoCreate task with project, context, priority, due date
list_todosFilter by status, project, context, due date
update_todoUpdate task properties
complete_todoMark done (auto-advances recurring tasks)
delete_todoRemove a task
add_projectCreate project for grouping todos
list_projectsList all projects with stats
todo_statsCounts by status, overdue items

Reminders

ToolDescription
set_reminderTime-based, duration-based, or context-triggered
list_remindersView pending, triggered, or all reminders
dismiss_reminderAcknowledge a triggered reminder

Maintenance

ToolDescription
verify_indexCheck vector index health for orphaned memories
repair_indexRe-index orphaned memories
backup_createCreate full backup with checksum
backup_listList available backups
backup_verifyVerify backup integrity
backup_purgePurge old backups, keep recent N
consolidation_reportView memory consolidation activity
token_statusCheck context window token usage
reset_token_sessionReset token counter for new session
[07]

API Reference

REST endpoints on localhost:3030. All requests require X-API-Key header.

Core Memory

MethodEndpointDescription
POST/api/rememberStore a memory
POST/api/remember/batchStore multiple memories
POST/api/recallSemantic search
POST/api/recall/tagsSearch by tags
POST/api/recall/dateSearch by date range
GET/api/memory/{id}Get memory by ID
DELETE/api/memory/{id}Delete memory
POST/api/memoriesList with filters
POST/api/proactive_contextContext-aware retrieval
POST/api/context_summaryCategorized summary
POST/api/reinforceHebbian feedback

Todos & Projects

MethodEndpointDescription
POST/api/todosList todos
POST/api/todos/addCreate todo
POST/api/todos/updateUpdate todo
POST/api/todos/completeMark complete
POST/api/todos/deleteDelete todo
GET/api/todos/{id}Get todo
GET/api/todos/{id}/subtasksList subtasks
POST/api/todos/statsStatistics

Health & Metrics

MethodEndpointDescription
GET/healthHealth check
GET/metricsPrometheus metrics
GET/api/context/statusContext window status

Performance

OperationLatency
Store memory55-60ms
Semantic search34-58ms
Tag search~1ms
Entity lookup763ns
Graph traversal (3-hop)30us
[08]

Hooks & Automation

Automatic memory capture via Claude Code hooks. Memories are recorded without manual tool calls.

How Hooks Work

Claude Code fires events at key moments: session start, user prompt, before/after tool use. The shodh-memory hook script intercepts these events and streams context to the memory server automatically. You get persistent memory without changing your workflow.

Supported Events

EventTriggers OnCaptures
SessionStartNew Claude Code sessionSurfaces relevant past memories
UserPromptSubmitUser sends a messageRecords conversation context
PreToolUseBefore Edit, Write, BashRecords intent and patterns
PostToolUseAfter Edit, Write, Bash, ReadRecords outcomes and file access

Setup

Add to your Claude Code settings (~/.claude/settings.json):

settings.json (hooks section)
{
  "hooks": {
    "SessionStart": [{
      "hooks": [{
        "type": "command",
        "command": "bun run $SHODH_HOOKS_DIR/memory-hook.ts SessionStart"
      }]
    }],
    "UserPromptSubmit": [{
      "hooks": [{
        "type": "command",
        "command": "bun run $SHODH_HOOKS_DIR/memory-hook.ts UserPromptSubmit"
      }]
    }],
    "PreToolUse": [{
      "matcher": { "tool_name": ["Edit", "Write", "Bash"] },
      "hooks": [{
        "type": "command",
        "command": "bun run $SHODH_HOOKS_DIR/memory-hook.ts PreToolUse"
      }]
    }],
    "PostToolUse": [{
      "matcher": { "tool_name": ["Edit", "Write", "Bash", "Read"] },
      "hooks": [{
        "type": "command",
        "command": "bun run $SHODH_HOOKS_DIR/memory-hook.ts PostToolUse"
      }]
    }]
  }
}

Set SHODH_HOOKS_DIR to the path where you cloned the shodh-memory hooks directory.

Need Help?

Open an issue on GitHub or join the discussions.