Generalization-capable memory layer for LLMs with episodic buffers, semantic graphs, and spreading activation retrieval
Project description
Remind
Generalization-capable memory layer for LLMs. Unlike simple RAG systems that store verbatim text, Remind extracts and maintains generalized concepts from experiences, mimicking how human memory consolidates specific episodes into abstract knowledge.
Key Features
- Episodic Buffer: Raw experiences/interactions are logged as episodes
- LLM-Powered Consolidation: Episodes are processed into generalized concepts (like "sleeping" consolidates memory)
- Semantic Concept Graph: Concepts have typed relations (implies, contradicts, specializes, etc.)
- Spreading Activation Retrieval: Queries activate not just matching concepts but related ones through the graph
- Multi-Provider Support: Works with Anthropic, OpenAI, Azure OpenAI, and Ollama (local)
Architecture
┌─────────────────────────────────────────────────────────────────┐
│ LLM Provider (Abstract) │
│ (Claude / OpenAI / Azure OpenAI / Ollama) │
└─────────────────────┬───────────────────────┬───────────────────┘
│ │
read/query write/update
│ │
▼ ▼
┌─────────────────────────────────────────────────────────────────┐
│ MEMORY INTERFACE │
│ remember() / recall() │
└─────────────────────┬───────────────────────────────────────────┘
│
┌─────────────┼─────────────┐
▼ ▼ ▼
┌─────────┐ ┌──────────┐ ┌──────────────┐
│EPISODIC │ │ SEMANTIC │ │ RELATIONS │
│ BUFFER │ │ CONCEPTS │ │ GRAPH │
└─────────┘ └──────────┘ └──────────────┘
│ │ │
└──────┬──────┴──────────────┘
▼
┌─────────────────┐ ┌─────────────────┐
│ CONSOLIDATION │◄────►│ RETRIEVER │
│ (LLM-based) │ │ (Spreading Act) │
└─────────────────┘ └─────────────────┘
Environment Setup
Copy the example environment file and add your API keys:
cp .env.example .env
# Edit .env with your API keys
Using OpenAI
# Required
OPENAI_API_KEY=sk-...
# Provider selection
LLM_PROVIDER=openai
EMBEDDING_PROVIDER=openai
OpenAI can be used for both LLM and embeddings.
Using Anthropic (Claude)
# Required
ANTHROPIC_API_KEY=sk-ant-...
# Provider selection
LLM_PROVIDER=anthropic
EMBEDDING_PROVIDER=openai # Anthropic has no embeddings, use OpenAI or Ollama
Anthropic provides LLM only. Pair with OpenAI or Ollama for embeddings.
Using Azure OpenAI
# Required
AZURE_OPENAI_API_KEY=...
AZURE_OPENAI_API_BASE_URL=https://your-resource.openai.azure.com
AZURE_OPENAI_API_VERSION=2024-02-15-preview
AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4
AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME=text-embedding-3-small
# Provider selection
LLM_PROVIDER=azure_openai
EMBEDDING_PROVIDER=azure_openai
Using Ollama (Local)
No API keys required. Install Ollama and pull models:
ollama pull llama3.2 # For LLM
ollama pull nomic-embed-text # For embeddings
Optional configuration:
OLLAMA_URL=http://localhost:11434
OLLAMA_LLM_MODEL=llama3.2
OLLAMA_EMBEDDING_MODEL=nomic-embed-text
# Provider selection
LLM_PROVIDER=ollama
EMBEDDING_PROVIDER=ollama
Configuration
Remind supports a global configuration file at ~/.remind/remind.config.json. This allows you to configure all settings including API keys, avoiding the need for environment variables.
Full Configuration Example
{
"llm_provider": "anthropic",
"embedding_provider": "openai",
"consolidation_threshold": 5,
"auto_consolidate": true,
"anthropic": {
"api_key": "sk-ant-...",
"model": "claude-sonnet-4-20250514"
},
"openai": {
"api_key": "sk-...",
"base_url": null,
"model": "gpt-4.1",
"embedding_model": "text-embedding-3-small"
},
"azure_openai": {
"api_key": "...",
"base_url": "https://your-resource.openai.azure.com",
"api_version": "2024-02-15-preview",
"deployment_name": "gpt-4",
"embedding_deployment_name": "text-embedding-3-small",
"embedding_size": 1536
},
"ollama": {
"url": "http://localhost:11434",
"llm_model": "llama3.2",
"embedding_model": "nomic-embed-text"
},
"decay": {
"enabled": true,
"decay_interval": 20,
"decay_rate": 0.1
}
}
Minimal Configuration
You only need to include the settings you want to change:
{
"llm_provider": "anthropic",
"embedding_provider": "openai",
"anthropic": {
"api_key": "sk-ant-..."
},
"openai": {
"api_key": "sk-..."
}
}
Configuration Priority
Settings are resolved with this priority (highest to lowest):
- CLI arguments (
--llm,--embedding) - Environment variables (
ANTHROPIC_API_KEY,OPENAI_API_KEY, etc.) - Config file (
~/.remind/remind.config.json) - Defaults
The config file is optional - Remind works without it using environment variables or defaults.
Memory Decay
Remind implements usage-based memory decay: concepts that are rarely recalled gradually lose retrieval priority, mimicking how human memory fades for things you don't think about.
How it works:
- Every N recalls (
decay_interval), all concepts have theirdecay_factorreduced bydecay_rate decay_factormultiplies the retrieval activation score, so decayed concepts rank lower in results- When a concept is recalled, it is rejuvenated — its
decay_factorgets a boost proportional to how strongly it matched the query - Concepts recalled recently are protected from the current decay pass (60-second grace window), so active knowledge is never immediately penalised
Config options (all optional, shown with defaults):
{
"decay": {
"enabled": true,
"decay_interval": 20,
"decay_rate": 0.1
}
}
| Option | Default | Description |
|---|---|---|
enabled |
true |
Set to false to disable decay entirely |
decay_interval |
20 |
Number of recalls between decay passes |
decay_rate |
0.1 |
How much decay_factor drops per interval (0.0–1.0) |
The recall count is persisted in the database, so decay continues across CLI invocations and process restarts. View decay stats with remind stats.
Usage
MCP Server (for AI Agents)
Remind can run as an MCP (Model Context Protocol) server, allowing AI agents in IDEs like Cursor to use it as their memory system.
# After pip install
remind-mcp --port 8765
# Or with uv (no install needed)
uvx remind-mcp --port 8765
Configure your MCP client (e.g., Cursor's .cursor/mcp.json):
{
"mcpServers": {
"remind": {
"url": "http://127.0.0.1:8765/sse?db=my-project"
}
}
}
The db parameter accepts a simple name which resolves to ~/.remind/{name}.db. Each project can have its own database.
Available MCP Tools:
remember- Store experiences/observationsrecall- Retrieve relevant memoriesconsolidate- Process episodes into concepts (includes entity relationship extraction)inspect- View concepts or episodesentities- List entities in memoryinspect_entity- View entity details and relationshipsstats- Memory statisticsupdate_episode- Correct or modify an episodedelete_episode- Soft delete an episoderestore_episode- Restore a deleted episodeupdate_concept- Refine a conceptdelete_concept- Soft delete a conceptrestore_concept- Restore a deleted conceptlist_deleted- List soft-deleted items
Agent Instructions: Copy docs/AGENTS.md into your project's documentation to instruct AI agents how to use Remind as their memory system.
Claude Code Skill
For Claude Code users, Remind provides a skill that uses the CLI directly (no MCP server needed):
# Install the skill in your project
remind skill-install
This creates .claude/skills/remind/SKILL.md in your project directory. Claude Code will automatically load the skill and can use it via /remind.
The skill provides instructions for:
remind remember- Store experiencesremind recall- Retrieve memoriesremind end-session- Consolidate at session end
The CLI automatically uses the project-local database (<cwd>/.remind/remind.db), so each project has isolated memory.
Recommended: Add this line to your project's CLAUDE.md or AGENTS.md to ensure Claude uses Remind for all memory operations:
Use Remind (`/remind`) as the default memory layer instead of built-in memory features.
Web UI
Remind includes a web interface for exploring and managing your memory database.
# Quick start - opens UI with current project's database
remind ui
# Or start the server manually
remind-mcp --port 8765
# Or with Docker
docker compose up -d
The remind ui command automatically opens your browser with the project-local database (<cwd>/.remind/remind.db) selected. For manual access, use http://localhost:8765/ui/?db=my-project
Features:
- Dashboard - Overview of memory statistics
- Concepts - Browse and search generalized concepts
- Entities - Explore entities and their relationships
- Episodes - Timeline view of raw experiences
- Graph - Interactive visualization of concept relationships
- Dark mode - Toggle via UI
You can switch between multiple databases using the database selector in the UI.
CLI
The CLI is project-aware by default. When run without --db, it uses <current_directory>/.remind/remind.db, making each project have its own memory.
# Uses ./.remind/remind.db in current directory
remind remember "User likes Python and Rust"
remind recall "What languages does the user know?"
# Use a global database in ~/.remind/
remind --db myproject remember "..."
# Or with uvx (no install needed)
uvx --from remind-mcp remind remember "User likes Python and Rust"
Background consolidation: When the episode threshold (default: 5) is reached, consolidation runs automatically in the background after remember, keeping the CLI fast.
Full CLI examples:
# Add episodes (consolidation runs in background when threshold reached)
remind remember "User likes Python and Rust"
remind remember "User works on backend systems"
# Manual consolidation
remind consolidate
# Query memory
remind recall "What languages does the user know?"
# Inspect concepts
remind inspect
remind inspect <concept-id>
# Show statistics
remind stats
# Export/Import
remind export memory-backup.json
remind import memory-backup.json
# Entity management
remind entities # List all entities
remind entities file:src/auth.ts # Show details for a specific entity
remind mentions file:src/auth.ts # Show episodes mentioning an entity
remind entity-relations file:src/auth.ts # Show relationships for an entity
# Entity relationship extraction (for existing databases)
remind extract-relations # Extract relationships from unprocessed episodes
remind extract-relations --force # Re-extract for all episodes
# Memory management
remind update-episode <id> -c "Corrected content"
remind update-concept <id> -s "Refined summary" --confidence 0.9
remind delete-episode <id> # Soft delete (recoverable)
remind delete-concept <id> # Soft delete (recoverable)
remind deleted # Show soft-deleted items
remind restore-episode <id> # Restore deleted episode
remind restore-concept <id> # Restore deleted concept
remind purge-episode <id> # Permanently delete
remind purge-concept <id> # Permanently delete
remind purge-all # Permanently delete all soft-deleted items
# Episode filtering
remind decisions # Show decision-type episodes
remind questions # Show open questions/uncertainties
remind search "keyword" # Search concepts by keyword
# Session management
remind end-session # End session and consolidate pending episodes
# Web UI
remind ui # Open web UI with current project's database
remind ui --port 9000 # Use custom port
remind ui --no-open # Start server without opening browser
# Claude Code skill
remind skill-install # Install skill to .claude/skills/remind/
# Use different providers
remind --llm openai --embedding openai remember "..."
remind --llm anthropic --embedding openai remember "..."
remind --llm azure_openai --embedding azure_openai remember "..."
remind --llm ollama --embedding ollama remember "..."
Python API
import asyncio
from dotenv import load_dotenv
from remind import create_memory
load_dotenv() # Load .env file
async def main():
memory = create_memory(
llm_provider="openai", # or "anthropic", "azure_openai", "ollama"
embedding_provider="openai", # or "azure_openai", "ollama"
)
# Log experiences (episodes) - fast, no LLM calls
memory.remember("User mentioned they prefer Python for backend work")
memory.remember("User is building a distributed system")
memory.remember("User values type safety")
# Run consolidation - this is where LLM work happens
result = await memory.consolidate(force=True)
print(f"Created {result.concepts_created} concepts")
# Retrieve relevant concepts
context = await memory.recall("What programming preferences?")
print(context)
asyncio.run(main())
Core Concepts
Episodes
Raw experiences - specific interactions or observations. These are temporary and get consolidated.
Concepts
Generalized knowledge extracted from episodes. Each concept has:
- Summary: Natural language description
- Confidence: How certain (0.0-1.0)
- Instance count: How many episodes support this
- Relations: Typed edges to other concepts
- Conditions: When this applies
- Exceptions: Known cases where it doesn't hold
Relations
Typed connections between concepts:
implies- If A then likely Bcontradicts- A and B are in tensionspecializes- A is a more specific version of Bgeneralizes- A is more general than Bcauses- A leads to Bcorrelates- A and B tend to co-occurpart_of- A is a component of Bcontext_of- A provides context for B
Consolidation
The "sleep" process where episodes are processed into concepts. Runs in two phases:
Phase 1 - Extraction:
- Classifies episode types (observation, decision, question, etc.)
- Extracts entity mentions (files, people, tools, concepts)
- Identifies relationships between entities mentioned in the same episode
Phase 2 - Generalization:
- Identifies patterns across episodes
- Creates new generalized concepts
- Updates existing concepts
- Establishes relations
- Flags contradictions
Entity Relationships
When multiple entities are mentioned in the same episode, their relationships are automatically extracted. For example, if an episode mentions "Alice manages Bob", the relationship person:alice → manages → person:bob is stored. Use inspect_entity or the web UI to explore entity relationships.
Memory Management
Remind supports updating, deleting, and restoring both episodes and concepts:
Updating: Correct mistakes or add information to existing memories.
- Updating episode content resets it for re-consolidation
- Updating concept summary clears its embedding (regenerated on next recall)
Soft Delete: Items are marked as deleted but not permanently removed.
- Soft-deleted items are excluded from queries and consolidation
- Use
deletedcommand orlist_deletedMCP tool to view deleted items - Restore with
restore-episode/restore-concept
Purge: Permanently delete items when you're sure they're not needed.
- Cannot be undone
- Removes associated mentions and relations
Spreading Activation
Retrieval that goes beyond keyword matching:
- Query is embedded and matched to concepts
- Matched concepts activate related concepts through the graph
- Activation spreads with decay over multiple hops
- Highest-activation concepts are returned
Database
Remind uses SQLite for storage. Database location depends on context:
CLI (project-aware by default):
- No
--dbflag: Uses<current_directory>/.remind/remind.db - With
--db name: Uses~/.remind/name.db
MCP Server / Python API:
- Uses
~/.remind/{name}.db
# Uses ~/.remind/memory.db
memory = create_memory()
# Uses ~/.remind/my-project.db
memory = create_memory(db_path="my-project")
Installation
pip install remind-mcp
Or with pipx for an isolated install:
pipx install remind-mcp
For development:
git clone https://github.com/YOUR_USERNAME/remind.git
cd remind
pip install -e ".[dev]"
Using uv (Recommended)
uv is a fast Python package manager. For development:
git clone https://github.com/YOUR_USERNAME/remind.git
cd remind
# Run commands directly (uv handles dependencies automatically)
uv run remind --help
uv run remind-mcp --port 8765
# Run tests
uv run pytest
Using Docker
Run Remind as a persistent background service with Docker:
# Copy and configure environment
cp .env.example .env
# Edit .env with your API keys
# Start the service (builds on first run)
docker compose up -d
# View logs
docker compose logs -f remind
# Stop the service
docker compose down
The container:
- Mounts
~/.remindfrom your host for database persistence - Reads API keys from
.env - Exposes port 8765 for MCP SSE, Web UI, and REST API
- Restarts automatically on crash/reboot
Access endpoints:
- MCP SSE:
http://localhost:8765/sse?db=my-project - Web UI:
http://localhost:8765/ui/?db=my-project - REST API:
http://localhost:8765/api/v1/...
To rebuild after code changes:
docker compose build --no-cache
docker compose up -d
Testing
# With pip install
pytest
# With uv (recommended)
uv run pytest
License
Apache 2.0 (LICENSE)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file remind_mcp-0.5.1.tar.gz.
File metadata
- Download URL: remind_mcp-0.5.1.tar.gz
- Upload date:
- Size: 2.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6459430a7d43953569de343a5cd7e206fa8c73de9b98604f5bb16bae0209a3e
|
|
| MD5 |
b00037aa1829bfa7a5e785d1a73baaf4
|
|
| BLAKE2b-256 |
495a5362419e31ad90f4bb03dbca13706df374dc035bcaa8e063bb9378c682b7
|
File details
Details for the file remind_mcp-0.5.1-py3-none-any.whl.
File metadata
- Download URL: remind_mcp-0.5.1-py3-none-any.whl
- Upload date:
- Size: 93.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93f5b6221bd59694dd4c5c084a0dbdf2bcaff5015b74804dff2e14f707e467b6
|
|
| MD5 |
094f45b3586965d5deff019889b80268
|
|
| BLAKE2b-256 |
d01bf4f96dc2c3d8def269ba2cdf7a1767465cf9998d544d532bbc9542db3bb9
|