io.github.bolnet/memwright

编码与调试

by bolnet

为 AI agents 提供嵌入式记忆能力,集成 SQLite FTS5、pgvector 和 Neo4j graph search。

什么是 io.github.bolnet/memwright

为 AI agents 提供嵌入式记忆能力,集成 SQLite FTS5、pgvector 和 Neo4j graph search。

README

<p align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="docs/logo.svg"> <source media="(prefers-color-scheme: light)" srcset="docs/logo-dark.svg"> <img alt="Memwright" src="docs/logo.svg" width="400"> </picture> </p> <p align="center"> <em>Zero-config memory for AI agents. No Docker. No API keys. Just install and go.</em> </p> <p align="center"> <a href="https://pypi.org/project/memwright/"><img src="https://img.shields.io/pypi/v/memwright?color=C15F3C&style=flat-square" alt="PyPI"></a> <a href="https://pypi.org/project/memwright/"><img src="https://img.shields.io/pypi/pyversions/memwright?style=flat-square" alt="Python"></a> <a href="https://github.com/bolnet/agent-memory/blob/main/LICENSE"><img src="https://img.shields.io/github/license/bolnet/agent-memory?style=flat-square" alt="License"></a> <a href="https://registry.modelcontextprotocol.io/servers/io.github.bolnet/memwright"><img src="https://img.shields.io/badge/MCP-Registry-C15F3C?style=flat-square" alt="MCP Registry"></a> </p>

The Problem

AI agents forget everything between sessions. Every new conversation starts from zero — no memory of what you built yesterday, what decisions you made, or what your project even does.

Built-in memory solutions (like Claude Code's MEMORY.md) store flat files that load entirely into the context window every message. No search, no ranking, no contradiction handling. As your project grows, those files become a wall of text that burns tokens without helping.

What Memwright Does

Memwright gives AI agents persistent, searchable memory that stays out of the context window until needed:

  • Ranked retrieval — 3-layer search (tags + entity graph + vector similarity) returns only the most relevant memories
  • Token budgets — Set a ceiling (e.g. 2,000 tokens). Memwright fits the best memories within that budget
  • Contradiction handling — "User works at Google" automatically supersedes "User works at Meta"
  • Namespace isolation — Multi-agent systems get isolated memory partitions per agent, user, or project
  • Zero configpoetry add memwright, add one JSON block, done

Table of Contents


Quick Start

Step 1: Install

Choose one method. The package name is memwright on PyPI.

bash
# Option A: uv (recommended on macOS)
uv tool install memwright

# Option B: pipx
pipx install memwright

# Option C: pip (in a venv or with --user)
pip install memwright

# Option D: poetry (add to an existing project)
poetry add memwright

First run downloads ~90MB for the local embedding model (all-MiniLM-L6-v2). This happens once and is cached.

Step 2: Connect to Claude Code

bash
claude mcp add memory -- memwright mcp

Restart Claude Code. Approve the MCP server once. Done — Claude now has 8 memory tools.

Alternative: manual MCP config. Add to ~/.claude/.mcp.json (global) or .mcp.json (per-project):

json
{
  "mcpServers": {
    "memory": {
      "command": "memwright",
      "args": ["mcp"]
    }
  }
}

Step 3: Verify

bash
memwright doctor ~/.memwright

All 4 components should report healthy:

code
Overall: ALL HEALTHY

  [OK] SQLiteStore (0.2ms, 0 memories, 4,096 bytes)
  [OK] ChromaStore (0 vectors)
  [OK] NetworkXGraph (0 nodes, 0 edges)
  [OK] Retrieval Pipeline (3/3 layers)

Or ask Claude to call memory_health from within a session.

Step 4 (optional): Enable lifecycle hooks

bash
memwright init ~/.memwright --hooks

This auto-configures three Claude Code hooks in ~/.claude/settings.json:

  • SessionStart — injects relevant memories into context (20K token budget)
  • PostToolUse — auto-captures file changes and command outputs
  • Stop — generates a session summary

Quick test from the CLI

bash
# Add a memory
memwright add ~/.memwright "Project uses Python 3.12 with FastAPI" \
  --tags "python,fastapi" --category project

# Recall it
memwright recall ~/.memwright "what does the project use?"

# Search by category
memwright search ~/.memwright --category project

# Update a memory
memwright update ~/.memwright <memory-id> "Project uses Python 3.13 with FastAPI" \
  --tags "python,fastapi"

# Check stats
memwright stats ~/.memwright

No API keys required. Memwright uses a local embedding model — no HuggingFace token, no OpenAI key, no cloud account. The HF_TOKEN warning you may see in older versions is harmless noise and has been suppressed.


Architecture

<p align="center"> <img src="docs/architecture.svg" alt="Memwright Architecture" width="100%"> </p>

Component Overview

code
agent_memory/
├── core.py                    # AgentMemory — main orchestrator
├── models.py                  # Memory + RetrievalResult dataclasses
├── context.py                 # AgentContext — multi-agent provenance & RBAC
├── client.py                  # MemoryClient — HTTP client for distributed mode
├── cli.py                     # CLI entry point (19 commands)
├── api.py                     # Starlette ASGI REST API (8 routes)
├── store/
│   ├── base.py                # Abstract interfaces: DocumentStore, VectorStore, GraphStore
│   ├── sqlite_store.py        # SQLite storage (WAL, 17 columns, 8 indexes)
│   ├── chroma_store.py        # ChromaDB vector search (local sentence-transformers)
│   ├── schema.sql             # SQLite schema definition
│   ├── postgres_backend.py    # PostgreSQL (pgvector + Apache AGE)
│   ├── arango_backend.py      # ArangoDB (native doc + vector + graph)
│   ├── aws_backend.py         # AWS (DynamoDB + OpenSearch + Neptune)
│   └── azure_backend.py       # Azure (Cosmos DB DiskANN + NetworkX)
├── graph/
│   ├── networkx_graph.py      # NetworkX MultiDiGraph with PageRank + BFS
│   └── extractor.py           # Entity/relation extraction (50+ known tools)
├── retrieval/
│   ├── orchestrator.py        # 3-layer cascade with RRF fusion
│   ├── tag_matcher.py         # Stop-word filtered tag extraction
│   └── scorer.py              # Temporal, entity, PageRank, MMR, confidence decay
├── temporal/
│   └── manager.py             # Contradiction detection + supersession
├── extraction/
│   └── extractor.py           # Rule-based + LLM memory extraction
├── mcp/
│   └── server.py              # MCP server (8 tools, 2 resources, 2 prompts)
├── hooks/
│   ├── session_start.py       # Context injection (20K token budget)
│   ├── post_tool_use.py       # Auto-capture from Write/Edit/Bash
│   └── stop.py                # Session summary generation
├── utils/
│   └── config.py              # MemoryConfig dataclass + load/save
└── infra/                     # Terraform + Docker for cloud deployments
    ├── apprunner/             # AWS App Runner
    ├── cloudrun/              # GCP Cloud Run
    └── containerapp/          # Azure Container Apps

Three Storage Roles

Every backend implements one or more of these roles:

RolePurposeLocal DefaultCloud Options
DocumentCore storage, CRUD, filteringSQLitePostgreSQL, ArangoDB, DynamoDB, Cosmos DB
VectorSemantic similarity searchChromaDBpgvector, ArangoDB, OpenSearch, Cosmos DiskANN
GraphEntity relationships, BFS traversalNetworkXApache AGE, ArangoDB, Neptune

Cloud backends fill all 3 roles in a single service. If any optional component fails, the system degrades gracefully to document-only.


How It Works

Memory lives outside the context window

This is the key difference. Flat-file memory loads everything into context every message. Memwright stores memories in a separate process (SQLite + ChromaDB + NetworkX on disk). The context window never sees them until the agent explicitly asks.

code
Flat-file memory:                    Memwright:

┌──────────────────────────┐        ┌──────────────────────────┐
│  Context Window          │        │  Context Window          │
│                          │        │                          │
│  System prompt           │        │  System prompt           │
│  MEMORY.md ← ALL of it  │        │  User message            │
│  grows forever           │        │  memory_recall → 2K max  │
│  User message            │        │                          │
└──────────────────────────┘        └──────────────────────────┘

                                    ┌──────────────────────────┐
                                    │  Memwright (on disk)     │
                                    │  10,000+ memories        │
                                    │  ← never in context     │
                                    └──────────────────────────┘

Token cost stays flat as memory grows

code
Flat-file approach:
  Month 1:   2K tokens loaded every message
  Month 6:  15K tokens loaded every message  ← context crowded

Memwright approach:
  Month 1:   2K tokens max when recalled (ranking from 100 memories)
  Month 6:   2K tokens max when recalled (ranking from 5,000 memories)
                                             ← same cost, better results

More stored memories makes retrieval better — more candidates to rank — while context cost stays constant.

How a recall works

When an agent calls memory_recall("deployment setup", budget=2000):

code
Store: 5,000 memories

  Tag search finds:     15 memories tagged "deployment"
  Graph search finds:    8 memories linked to "AWS", "Docker" entities
  Vector search finds:  20 semantically similar memories

  After dedup + RRF fusion:  30 unique candidates, scored and ranked

  Budget fitting (2,000 tokens):
    Memory A (score 0.95):  500 tokens → in   (total: 500)
    Memory B (score 0.90):  600 tokens → in   (total: 1,100)
    Memory C (score 0.88):  400 tokens → in   (total: 1,500)
    Memory D (score 0.85):  300 tokens → in   (total: 1,800)
    Memory E (score 0.80):  400 tokens → SKIP (exceeds 2,000)

  Result: 4 memories, 1,800 tokens. 4,996 memories never entered context.

MCP Tools Reference

Once the MCP server is running, agents have these tools:

ToolPurposeKey Parameters
memory_addStore a factcontent, tags[], category, entity, namespace, event_date, confidence
memory_recallSmart multi-layer retrievalquery, budget (default: 16000), namespace
memory_searchFilter with date rangesquery, category, entity, namespace, status, after, before, limit
memory_getFetch by IDmemory_id
memory_forgetArchive (soft delete)memory_id
memory_timelineChronological entity historyentity, namespace
memory_statsStore size, counts
memory_healthHealth check (call first!)

Categories

core_belief · preference · career · project · technical · personal · location · relationship · event · session · general

MCP Resources

  • memwright://entity/{name} — Entity details + related entities from graph
  • memwright://memory/{id} — Full memory object

MCP Prompts

  • recall — Search memories for relevant context
  • timeline — Chronological history of an entity

Retrieval Pipeline

The retrieval system uses a 3-layer cascade with multi-signal fusion:

code
Query: "deployment setup"
  │
  ├─ Layer 0: Graph Expansion
  │  Extract entities from query → BFS traversal (depth=2)
  │  "deployment" → finds "AWS", "Docker", "Terraform" connections
  │
  ├─ Layer 1: Tag Match (SQLite)
  │  extract_tags(query) → tag_search() → score 1.0
  │
  ├─ Layer 2: Entity-Field Search
  │  Memories about graph-connected entities → score 0.5
  │
  ├─ Layer 3: Vector Search (ChromaDB)
  │  Semantic similarity → score = 1 - cosine_distance
  │
  ├─ Layer 4: Graph Relation Triples
  │  Inject relationship context → score 0.6
  │
  ▼ FUSION
  ├─ Reciprocal Rank Fusion (RRF, k=60)
  │  score = Σ 1/(k + rank_in_source)
  │  OR Graph Blend: 0.7 * norm_vector + 0.3 * norm_pagerank
  │
  ▼ SCORING
  ├─ Temporal Boost: +0.2 * max(0, 1 - age_days/90)
  ├─ Entity Boost:   +0.30 exact match, +0.15 substring
  ├─ PageRank Boost:  +0.3 * entity_pagerank_score
  │
  ▼ DIVERSITY
  ├─ MMR Rerank: λ*relevance - (1-λ)*max_jaccard_similarity (λ=0.7)
  │
  ▼ CONFIDENCE
  ├─ Time Decay:    -0.001 per hour since last access
  ├─ Access Boost:  +0.03 per access_count
  ├─ Clamp:         [0.1, 1.0]
  │
  ▼ BUDGET
  └─ Greedy selection by score until token budget filled

Querying "Python" also finds memories about "FastAPI" if they're connected in the entity graph. Multi-hop reasoning through relationship traversal.


Python API

Basic Usage

python
from agent_memory import AgentMemory

mem = AgentMemory("./my-agent")  # auto-provisions all backends

# Store
mem.add("User prefers Python over Java",
        tags=["preference", "coding"],
        category="preference",
        entity="Python")

# Recall with token budget
results = mem.recall("what language?", budget=2000)

# Formatted context for prompt injection
context = mem.recall_as_context("user background", budget=4000)

# Search with filters
memories = mem.search(category="project", entity="Python", limit=10)

# Timeline
history = mem.timeline("Python")

# Contradiction handling — automatic
mem.add("User works at Google", tags=["career"], category="career", entity="Google")
mem.add("User works at Meta", tags=["career"], category="career", entity="Meta")
# ^ Google memory auto-superseded

# Namespace isolation
mem.add("Team standup at 9am", namespace="team:alpha")
results = mem.recall("standup time", namespace="team:alpha")

# Maintenance
mem.forget(memory_id)             # Archive
mem.forget_before("2025-01-01")   # Archive old memories
mem.compact()                     # Permanently delete archived
mem.export_json("backup.json")    # Export
mem.import_json("backup.json")    # Import (dedup by content hash)

# Health & stats
mem.health()  # → {sqlite: ok, chroma: ok, networkx: ok, retrieval: ok}
mem.stats()   # → {total: 500, active: 480, ...}

# Context manager
with AgentMemory("./store") as mem:
    mem.add("auto-closed on exit")

Memory Object

python
@dataclass
class Memory:
    id: str                    # UUID
    content: str               # The actual fact/observation
    tags: List[str]            # Searchable tags
    category: str              # Classification (preference, career, project, ...)
    entity: str                # Primary entity (company, tool, person)
    namespace: str             # Isolation key (default: "default")
    created_at: str            # ISO timestamp
    event_date: str            # When the fact occurred
    valid_from: str            # Temporal validity start
    valid_until: str           # Set when superseded
    superseded_by: str         # ID of replacement memory
    confidence: float          # 0.0-1.0
    status: str                # active | superseded | archived
    access_count: int          # Times recalled
    last_accessed: str         # Last recall timestamp
    content_hash: str          # SHA-256 for dedup
    metadata: Dict[str, Any]   # Arbitrary JSON

Multi-Agent Support

<p align="center"> <img src="docs/multi-agent-architecture.svg" alt="Multi-Agent Memory Architecture" width="100%"> </p>

For multi-agent pipelines with provenance tracking, RBAC, and governance:

python
from agent_memory.context import AgentContext, AgentRole, Visibility

# Create a root context
ctx = AgentContext.from_env(
    agent_id="orchestrator",
    namespace="project:acme",
    role=AgentRole.ORCHESTRATOR,
    token_budget=20000,
)

# Spawn child contexts for sub-agents (immutable — returns new instance)
planner = ctx.as_agent("planner", role=AgentRole.PLANNER, token_budget=5000)
researcher = ctx.as_agent("researcher", role=AgentRole.RESEARCHER, read_only=True)

# Provenance tracking — metadata auto-enriched
planner.add_memory("Architecture decision: use event sourcing",
                   category="technical", visibility=Visibility.TEAM)
# metadata includes: _agent_id, _session_id, _namespace, _visibility, _role

# Recall is scoped to namespace + cached within session
results = researcher.recall("architecture decisions")

# Token budget tracked
print(researcher.token_budget - researcher.token_budget_used)

# Governance
researcher.flag_for_review("Need human approval for deployment plan")
researcher.add_compliance_tag("SOC2")

# Session introspection
summary = ctx.session_summary()
# → {agent_trail, memories_written, memories_recalled, token_usage, review_flags}

AgentContext Features

FeatureDescription
Namespace isolationEach agent/project gets isolated memory partition
RBAC rolesORCHESTRATOR, PLANNER, EXECUTOR, RESEARCHER, REVIEWER, MONITOR
Read-only modeAgents can recall but not write
Write quotasmax_writes_per_agent (default: 100)
Token budgetsPer-agent budget tracking
Recall cacheDedup redundant queries within a session
ScratchpadInter-agent data passing
ProvenanceAgent trail, parent tracking, visibility levels
ComplianceReview flags, compliance tags for audit
Distributed modeSet memory_url to use HTTP client instead of local

Cloud Backends

Each cloud backend fills all three roles (document, vector, graph) in a single service:

PostgreSQL (Neon, Cloud SQL, self-hosted)

Uses pgvector for vectors, Apache AGE for graph. AGE is optional — without it, graph gracefully degrades.

python
mem = AgentMemory("./store", config={
    "backends": ["postgres"],
    "postgres": {"url": "postgresql://user:pass@host:5432/memwright"}
})

ArangoDB (ArangoGraph Cloud, Docker)

Native document, vector, and graph support in one database.

python
mem = AgentMemory("./store", config={
    "backends": ["arangodb"],
    "arangodb": {"url": "https://instance.arangodb.cloud:8529", "database": "memwright"}
})

Azure (Cosmos DB)

Cosmos DB with DiskANN vector indexing. Graph via NetworkX persisted to Cosmos containers.

python
mem = AgentMemory("./store", config={
    "backends": ["azure"],
    "azure": {"cosmos_endpoint": "https://account.documents.azure.com:443/"}
})

GCP (AlloyDB)

Extends PostgreSQL backend with AlloyDB Connector (IAM auth) and Vertex AI embeddings (768D).

python
mem = AgentMemory("./store", config={
    "backends": ["gcp"],
    "gcp": {"project_id": "my-project", "cluster": "memwright", "instance": "primary"}
})

Installing cloud extras

bash
poetry add "memwright[postgres]"    # PostgreSQL
poetry add "memwright[arangodb]"    # ArangoDB
poetry add "memwright[aws]"         # AWS (DynamoDB + OpenSearch + Neptune)
poetry add "memwright[azure]"       # Azure Cosmos DB
poetry add "memwright[gcp]"         # GCP AlloyDB + Vertex AI
poetry add "memwright[all]"         # Everything

Cloud Deployment

Deploy Memwright as an HTTP API on any cloud with a single command:

bash
./scripts/deploy.sh aws        # App Runner (2 CPU / 4GB, auto-scale)
./scripts/deploy.sh gcp        # Cloud Run (auto-scale 0–3, 2 CPU / 4GB)
./scripts/deploy.sh azure      # Container Apps (scale-to-zero, 2 CPU / 4GB)

./scripts/deploy.sh aws --teardown   # Destroy everything

Prerequisites: Docker, Terraform, cloud CLI (aws/gcloud/az), backend credentials in .env.

CloudInfrastructureTerraform
AWSECR + App Runner (2 CPU, 4GB)agent_memory/infra/apprunner/main.tf
GCPArtifact Registry + Cloud Run (2 CPU, 4GB)agent_memory/infra/cloudrun/main.tf
AzureACR + Log Analytics + Container Apps (2 CPU, 4GB)agent_memory/infra/containerapp/main.tf

REST API Endpoints

All deployments expose the same Starlette ASGI API:

MethodEndpointDescription
GET/healthComponent health check
GET/statsStore statistics
POST/addAdd a memory
POST/recallSmart retrieval with budget
POST/searchFiltered search
POST/timelineEntity chronological history
POST/forgetArchive a memory
GET/memory/{id}Get memory by ID

Response envelope: {"ok": true, "data": {...}} or {"ok": false, "error": "message"}


Embedding Providers

Memwright auto-detects the best available embedding provider:

PriorityProviderModelDimensionsTrigger
1Cloud-nativeBedrock Titan / Azure OpenAI / Vertex AI768-1536Cloud backend configured
2OpenAI / OpenRoutertext-embedding-3-small1536OPENAI_API_KEY or OPENROUTER_API_KEY set
3Local (default)all-MiniLM-L6-v2384Always available, no API key

The local fallback downloads ~90MB on first use. All providers implement the same interface — switching is transparent.


CLI Reference

Both memwright and agent-memory work as entry points:

MCP Server

bash
memwright mcp                          # Start MCP server (uses ~/.memwright)
memwright mcp --path /custom/path      # Custom store location

Memory Operations

bash
agent-memory add ./store "User prefers Python" --tags "pref,coding" --category preference --namespace default
agent-memory recall ./store "what language?" --budget 4000 --namespace default
agent-memory search ./store --category project --entity Python --namespace default --limit 20
agent-memory list ./store --status active --category technical --namespace default
agent-memory timeline ./store --entity Python --namespace default
agent-memory update ./store <memory-id> "Updated content" --tags "new,tags" --category technical
agent-memory forget ./store <memory-id>

Maintenance

bash
agent-memory doctor ~/.memwright       # Health check (SQLite, ChromaDB, NetworkX, Retrieval)
agent-memory stats ./store             # Memory counts, DB size, breakdowns
agent-memory export ./store -o backup.json
agent-memory import ./store backup.json
agent-memory compact ./store           # Permanently delete archived memories
agent-memory inspect ./store           # Raw DB inspection

Lifecycle Hooks (Claude Code)

bash
memwright hook session-start           # Inject context at session start
memwright hook post-tool-use           # Auto-capture tool observations
memwright hook stop                    # Generate session summary

Benchmarks

bash
agent-memory locomo --max-conversations 5 --verbose
agent-memory mab --categories AR,CR --max-examples 10

Configuration

Store location

Default: ~/.memwright/. Configurable with --path on any CLI command.

code
~/.memwright/
├── memory.db        # SQLite database (core storage)
├── config.json      # Retrieval tuning parameters
├── graph.json       # NetworkX entity graph
└── chroma/          # ChromaDB vector store + embeddings

config.json

All fields optional. Defaults apply if the file doesn't exist:

json
{
  "default_token_budget": 16000,
  "min_results": 3,
  "backends": ["sqlite", "chroma", "networkx"],
  "enable_mmr": true,
  "mmr_lambda": 0.7,
  "fusion_mode": "rrf",
  "confidence_gate": 0.0,
  "confidence_decay_rate": 0.001,
  "confidence_boost_rate": 0.03
}
ParameterDefaultDescription
default_token_budget16000Max tokens returned per recall (start high, lower to tune)
min_results3Minimum results to return
enable_mmrtrueMaximal Marginal Relevance diversity reranking
mmr_lambda0.7Relevance vs diversity balance (0=diverse, 1=relevant)
fusion_mode"rrf""rrf" (parameter-free) or "graph_blend" (weighted)
confidence_decay_rate0.001Score penalty per hour since last access
confidence_boost_rate0.03Score boost per access count
confidence_gate0.0Minimum confidence threshold to include in results

Environment Variables

VariablePurpose
MEMWRIGHT_PATHDefault store path
MEMWRIGHT_URLRemote API URL (distributed mode)
MEMWRIGHT_NAMESPACEDefault namespace
MEMWRIGHT_TOKEN_BUDGETDefault token budget
MEMWRIGHT_SESSION_IDSession ID for provenance tracking

Testing

Running Tests

bash
# All unit tests — no Docker, no API keys
poetry run pytest tests/ -v

# With coverage
poetry run pytest tests/ -v --cov=agent_memory --cov-report=term-missing

# Live integration tests (need credentials)
NEON_DATABASE_URL='postgresql://...' poetry run pytest tests/test_postgres_live.py -v
AZURE_COSMOS_ENDPOINT='https://...' poetry run pytest tests/test_azure_live.py -v

Test Coverage

  • 607 unit tests covering all backends, retrieval, config, embeddings, and CLI
  • 14 live integration tests per cloud backend (Neon, Azure, ArangoDB)
  • Mock tests for every cloud backend — no cloud account needed
  • All unit tests run without Docker or API keys

Benchmarks

Latency (P50 recall — the core operation)

BackendStackP50P95P99
PG + pgvector + AGE (Docker)PostgreSQL 16 + pgvector + Apache AGE1.4ms5.5ms39ms
SQLite + ChromaDB + NetworkX (local)SQLite 3 + ChromaDB 1.x + NetworkX 39.1ms31ms75ms
ArangoDB (Docker)ArangoDB 3.12 (doc + vector + graph)40ms57ms68ms
GCP Cloud Run (us-central1)Starlette + Uvicorn → ArangoDB Oasis156ms245ms271ms
Azure Container Apps (eastus)Starlette + Uvicorn → ArangoDB Oasis293ms466ms480ms
AWS App Runner (us-west-2)Starlette + Uvicorn → ArangoDB Oasis621ms792ms813ms

vs. Competitors (recall P50)

SystemStackP50Notes
Memwright (PG Docker)PG 16 + pgvector + AGE1.4msFull 3-layer pipeline, 81.2% LOCOMO
RufloIn-process HNSW2-3msVector lookup only, not full retrieval
Memwright (local)SQLite + ChromaDB + NX9.1msZero-config, no Docker, no API keys
Memwright (GCP Cloud Run)Starlette → ArangoDB Oasis156msFull cloud API, scale-to-zero
Mem0Cloud + LLM judge200msLLM in retrieval path
ZepNeo4j + embeddings<200msP95 ~632ms under concurrency
Mem0 GraphCloud + LLM + graph660msGraph variant, much slower

Full results with add/search latency: docs/LATENCY_BENCHMARKS.md

LOCOMO (Long Conversation Memory)

SystemAccuracy
MemMachine84.9%
Memwright81.2%
Zep~75%
Letta74.0%
Mem0 (Graph)66.9%
OpenAI Memory52.9%

Scores are self-reported across vendors. Methodology is disputed.

Retrieval is fully local — tag matching, graph traversal, vector search with RRF fusion. No LLM re-ranking. Only benchmark answer synthesis uses an LLM.


Compatibility

MCP Clients

ClientConfig File
Claude Code.mcp.json (project) or ~/.claude/.mcp.json (global)
Cursor.cursor/mcp.json
WindsurfMCP config in settings
Any MCP clientStandard MCP stdio transport

Same memwright mcp command. Same zero-config setup.

Python

  • Python 3.10, 3.11, 3.12, 3.13, 3.14

Uninstall

1. Remove MCP server config

Delete the memory entry from ~/.claude/.mcp.json (global) or .mcp.json (per-project).

2. Uninstall the package

bash
# Match your install method:
uv tool uninstall memwright    # if installed with uv
pipx uninstall memwright       # if installed with pipx
pip uninstall memwright        # if installed with pip
poetry remove memwright        # if installed with poetry

3. Delete stored memories (optional)

bash
# Export first if you want a backup
agent-memory export ~/.memwright -o memwright-backup.json

# Then delete
rm -rf ~/.memwright

License

Apache 2.0


<sub>mcp-name: io.github.bolnet/memwright</sub>

常见问题

io.github.bolnet/memwright 是什么?

为 AI agents 提供嵌入式记忆能力,集成 SQLite FTS5、pgvector 和 Neo4j graph search。

相关 Skills

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描114.1k

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描114.1k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描114.1k

相关 MCP Server

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
83.4k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
52.2k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
46.3k

评论