Octop Memory logo

Octop Memory

Help your agent remember what matters. Keep preferences, carry context across sessions, and bring your memory to the next agent.

Install Octop Memory

Run the project’s own setup commands, in order.

Setup steps from the project

octop-memory installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    pip install octop-memory
    
  2. 2. Install
    pip install "octop-memory[cli]"
    
  3. 3. Install
    pip install "octop-memory[postgres]"
    

Overview

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars143Stargazers on the source repository.
Last commit5d agoMost recent push to the default branch.

From the project README

Octop Memory — a little octopus keeping memories safe

Help your agent remember what matters.
Local-first, auditable, portable memory for LLM agents — share context across Claude Code, Cursor, Codex, OpenClaw, Hermes, and your own Python apps.

PyPI Python 3.12+ License: MIT Core dependencies: 0 Storage: SQLite and PostgreSQL GitHub Discussions Discord

Highlights · Quick start · MCP & coding tools · CLI · Architecture · Community · Contributing · Wiki

English · 中文


Octop Memory is a persistent, auditable, portable memory engine for LLM agents. Instead of dumping raw chat history into a black-box vector store, it separates raw evidence (RawEvent), reviewable candidates (Candidate), canonical facts (AtomCard), and conflict-replacement journals (Journal) — so your agent remembers preferences and project decisions, updates stale conclusions cleanly, and can always trace back to the original evidence.

Start locally with zero core dependencies (Python stdlib + SQLite/FTS5), run octop-memory serve to share one memory space across coding terminals over HTTP MCP, or scale to PostgreSQL and model-assisted extraction.

It powers memory in the Octop ecosystem and runs independently as a Python library, CLI, standalone HTTP MCP service, or JSON-RPC bridge. Your host manages agent execution and model scheduling; Octop Memory handles capture, extraction, recall, storage, and migration.

Memory worth keeping. Context worth bringing along. Save it, verify it, and carry it between supported agents.

✨ Highlights

What stands outWhat you get
🔌Share memory across coding tools (MCP)Run octop-memory serve over HTTP MCP with per-client tokens, and wire Claude Code, Codex, Cursor, Kiro, and DSH into one shared space.
🪶Start small, add what you needZero core dependencies: Python's standard library + SQLite/FTS5. Manual storage and lexical recall work out of the box without any LLM.
🧠Auditable experience governanceModel-assisted extraction and promotion turn raw events into evidence-backed AtomCard facts, with conflict replacement and full Journal audit trails.
🔍Disciplined prompt recallAutomatic prompt recall injects canonical atoms only (no raw-chat fallback pollution), bounded by ranking, deduplication, and token/time budgets; explicit tools search deeper on demand.
🧳Bring your memory alongJSONL export/import and portable .hmpkg packages move accumulated memory across supported hosts, including OpenClaw and Hermes.
💾Local to server storageStart with a single SQLite file; scale to PostgreSQL with namespace isolation and bounded connection pools.
🌳Structured organizationAtomCard facts, EntityPage summaries, Episode records, and a root → branch → leaf memory tree keep context navigable.
🔖Resume conversationsOptional LangGraph checkpoints preserve execution state alongside long-term memory on SQLite or PostgreSQL.

Python 3.12+ is required. Automated extraction, promotion checks, and page regeneration use an injected LLMClient; installing the package alone does not configure a model. See the integration guide for host setup, and read the rename migration guide before upgrading pre-1.0 installations.

🚀 Quick start

Current release: 1.0.8. See CHANGELOG.md for release notes.

Option A: Embed in Python (zero dependencies)

Terminal
pip install octop-memory
server.ts
from octop_memory import Memory, MemoryService

memory = Memory(
    namespace="demo",
    backend_config={"db_path": "./demo.sqlite"},
)
memory.store("User prefers Python for backend services", topic="preferences")

# Since 1.0.4: explicit saves also accept kind="Fact" | "Preference" | "Decision" | "Task".
service = MemoryService(memory)
service.save("Use SQLite locally and PostgreSQL in staging", kind="Decision")

# Basic fact search returns MemoryNode leaf projections.
for node in memory.recall("Python"):
    print(node.content)

# Prompt recall adds source selection, ranking, deduplication, and budgeting.
result = service.recall("Python")
print(result.rendered)

This creates a local SQLite database. Use terms present in the stored text for a minimal FTS example. Memory.search() searches archived conversation messages and is a separate API from fact recall.

Option B: Share memory across Claude Code / Cursor / Codex (HTTP MCP)

Run a local standalone memory server and issue a scoped token per client:

Terminal
pip install "octop-memory[server]"

octop-memory space create my-project --backend sqlite
octop-memory token create --space my-project --name claude-code --scope read,write
octop-memory serve --host 127.0.0.1 --port 8790

Then either install automatic recall + turn-capture hooks for Claude Code, Codex, Cursor, Kiro, or DSH in one command:

Terminal
curl -fsSL https://raw.githubusercontent.com/TencentCloud/octop-memory/main/plugins/harness/install.sh \
  | sh -s -- --url http://127.0.0.1:8790/mcp/ --token omcp_…

Or add the Streamable HTTP MCP endpoint directly to any MCP client:

config.json
{
  "mcpServers": {
    "octop-memory": {
      "type": "http",
      "url": "http://127.0.0.1:8790/mcp/",
      "headers": { "Authorization": "Bearer omcp_…" }
    }
  }
}

See the standalone server guide for space management, token rotation/revocation, and the admin API, and plugins/harness/README.md for terminal hook options and Windows PowerShell setup.

Optional dependencies

InstallPurpose
pip install "octop-memory[cli]"CLI and OpenClaw setup commands
pip install "octop-memory[server]"Standalone HTTP MCP memory service (octop-memory serve)
pip install "octop-memory[postgres]"PostgreSQL memory backend
pip install "octop-memory[langgraph]"SQLite LangGraph checkpointer
pip install "octop-memory[langgraph-postgres]"PostgreSQL LangGraph checkpointer
PostgreSQL setup, connection pooling, explicit save kinds, and vector index notes
  • Explicit save kinds (since 1.0.4): Memory.store(kind=...) and MemoryService.save(kind=...) accept "Fact", "Preference", "Decision", or "Task" without an extra model call (default "Fact"). Kind is independent of topic/entity type; existing facts are not reclassified, and saving a Task does not create a reminder. Releases up to v1.0.3 do not accept this keyword.
  • PostgreSQL backend:
    python
    memory = Memory(
        namespace="demo",
        backend="postgres",
        backend_config={"dsn": "postgresql://user:pass@localhost/octop_memory"},
    )
    
    Inject real credentials from deployment configuration. SQLite isolates memory with table prefixes; PostgreSQL uses namespace-first keys in the shared octop_memory schema. Within one process, PostgreSQL instances with the same connection settings share a business pool (up to 8 connections) and a checkpoint/maintenance pool (up to 4), independent of agent count. Each pool allows at most 64 queued requests with a 30-second checkout timeout; saturation raises an explicit error. Idle pools can shrink to zero, and closing one instance leaves other instances usable. Budget separately for multiple processes, different connection settings, and the host's own database connections.
  • Optional vector indexes (experimental): Vector search interfaces and Chroma/Qdrant adapters exist in the code, but current tests use fake/mock implementations; real Chroma/Qdrant integration remains unverified. Vector search is not enabled by default and is not yet presented as a fully supported installation option. Using it requires initializing an index and injecting vector_index and embedding_provider into Memory; installing dependencies alone does not enable it. The database backend remains sqlite or postgres.

CLI

Install [cli] (or [server] for serve / space / token). Global options precede subcommands; examples explicitly select database and namespace.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Octop Memory

octop-memory is an MCP server that gives LLM agents persistent, portable memory across conversations and supported hosts. It captures and recalls preferences, decisions, and project context, with SQLite for local use and PostgreSQL for deployments. It can expose memory tools over HTTP MCP and also provides extraction, migration, and recall capabilities.

Run `octop-memory serve` to expose memory tools over HTTP MCP. Each client installation receives its own token for its memory space.

octop-memory supports SQLite and PostgreSQL storage. SQLite is suited to local use, while PostgreSQL supports server deployments.

Yes, octop-memory provides OpenClaw and Hermes adapters that connect host hooks and tools to the same memory runtime. Portable `.hmpkg` packages can move memory between supported hosts, including OpenClaw and Hermes.

No, manual storage and lexical recall work without a model using Python’s standard library, SQLite, and FTS5. Model-assisted extraction, promotion checks, and page regeneration use an injected `LLMClient`, which is not configured by installing the package alone.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewOctop Memory AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/octop-memory?style=directory)](https://allmcps.com/mcp/octop-memory)
HTML Embed
<a href="https://allmcps.com/mcp/octop-memory"><img src="https://allmcps.com/api/badge/octop-memory?style=directory" alt="Octop Memory on AllMCPs" /></a>