mnemory
Memory server
Created by Filip Pytloun
Published in fpytloun/mnemory. Publisher page
283 GitHub stars
What it is
A self-hosted, secure, feature-rich memory system for AI agents and assistants. Provides intelligent fact extraction and deduplication, with an artifact store for detailed content.
AutoGineer overview, from the brain’s own files
mnemory is a self-hosted memory system designed to provide AI agents and assistants with persistent, long-term memory. It functions as an MCP server, allowing it to integrate seamlessly with various AI clients like Claude Code, Cursor, and Open WebUI. The system uses a two-tier architecture: a vector store for fast, semantically searchable summaries and an artifact store for detailed content. It features an intelligent pipeline that performs fact extraction, deduplication, and contradiction resolution in a single LLM call. mnemory also includes a built-in management UI for monitoring and memory maintenance, along with health checks to ensure data quality. It is built for production environments with support for Qdrant, S3/MinIO, and Prometheus monitoring.
How it works
Memory model: Vector store
AutoGineer overview, from the brain’s own files
mnemory operates by intercepting information shared during agent conversations. It uses an LLM pipeline to extract facts, classify them by importance and category, and resolve contradictions against existing data. These facts are stored in a vector database for semantic search, while detailed artifacts are kept in a separate store. During interaction, the system retrieves relevant memories based on the current context and user queries. It also manages memory lifecycles using configurable time-to-live (TTL) settings and provides a health-checking mechanism to detect and fix data inconsistencies.
| Folder | Role | Files |
|---|---|---|
| .github | agent-config | 4 |
| docs | docs | 31 |
| tests | tests | 42 |
| benchmarks | folder | 16 |
| files | folder | 8 |
| integrations | folder | 40 |
| mnemory | folder | 59 |
The agent reads
- get_core_memories evidence: AGENTS.md
The agent writes
- docs/mcp-tools.md evidence: AGENTS.md
- pyproject.toml evidence: AGENTS.md
- docs/configuration.md evidence: AGENTS.md
- add_memory evidence: AGENTS.md
Requirements
Runtimes: Python >=3.11
Databases: Qdrant, Redis
API keys (by name): OPENAI_API_KEY
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Google Antigravity, Kiro, OpenCode, Amp, Roo Code, Cline, JetBrains Junie, Devin (ex-Windsurf)
Set it up
- Not scanned by AutoGineerIts dependencies are installed by pip or uv when you run it and were not scanned by AutoGineer (9 declared). https://pypi.org/project/mnemory/
Created by Filip Pytloun. Published in fpytloun/mnemory. Licence: Apache License 2.0.
Usage
AutoGineer overview, from the brain’s own files
- Connects to AI agents via the Model Context Protocol (MCP).
- Provides a REST API for custom integrations and plugin development.
- Includes a web-based dashboard for memory management and visualization.
- Supports automatic recall and memory persistence across sessions.
- Offers built-in health checks and maintenance tools for memory quality.
- Integrates with monitoring tools like Prometheus and Grafana.
- “What did I decide last week about the database?”
- The agent performs a temporal-aware semantic search across stored memories to retrieve the specific decision made.
- “I drive a Skoda.”
- The system extracts this fact and stores it; if a later statement says 'I bought a Tesla', it updates the record instead of creating a duplicate.
Documentation by Filip Pytloun
<p align="center"> <img src="files/banner.png" alt="mnemory banner" /> </p>
mnemory
Looking for a complete Agent OS? Meet Cognis — a cloud-native, self-hosted workspace where AI agents do real work. Bring together conversations, tools, workflows, and remote executors, with long-term memory powered by mnemory and guardrails provided by Intaris.
Deletion is intentionally best effort, not a verified-erasure or compliance guarantee. Normal deletion retracts and preserves history; explicit privacy erasure attempts physical cleanup. See deletion limits.
Give your AI agents persistent memory. mnemory is a self-hosted MCP server that adds personalization and long-term memory to any AI assistant — Claude Code, ChatGPT, Open WebUI, Cursor, or any MCP-compatible client.
Plug and play. Connect mnemory and your agent immediately starts remembering user preferences, facts, decisions, and context across conversations. No system prompt changes needed.
Self-hosted and secure. Your data stays on your infrastructure. No cloud dependencies, no third-party access to your memories.
Intelligent. Uses a unified LLM pipeline for fact extraction, deduplication, and contradiction resolution in a single call. Memories are semantically searchable, automatically categorized, and expire naturally when no longer relevant.
Features
Zero config —
uvx mnemory, connect your MCP client, done. Works out of the box with any OpenAI-compatible API.Intelligent extraction — A single LLM call extracts facts, classifies metadata, and deduplicates against existing memories.
Contradiction resolution — "I drive a Skoda" + later "I bought a Tesla" = automatic update, not a duplicate.
Two-tier memory — Fast searchable summaries in a vector store + detailed artifact storage (reports, code, research) retrieved on demand.
AI-powered search — Multi-query semantic search with temporal awareness. Ask "What did I decide last week about the database?" and it finds the right memories.
Memory health checks — Built-in three-phase consistency checker (fsck) detects duplicates, contradictions, quality issues, and prompt injection. Run manually or on a schedule with auto-fix.
10+ client support — Claude Code, ChatGPT, Open WebUI, OpenClaw, Cursor, Windsurf, Cline, OpenCode, and more. Native plugins available for automatic recall/remember.
Built-in management UI — Dashboard, semantic search, memory browser with full CRUD, relationship graph visualization, and health check interface. No extra tools needed.
Production ready — Qdrant for vectors, S3/MinIO for artifacts, API key or Cognis JWT authentication, per-user isolation, Kubernetes-friendly stateless HTTP.
Secure by default — API key or Cognis JWT authentication with session-level identity binding, per-user memory isolation, anti-injection safeguards in extraction prompts.
REST API + MCP — Dual interface with the same backend. 16 MCP tools + full REST API with OpenAPI spec. Build plugins, integrations, or use directly.
Prometheus monitoring — Built-in
/metricsendpoint with operation counters and memory gauges. Pre-built Grafana dashboard included.
Quick Start
mnemory needs an OpenAI-compatible API key for LLM and embeddings. It picks up OPENAI_API_KEY from your environment automatically.
uvx mnemoryIf uvx reports No module named 'mcp.server.fastmcp', update uv. Older uv
versions on Alpine can ignore mnemory's MCP v1 dependency constraint. Until
you update uv, run:
uvx --with "mcp<2" mnemoryThat's it. mnemory starts on http://localhost:8050/mcp, stores data in ~/.mnemory/.
Now connect your client — for Claude Code, add to your MCP config:
{
"mcpServers": {
"mnemory": {
"type": "streamable-http",
"url": "http://localhost:8050/mcp",
"headers": {
"X-Agent-Id": "claude-code"
}
}
}
}Start a new conversation. Memory works automatically.
Also available via Docker, pip, or production setup with Qdrant + S3. See the full quick start guide for more clients and options.
Screenshots
<p align="center"> <img src="files/screenshots/ui-dashboard.jpg" alt="Dashboard — memory totals, breakdowns, and operation counts" width="800" /> <br><em>Dashboard with memory breakdowns by type, category, and role</em> </p>
<p align="center"> <img src="files/screenshots/ui-search.jpg" alt="Search — semantic and AI-powered search with filters" width="800" /> <br><em>Semantic search and AI-powered find with filters</em> </p>
<p align="center"> <img src="files/screenshots/ui-graph.jpg" alt="Graph — D3.js force-directed memory relationship visualization" width="800" /> <br><em>Memory relationship graph visualization</em> </p>
See all screenshots and UI features including memory browser, health checks, and artifact management.
Supported Clients
mnemory works with any MCP-compatible client. Some clients also have dedicated plugins for automatic recall/remember.
| Client | MCP | Plugin | Setup Guide |
|---|---|---|---|
| Claude Code | Yes | Yes (hooks) | Guide |
| ChatGPT | Yes (MCP connector) | -- | Guide |
| Claude Desktop | Yes | -- | Guide |
| Hermes Agent | Yes | Yes (plugin) | Guide |
| Open WebUI | Yes | Yes (filter) | Guide |
| OpenCode | Yes | Yes (plugin) | Guide |
| OpenClaw | Yes | Yes (plugin) | Guide |
| Cursor | Yes | -- | Guide |
| Windsurf | Yes | -- | Guide |
| Cline | Yes | -- | Guide |
| Continue.dev | Yes | -- | Guide |
| Codex CLI | Yes | -- | Guide |
MCP = works via Model Context Protocol (LLM-driven tool calls). Plugin = dedicated integration with automatic recall/remember (no LLM tool-calling needed).
How It Works
Storing: You share information naturally. mnemory extracts individual facts, classifies them (type, category, importance), checks for duplicates and contradictions against existing memories, and stores them as searchable vectors — all in a single LLM call.
Searching: Ask a question and mnemory generates multiple search queries covering different angles and associations, runs them in parallel, and reranks results by relevance. Temporal-aware — "what did I decide last week?" just works.
Recalling: At conversation start, your agent loads pinned memories (core facts, preferences, identity) plus recent context. During conversation, relevant memories are found automatically based on what you're discussing.
Maintaining: Memories have configurable TTL — context expires in 7 days, episodic memories in 90. Frequently accessed memories stay alive (reinforcement). The built-in health checker detects and fixes duplicates, contradictions, and quality issues.
Learn more in the architecture docs.
Benchmark
Evaluated on the LoCoMo benchmark — 10 multi-session dialogues with 1540 QA questions across 4 categories:
| System | single_hop | multi_hop | temporal | open_domain | Overall |
|---|---|---|---|---|---|
| mnemory | 63.1 | 53.1 | 74.8 | 78.2 | 73.2 |
| mnemory (gpt-oss-120b) | 66.3 | 59.4 | 68.5 | 73.8 | 70.5 |
| Memobase | 70.9 | 52.1 | 85.0 | 77.2 | 75.8 |
| Mem0-Graph | 65.7 | 47.2 | 58.1 | 75.7 | 68.4 |
| Mem0 | 67.1 | 51.2 | 55.5 | 72.9 | 66.9 |
| Zep | 61.7 | 41.4 | 49.3 | 76.6 | 66.0 |
| LangMem | 62.2 | 47.9 | 23.4 | 71.1 | 58.1 |
Configuration: gpt-5-mini for extraction, text-embedding-3-small for vectors. gpt-oss-120b via Groq is a budget alternative at ~5x lower cost with comparable quality. See configuration docs for model options and benchmarks/ for reproduction.
Documentation
| Document | Description |
|---|---|
| Quick Start | Get running in 5 minutes with any client |
| Configuration | All environment variables — LLM, storage, server, memory behavior |
| Memory Model | Types, categories, importance, TTL, roles, scoping, sub-agents |
| MCP Tools | 16 MCP tools — memory CRUD, search, artifacts |
| REST API | Full REST API, fsck pipeline, recall/remember endpoints |
| Architecture | System diagram, detailed flows for storing/searching/recalling |
| Management UI | Screenshots, features, access, UI development |
| Monitoring | Prometheus metrics, Grafana dashboard |
| Deployment | Production setup, Docker, authentication, Kubernetes |
| Development | Building, testing, linting, contributing |
| Client Guides | Per-client setup instructions (10 clients) |
| System Prompts | Templates for personality agents and custom setups |
License
Apache 2.0
CHANGELOG.md
Changelog
[1.15.2] — 2026-11-01
Fixed
Ship compiled JavaScript alongside the OpenClaw plugin sources, lock the build dependency, and verify that the packaged runtime loads before npm publication.
Distribution
Publish multi-architecture container images to
ghcr.io/fpytloun/mnemory, with source-repository labels and tested tag rules.Document GHCR pull/build commands and retain the best-effort deletion warning alongside the Cognis introduction.
[1.15.1] — 2026-10-19
Fixed
Allow explicit online erasure of retracted lineages through current or older revision IDs while preserving authorization and ordinary mutation claims.
Report partial object-storage cleanup failures instead of returning success.
Refuse stale retraction recovery when its memory or audit journal is absent.
Documentation
Clarify that online privacy erasure is best effort, not transactional or verified permanent erasure. Concurrent jobs/recovery, derived session content, backups and external logs can retain or recreate information. See deletion limits. Public interfaces remain compatible.
Reconstruct illustrative examples and make qualification notes portable.
[1.15.0] — 2026-10-04
Added
Managed inference — Added Cognis-managed model routing and service JWT authentication for inference requests.
Memory browser — Added creation-time sorting and date-range filters for browsing memories.
Bug Fixes
Inference defaults — Preserved explicitly configured reasoning effort and inherited managed inference defaults when no override is set.
[1.14.0] — 2026-09-07
Added
Trusted user-event ingestion — Added a shared authenticated event endpoint for trusted callers to record memory updates.
Trusted evidence journal — Added durable event, ownership, and release-fence records for trusted memory operations.
Changed
Semantic revision processing — Unified trusted event handling with revision lineage, recovery, and pre-write ownership fences.
Rejection handling — Preserved terminal trusted-operation rejections for deterministic replay and audit results.
[1.13.0] — 2026-09-06
Added
Immutable memory revisions — Semantic updates create successor points in the existing Qdrant memory collection.
Provenance and audit — Added exact derivation links, history APIs, and the
_mnemory_operationsaudit collection.Stale-write protection — Update and retraction APIs accept expected revisions and lineage-scoped idempotency keys.
Evidence confirmation — Inferred deduplication can confirm an active revision from new independent user evidence.
Optional slow decay — Disabled-by-default gradual ranking decay uses access and validation timestamps.
Recoverable fsck journal — Fsck operations retain deterministic checkpoints and terminal failure or skip outcomes.
Legacy failure controls — Added content-free diagnostics and default-disabled bounded retry controls.
Changed
Delete semantics — Ordinary deletion now creates a retraction tombstone and preserves history. Explicit privacy deletion erases the full lineage.
Consolidation evidence — Consolidation records sources per output and retains raw evidence instead of physically deleting it.
Migration 005 — Startup backfills revision metadata without changing existing IDs, text, vectors, or legacy payload fields.
Migration 006 — Startup adds validation indexes and neutral legacy validation projections without changing content or vectors.
Recall reinforcement — Access timestamps and TTL refresh now apply only after final result delivery.
Migration 007 — Failed sessions without diagnostics are classified as legacy metadata without retrying them.
[1.12.2] — 2026-08-23
Bug Fixes
Consolidation recovery isolation — Continued recovery and consolidation for other sessions when one session recovery fails.
Metrics and maintenance Qdrant scans — Reduced Qdrant scan load, refreshed metrics asynchronously, and kept complete metric snapshots available during refresh.
[1.12.1] — 2026-05-07
Bug Fixes
Shared-agent owner isolation — Isolated shared-agent owner memories so shared-agent recall and access checks do not cross owner boundaries (
fbf960d).Management UI header overflow — Prevented dashboard header controls from overflowing and kept desktop headers on a single line (
646c4f5,27c0542).
[1.12.0] — 2026-04-23
Added
Owner-scoped shared-agent recall — Added
owner_id-aware recall, search, recent-memory, and listing flows so shared agents can load owner-shared agent memories without leaking unrelated personal memory. This includes dedicated core-memory assembly for shared-agent sessions (3fce5a6).
Bug Fixes
Legacy shared-memory backfill — Backfilled legacy owner IDs during migration and search fallback paths so pre-existing shared memories continue to resolve correctly after the new owner-scoped sharing model landed (
87ca90f).
Testing
Owner fallback coverage — Tightened unit and migration coverage for legacy owner fallback and shared-agent recall edge cases (
b4d8001).
[1.11.1] — 2026-04-14
Bug Fixes
Authenticated health endpoints on the main port — Kept authenticated health endpoints available on the main server port so health checks continue to work correctly behind authenticated deployments and proxies (
5f785a6)
[1.11.0] — 2026-04-01
Added
Hermes Agent plugin (
integrations/hermes/): New plugin integration for the Hermes Agent framework with automatic memory recall and capture (6ebe8b3)Exchange token endpoint:
POST /api/auth/exchangefor cross-service SSO token exchange (2222e8b)Cognis session cookie auth: Support
cognis_sessioncookie for cross-service SSO alongside existing API key and JWT auth (3be1824)Separate embedding API key: New
EMBED_API_KEYconfig for using a different provider for embeddings than for LLM (b5af1c4)
Improved
Dashboard category legend — The By Category chart now uses a right-side scrollable legend so large project/category sets stay readable (
66beccb)Graph filters — The Graph tab now supports category and memory-layer filters in addition to the existing type toggles (
66beccb)Core context preview — The User tab now shows a read-only preview of the exact default
get_core_memoriescontext an agent receives, including agent-specific scope when an agent is selected (66beccb)Core memories exclude raw layer —
get_core_memories, initialize/recall flows, and the User tab preview now omit provisional raw memories so only consolidated knowledge is injected by default. Structured stats added to core memories output (84a4001)User tab stats and cleanup mode — The User tab now shows approximate token usage plus compact core-memory stats, and advanced mode can load the actual backing memories as editable cards for cleanup (
66beccb)Fsck redesign — Fsck redesigned as an automated maintenance engine with incremental processing, improved metadata normalization accuracy, and incremental re-checking (
b04fa11,deb5eeb)Prompt caching — Extraction prompts restructured for OpenAI prompt caching, placing stable system instructions before variable content (
b4cdd56)
Bug Fixes
Fact-vs-episodic misclassification — Reduced misclassification of facts as episodic memories and vice versa through improved extraction prompt guidance (
da270b9)Cross-user session leakage in OpenWebUI — Prevented session leakage in multi-user deployments where one user's memories could be visible to another (
313f97e)Auth flow hardening — Hardened authentication flow and fsck incremental checks against edge cases (
9a02bb7)Fsck issue cards — Affected memories are now included in fsck issue cards, and raw memories are excluded from checks (
c60a8d0)
Documentation
Default model update — Updated default model reference to
gpt-5.4-miniand documentedgpt-oss-120bas a recommended budget alternative with comparable benchmark results (8df307d)Infer=true guidance — Clarified guidance for when to use
infer=truevsinfer=falsein memory storage instructions (3f41e3d)
Testing
Boundary tag injection test — Softened boundary tag injection e2e test assertions for cautious models that may refuse injection-like content (
0948b46)
[1.10.0] — 2026-03-28
Improved
Sessions tab browsing -- The top-level Sessions list now supports server-side pagination, search over session summaries/IDs, last-activity vs created-date sorting, asc/desc ordering, page-size selection, and accurate total counts with truncation warnings for very large result sets.
Dashboard layer visibility -- The Dashboard now shows raw vs consolidated memory totals and a dedicated memory-layer chart, including per-user filtered views.
Bug Fixes
Management UI tab regression -- Fixed broken HTML nesting in the Sessions tab that prevented the User, Graph, and Check tabs from rendering correctly.
Check tab agent filter -- Fixed agent loading in the Check tab after
/api/statsstarted returningagentsas a flat string list.
[1.9.1] — 2026-03-28
Added
Root redirect -- Navigating to
/now redirects to/ui/for better discoverability of the management UI.Cognis JWT authentication -- ES256 JWT validation alongside existing API key auth for Cognis controller integration.
POST /api/memories/by-ids-- New endpoint to fetch multiple memories by their IDs in a single request (max 500 IDs). Returns user-scoped results with silent skip for missing IDs.
Improved
Sessions tab pagination -- Linked memories and consolidated memories in expanded sessions are now paginated (10 per page) with "Show More / Show Less" controls, preventing large sessions from overwhelming the page.
Sessions tab performance -- Memory loading now uses the batch endpoint instead of fetching all memories and filtering client-side, drastically reducing API payload and load time.
Compact session layout -- Tighter spacing and consolidated/raw memory counts in expanded session details.
[1.9.0] — 2026-03-26
Two-Layer Memory System
Raw and consolidated memory layers: Memories now have a
memory_layerfield —raw(provisional evidence from therememberendpoint) orconsolidated(durable knowledge fromadd_memory, consolidation, or pre-existing memories). Therememberendpoint writesmemory_layer=rawand its dedup only searches against other raw memories, never modifying consolidated knowledge. This fixes the C1 dedup isolation problem where remember calls could overwrite manually stored memories (0638e93)Session summary persistence: Session summaries are now persisted to a dedicated
_mnemory_sessionsQdrant collection. Summaries are updated on eachremembercall and survive server restarts. New REST endpoints for listing and querying session summaries (0638e93)6-category extraction model: Extraction prompts enhanced with a 6-category model (Topic, Exploration, Decision, Fact, Action, Preference/Workflow) to guide what to extract from conversations, improving extraction quality and classification accuracy (
0638e93)Layer-aware recall ranking: Search results are reranked by memory layer — raw memories are penalized (-0.05) and superseded raw memories are further penalized (-0.15), ensuring consolidated knowledge surfaces first (
944807d)memory_layerfilter:list_memoriesMCP tool and REST endpoint accept amemory_layerfilter (raw/consolidated) for browsing by layer (944807d)Data migrations: Automatic migrations for
_mnemory_sessionscollection creation andmemory_layerpayload index (0638e93)
Within-Session Consolidation Service
ConsolidationService: New background service that consolidates raw memories into durable knowledge after sessions go idle. State machine (idle → consolidating → consolidated/failed) with output validation and crash recovery. Wired into the existing
MaintenanceServiceperiodic loop (944807d)Role-separated consolidation: User and assistant memories are consolidated independently with separate LLM calls and role-specific system prompts. User consolidation focuses on decisions, preferences, facts, and goals. Assistant consolidation focuses on implementations, deployments, research findings, and recommendations (
edfec56)Append-only re-consolidation: When new raw memories arrive after consolidation, the session resets to idle and becomes eligible for re-consolidation. New consolidated memories are appended alongside existing ones (no data loss). Previous consolidated memories are passed as read-only context to prevent duplication (
1c4da6a)Time-based batching: Large sessions are split into batches (
CONSOLIDATION_BATCH_SIZE, default 100) with accumulated context from prior batches to prevent cross-batch duplication (1c4da6a)Manual consolidation trigger:
POST /api/sessions/{id}/consolidateendpoint for on-demand consolidation with 409 race guard and failed-state reset. Fire-and-forget (returns 202 immediately, runs in background) (da514a4,b3cb51f)Session delete:
DELETE /api/sessions/{id}endpoint with optionaldelete_memories=trueto also delete linked raw memories (007e730)Dedicated consolidation model:
CONSOLIDATION_LLM_MODELandCONSOLIDATION_REASONING_EFFORTconfig options (falls back toFSCK_LLM_MODEL, thenLLM_MODEL) for using a stronger model for synthesis while keeping extraction lightweight (9a11e3b)GC for superseded raw memories: Fsck now garbage-collects superseded raw memories without artifacts (
944807d)Consolidation metrics: New Prometheus counters and gauges — runs, produced, superseded, duration, validation failures, pending sessions (
944807d)
Security
_trustedbypass for internal callers: New internal-only_trustedparameter onadd_memoryallowsinfer=Falsewithrole='assistant'for trusted server-side callers (consolidation, fsck). Never exposed in MCP tools or REST API (2e06181)ALLOW_CLIENT_INFERconfig: When set tofalse, client-facing tools always forceinfer=True, preventing untrusted clients from bypassing LLM extraction. Internal callers unaffected. Default:true(2e06181)
Integrations
OpenClaw plugin (
@fpytloun/openclaw-mnemory): New standalone plugin for automatic memory recall/capture in OpenClaw. Ships as npm package with 15 tools, CLI commands, config schema, two-phase recall (init at session start + per-turn topical search), and comprehensive test suite (b2147ac,c2ed398)OpenCode plugin rewrite (
@fpytloun/opencode-mnemory): Rewritten from single-file plugin (382 lines) to multi-file npm package (~2750 lines). Adds per-turn semantic search (old plugin only recalled at session start), 16 custom tools via plugin API (eliminates separate MCP server config), prompt injection escaping, session cleanup with AbortController, and unit tests (c6d9e20)OpenWebUI filter improvements: Fixed static context (instructions + core memories) lost on subsequent turns by caching from first turn. Fixed pending session handling, tool stripping for both
tool_idsandtoolsfields. Added debug valve for diagnostic status messages. Bumped to v0.2.0 (e3a3f72,9d750ce)
Management UI
Sessions tab: New tab for viewing persistent session summaries with memory cards, session detail modal, consolidation status, and "Consolidate Now" button for idle/failed sessions. Agent filter dropdown, delete with optional raw memory cleanup (
b044e27,da514a4,007e730)Memory layer filter: Browse and Search tabs now include a layer filter dropdown (All/Raw/Consolidated) with
raw,superseded, andconsolidatedbadges on memory cards (da514a4,b3cb51f)Expanded memory details:
superseded_byandderived_fromfields shown in expanded memory details (da514a4)
Prompt & Extraction Improvements
Stronger summary prompts: Per-turn summaries now explicitly capture assistant work (implementations, designs, research, deployments). Trivial exchanges produce minimal output instead of inflated "User asked..." statements (
e5fccbe)Broader agent extraction: Agent extraction prompt expanded to also extract actions with lasting impact, conclusions/decisions, and recommendations — not just identity facts (
c62e8a0)Conservative consolidation: Consolidation prompts require the "valuable in FUTURE conversations" test. Preferences require explicit statement or repeated pattern. Empty output allowed for sessions with no durable knowledge (
853ac3f)Category enforcement: Consolidated memories now reliably have categories via three-layer fix — prompt instruction, schema
minItems=1constraint, and code fallback inheriting from source raw memories (99e6b0a,17f12b8)TTL and event_date in consolidation: Consolidation output includes memory_type TTL guidance and event_date support for episodic memories (
25091c6)
Bug Fixes
Null text in dedup response: Handle
{"text": null}in LLM dedup decisions that causedAttributeErroron.strip()(5fdaa33)Deterministic session point IDs: Session IDs are now converted to UUID5 for Qdrant compatibility (session ID strings are not valid Qdrant point IDs) (
a681c22)Corrupted session entries: Stricter filtering requires both
session_idandsummaryin payload, with deduplication by session_id (d1fe2fa,8debe74)Consolidation validation: Lowered ratio threshold from 0.2 to 0.05 and made validation non-blocking (warns instead of failing) to prevent valid consolidation output from being rejected (
61efb45)VectorStore method: Fixed
AttributeErrorwhere consolidation code called non-existentget()method instead ofget_by_id()(6e08d93)
Testing
Consolidation unit tests: Comprehensive test suite for the consolidation service — role-separated prompts, state machine, re-consolidation, batch processing, validation, and raw memory fetching (
944807d, various fixes)Two-layer e2e tests: End-to-end tests for memory layer assignment, C1 dedup isolation, session summary persistence, and 6-category extraction model (
dcf7b80)
Documentation
Two-layer memory system docs: Updated architecture, memory model, configuration, monitoring, REST API, MCP tools, and management UI documentation for the new two-layer system and consolidation service (
2bbb041)OpenClaw client guide: New
docs/clients/openclaw.mdsetup guide (b2147ac)
CI
npm publishing workflow: New GitHub Actions workflow for publishing OpenCode and OpenClaw plugins as npm packages on tag push (
opencode-v*,openclaw-v*) (de73102)Selective Python publishing: Python publish workflow now skips non-mnemory release tags (
23d7c0a)
[1.8.3] — 2026-03-23
Bug Fixes
Reject unsupported categories in
add_memory: User-provided categories are now validated immediately against the predefined set before entering the LLM pipeline. Previously, invalid categories (e.g., "professional", "coding") were silently downgraded to an empty list via the_validate_metadata()fallback, making those memories invisible in the UI's category filters. Now returns a clear error listing valid categories, matching the existing behavior ofupdate_memory(). LLM-extracted categories are also filtered against the predefined set during parsing, preventing hallucinated categories from entering the pipeline and reducing unnecessary LLM retry calls.Note: Memories previously stored with invalid categories may still have empty category lists. Use the built-in health checker (fsck) to detect and re-classify affected memories.
[1.8.2] — 2026-03-20
OpenWebUI Filter
Fixed prompt cache invalidation: Recalled memories are now appended after the last user message instead of inserted before it. The previous insertion strategy shifted the cached prefix boundary on every turn, causing OpenAI prompt cache misses (~10% hit rate). The new append strategy preserves the entire conversation history as a stable prefix, restoring cache hit rates to ~70% — matching the behavior without the filter. Measured savings: ~60% reduction in input token cost per request (
41dc285)First-turn initialization: Filter now correctly loads instructions and core memories on the first message of a conversation, using the
/api/recallendpoint withinclude_instructions=Trueandmanaged=True(78c638b)
Instructions
Composable instruction blocks with managed mode: Refactored instruction system into composable blocks (
_INTRO_*,_RECALL_*,_STORAGE_*,_GUIDANCE_*) that can be combined per mode. Newmanagedflag for plugin/filter clients that handle recall and storage automatically — produces minimal instructions telling the LLM not to duplicate automatic operations. Supportsmanaged=Truewith optionalinstruction_modeoverride for personality/proactive guidance within managed contexts (75dec50)
[1.8.1] — 2026-03-16
Bug Fixes
MCP tools no longer block the event loop: All 19 MCP tool functions converted from synchronous to
async defwithasyncio.to_thread(). Previously, blocking LLM calls (28–40s) ran directly on the asyncio event loop, preventing/healthfrom responding and causing Kubernetes liveness probe failures. The server now remains responsive during all MCP operations (80db248)TOCTOU race in
update_memoryanddelete_memory: Access control check (verify_memory_access) and the mutating operation are now executed atomically in a single thread call, eliminating a race window introduced by the async conversion (80db248)
Performance
Bounded thread pool for MCP tool execution: A configurable
ThreadPoolExecutor(env varMCP_THREAD_POOL_SIZE, defaultmin(32, cpu_count + 4)) is set as the event loop's default executor. Multiple MCP tool calls can now execute concurrently instead of serializing on the event loop (80db248)Thread-safe service initialization:
_get_service()uses double-checked locking to prevent race conditions when multipleasyncio.to_thread()calls trigger lazy initialization concurrently (80db248)
Observability
Thread pool Prometheus metrics: Two new gauges —
mnemory_thread_pool_max_workers(configured pool size) andmnemory_thread_pool_threads(spawned thread count) — for monitoring thread pool utilization (80db248)
[1.8.0] — 2026-03-14
Client-Provided Labels
Labels metadata on memories: Memories now support optional key-value labels (e.g.,
project,topic,conversation_id) that bypass LLM extraction and are stored exactly as provided. Labels are inherited by all facts extracted duringinfer=True. Passlabelstoadd_memory,add_memories,remember, andupdate_memory. Filter by labels insearch_memories,find_memories,ask_memories, andlist_memorieswith AND logic (all must match). List values use any-of matching within a single key (18d18b1,fa7e566)Labels in REST API: All REST endpoints (add, search, find, ask, list, update, remember, recall) accept and return labels. Pydantic schemas updated (
18d18b1,fa7e566)Labels in UI: Management UI supports labels input (JSON), display as badges, client-side filtering, and edit modal support (
18d18b1)Labels validation: Keys must be alphanumeric + underscore, starting with letter or underscore. Values can be str, int, float, bool, or list[str]. Max 20 labels per memory (configurable). Reserved keys (memory_type, user_id, etc.) are rejected (
fa7e566)Labels config: New env vars
LABELS_MAX_FIELDS(default 20),LABELS_MAX_KEY_LENGTH(default 64),LABELS_MAX_VALUE_LENGTH(default 256),LABELS_INDEXES(optional Qdrant payload indexes for label keys) (fa7e566)
Prometheus Timing Instrumentation
LLM, embedding, and Qdrant latency histograms: 3 new Prometheus histograms (
mnemory_llm_duration_seconds,mnemory_embedding_duration_seconds,mnemory_qdrant_duration_seconds) with operation labels. All 13 LLM call sites, embedding operations, sparse embedding, and all Qdrant vector operations are instrumented (937d112)find_memories pipeline timing: Per-step timing breakdown (query_gen, embed, search, rerank) logged at INFO level (
937d112)Grafana dashboard: 6 new latency panels (LLM p95 by operation, call rate, embedding p95, Qdrant p95, LLM p50 vs p95 by model) (
937d112)
Token Usage Optimization
Compact MCP tool docstrings: Reduced tool description overhead from ~5,500 to ~1,500 tokens per request by moving detailed parameter guidance from docstrings to server instructions. Estimated savings: ~4,000 prompt tokens per LLM request (
79818c6)include_instructionsflag oninitialize_memory: Set tofalsewhen the client already has instructions via MCP instructions field, avoiding duplicate instructions in context (79818c6)OpenWebUI filter: strip redundant MCP tools: Filter now strips
initialize_memory,get_core_memories,get_recent_memoriesfrom tool_ids (saving ~800 tokens) and injects memory context before the last user message for better prompt caching (41f7e8f)
Bug Fixes
Sub-agent memories now visible in MCP search tools: The
search_memories,find_memories,ask_memories, andlist_memoriesMCP tools silently ignored theagent_idtool parameter whenX-Agent-Idheader was set, making sub-agent memories (e.g.,openwebui:miroslav) invisible in search results. Now properly resolves theagent_idparameter, honoring sub-agent scope while blocking cross-agent access (3a7de1f)
Performance
Eliminated redundant embedding API call in dual-scope search:
search_memories_dual_scope()now pre-computes the dense embedding once and reuses it across both sub-searches, halving embedding latency for dual-scope searches (3a7de1f)
Observability
Granular search mode tracking: Vector store tracks
hybrid,dense-formula, anddense-simplemodes, logged at INFO level with duration and result count (3a7de1f)Search summary logging: Both search methods log mode, threshold, result count, and filtered count at INFO level (
3a7de1f)Warnings for dense-only fallback: WARNING-level logs when sparse vector is unavailable or hybrid search fails (
3a7de1f)
Documentation
Corrected RRF score range: Qdrant's default RRF k=1 produces scores ~0.1-1.0, not ~0.01-0.03 as previously documented for k=60 (
3a7de1f)
[1.7.0] — 2026-03-05
Secure Artifact Download Tokens
HMAC-signed download tokens: Replaced long-lived API keys in URLs with short-lived, stateless HMAC-signed tokens for artifact raw access. Tokens are scoped to a specific artifact, expire after a configurable TTL (default 1 hour, max 24 hours), and are verified without server-side storage. Browser-embedded
<img src="...?token=...">and download links now use these tokens instead of API keys (29b2223)New MCP tool
get_artifact_url: Generates a signed download URL for direct browser access to artifacts. Returns URL, expiry, content type, filename, and size. Use when artifacts are binary or larger than 1 MB (29b2223)New REST endpoint
POST /api/memories/{id}/artifacts/{aid}/download-token: Authenticated endpoint that generates a download token with optional custom TTL. Returns the token and a ready-to-use URL (29b2223)1 MB binary inline cap on
get_artifact: Binary artifacts larger than 1 MB are no longer returned inline via the MCPget_artifacttool. Instead, a guidance message directs the client to useget_artifact_url. Text artifacts are unaffected (29b2223)Removed
keyquery parameter: Thekeyquery parameter for passing API keys in URLs has been removed from the auth middleware. All browser-embedded artifact access must use download tokens (29b2223)New config vars:
SERVER_BASE_URL(for full URL generation),DOWNLOAD_TOKEN_TTL(default 3600s),DOWNLOAD_TOKEN_MAX_TTL(default 86400s) (29b2223)
Binary Artifact Support
Fixed binary artifact retrieval: Binary artifacts (images, PDFs, etc.) now return full content as a single base64 blob instead of being truncated by text pagination. Added
load_raw()method for direct byte access andGET /api/memories/{id}/artifacts/{aid}/rawendpoint for browser rendering (ff89fc7)Increased max artifact size to 10 MB:
MAX_ARTIFACT_SIZEdefault raised from 100 KB to 10 MB (10485760 bytes) (ff89fc7)UI binary rendering: Management UI now detects binary artifacts — images render inline via
<img>, other binary types show download links. Text artifacts retain paginated display (ff89fc7)
New MCP Tool: ask_memories
ask_memoriestool: Ask a natural language question and get a human-readable prose answer synthesized from stored memories. Usesfind_memoriesinternally for retrieval, then passes results to an LLM for answer generation. Setinclude_memories=trueto also receive the supporting memories. Most expensive operation (3 LLM calls) — use when you need a synthesized answer rather than raw results (db2fd19)
Performance
Parallelized find/ask search queries:
find_memoriesandask_memoriesnow run generated search queries concurrently usingThreadPoolExecutorinstead of sequentially, reducing latency by ~400–1200 ms depending on query count (407926d)Configurable find/ask LLM model: New
FIND_LLM_MODELenv var allows using a faster/cheaper model for query generation and reranking in the find/ask pipeline (407926d)
Bug Fixes
Core memories no longer hard-truncated: Replaced hard character truncation with per-section entry limits (
CORE_MAX_PER_SECTION). Main sections are never truncated — only the recent context section is gracefully trimmed per-entry. Improved agent memory guidance in core memories output (856a564)Code analysis no longer misclassified as permanent facts: Extraction prompts updated to prevent transient technical observations and code analysis conclusions from being stored as permanent
facttype memories (1c51431)Session-specific assistant memories filtered from extraction: Extraction prompts now filter out session-specific assistant memories (e.g., "I concluded X in this session") that should not persist across conversations (
7ec1b3d)
[1.6.1] — 2026-03-04
Bug Fixes
Episodic memories now always have
event_date: Episodic memories (decisions, intents, goals, interactions) created via the remember endpoint or add_memory were stored withoutevent_datebecause extraction prompts instructed the LLM to set null for facts without explicit temporal anchors. Updated all 5 extraction prompt sections and ~18 examples to clarify that episodic events should default to today's date. Added a code-level fallback in_execute_action()that auto-setsevent_dateto today (UTC) for episodic memories when neither the LLM nor the caller provides one (f2d038f)
[1.6.0] — 2026-03-04
Hybrid Search
BM25 sparse vectors + RRF fusion: Search now uses Qdrant's native hybrid search — dense vectors (semantic similarity) and BM25 sparse vectors (keyword matching) fused with Reciprocal Rank Fusion (RRF). Replaces the old Python-side keyword boost post-processing. Results are more accurate for queries containing specific terms, names, or identifiers (
276521a)fastembed is now a required dependency:
fastembed>=0.4.0moved from optional to main dependencies. The BM25 model (~50MB) is pre-downloaded in the Docker image at build time (276521a)Importance reranking: Post-RRF importance boost applied in Python (weighted by
IMPORTANCE_WEIGHTS), replacing the previousFormulaQueryapproach which is unreliable inside Qdrant Prefetch (qdrant/qdrant#6836) (276521a)New config vars:
SEARCH_SPARSE_MODEL(defaultQdrant/bm25),SEARCH_SCORE_THRESHOLD_HYBRID(default0.0— RRF scores are ~0.016–0.033, not 0–1 like cosine) (276521a)Deprecated:
SEARCH_KEYWORD_WEIGHTis no longer used (keyword matching is now handled by BM25 sparse vectors natively in Qdrant)Dense-only fallback: If hybrid search fails at query time (e.g., Qdrant version mismatch), the system gracefully falls back to dense-only search (
3199a47)Python 3.14 not supported: fastembed's BM25 model depends on
py_rust_stemmers, a Rust extension that segfaults on Python 3.14 due to a PyO3/C API incompatibility (qdrant/fastembed#576). Use Python 3.11–3.13 (3.13 recommended). The Docker image usespython:3.13-slim(9f2b920)
Data Migrations
Automatic migration framework: New
MigrationRunnerinmnemory/migration.py— idempotent, resumable with batch checkpointing, state tracked in_mnemory_metaQdrant collection. Health endpoint returns 503 during migration. Existing instances get sparse vectors added via001_add_sparse_vectorson first startup. Note: migration may take several minutes for large instances (processes all existing memories in batches of 100) (276521a)Collection recreation fallback: Migration handles Qdrant rejecting sparse vector addition by recreating the collection with correct config (
4b4e7a7)
Session Persistence
Persistent session storage: Sessions now survive server restarts via pluggable backends — SQLite (default for local/single-node), Redis (for clustered deployments), or in-memory (tests). Uses a write-through cache pattern: in-memory dict for fast reads, backend for durability, lazy loading on cache miss (
eb3eddf)24-hour session TTL: Default
MEMORY_SESSION_TTLincreased from 1 hour to 24 hours. Both recall and remember calls reset the idle timer (auto-prolong), so active conversations never expire (eb3eddf)Remember auto-prolong: The remember endpoint now touches the session to reset its idle timeout, preventing session expiry during active conversations that only use remember (not recall) (
eb3eddf)Redis optional dependency: Added
redis>=5.0.0as optional dependency, installable viapip install mnemory[redis](eb3eddf)New env vars:
SESSION_BACKEND(sqlite/redis/memory),SESSION_PATH(SQLite DB path),REDIS_URL(Redis connection). Auto-detects Redis whenREDIS_URLis set (eb3eddf)
Remember Pipeline
Two-stage extract+dedup pipeline: Remember pipeline rewritten to separate fact extraction from deduplication, with session context tracking for conversation continuity across multiple remember calls (
b089a48)Three-way role semantics with auto mode: Remember pipeline now supports
role=None(auto mode) that extracts facts from all conversation participants, attributing each to the correct role. Assistant facts requireagent_id(521b8ba)
Role Handling
Role extraction fix for
role=assistant: Agent memories withinfer=Truenow correctly use the agent extraction prompt (ff25699)Role metadata written on UPDATE actions: Dedup UPDATE actions now correctly persist the role field in metadata (
942568a)
Core Memories
Dedup core memories against search results:
get_core_memoriesresults are deduplicated against search results, and recent memories are filtered by importance (969b786)
Fsck Improvements
Detect and fix wrong role metadata: Quality phase now detects memories with incorrect
rolefield and proposes fixes (23bc415)
Prompt & Extraction Improvements
Softer dedup language: Reduced over-suppression of new memories by softening dedup prompt guidance (
ea3407e)Restored inline examples: Re-added extraction examples and rules that were dropped during the remember pipeline rewrite (
bbf5f8d)Improved extraction reliability: Better remember extraction reliability and classification (
b378182)
[1.5.0] — 2026-02-28
Batch Operations
Batch delete API and MCP tool: New
delete_memoriesMCP tool andDELETE /api/memories/batchendpoint for deleting multiple memories in a single call (94698a9)Bulk selection in UI: Browse tab now supports select-all, shift-click range selection, and batch delete for managing large memory sets (
c9637c9)
Memory Intelligence
Context hint in remember pipeline: Plugins can pass a context hint (e.g., working directory, current topic) to the remember endpoint, improving extraction relevance for project-scoped work (
7a00f72)Dual-scope deduplication: Agent-scoped memories are now deduplicated against both agent-specific and shared user memories, preventing cross-scope duplicates (
9220a10)Improved memory_type classification: Better prompt guidance for classifying goals, intents, and decisions — goals/intents are now correctly classified as
episodicrather thanfact, with expanded e2e test coverage (d6c3b8d)Clarified extraction guidance: Fact-extraction prompts refined to better distinguish stable facts from transient observations (
be30809)
Fsck / Health Checks
Artifact-aware fsck: Split actions are skipped and delete actions trigger warnings for memories with attached artifacts, preventing accidental data loss (
4562a36)Auto-fsck UI: Check tab now shows scheduling status banner with interval, next-run countdown, run-now button, and last auto-fsck results display (
590374b)Auto-fsck race condition fix: Resolved issue where UI showed auto-applied issues as unapplied due to a timing race between apply and UI refresh (
2e6e488)
Management UI
Refresh button: Manual refresh button added to the dashboard header (
12d3dde)
Integrations
MNEMORY_INCLUDE_ASSISTANT option: Claude Code and OpenCode plugins can now include assistant messages in remember flows, enabling the server to extract agent identity and capability facts (
1df5e63)OpenCode child session handling: OpenCode plugin skips memory recall/remember for child/subtask sessions to avoid noise from automated sub-agent work (
6439dd4)
Documentation
Docs reorganization: README split into dedicated documentation pages under
docs/— architecture, configuration, deployment, development, management UI, MCP tools, memory model, monitoring, and REST API (9475191)
[1.4.0] — 2026-02-27
Periodic Maintenance (Auto-fsck)
Background maintenance service: New
MaintenanceService(mnemory/maintenance.py) runs automatic memory consistency checks on a configurable schedule. Sleep-first loop (waits the full interval before the first run), per-user error isolation, andasyncio.to_thread()for sync LLM work (d7f5139)Auto-apply with thresholds: Fixes that meet configurable confidence (
FSCK_AUTO_MIN_CONFIDENCE, default 0.95) and severity (FSCK_AUTO_MIN_SEVERITY, defaultmedium) thresholds are applied automatically. Issues below either threshold are skipped (d7f5139)New config vars:
FSCK_AUTO_INTERVAL(hours, default 0 = disabled),FSCK_AUTO_MIN_CONFIDENCE(0.0–1.0),FSCK_AUTO_MIN_SEVERITY(low/medium/high) (d7f5139)User enumeration: New
VectorStore.list_user_ids()scrolls all Qdrant points to enumerate distinct users for the maintenance loop (d7f5139)
Metrics
Auto-fsck Prometheus metrics: Four new counters (
mnemory_autofsck_runs_total,mnemory_autofsck_issues_found_total,mnemory_autofsck_fixes_applied_total,mnemory_autofsck_fixes_failed_total) and a gauge (mnemory_autofsck_last_run_timestamp), all labeled byuser_id(d7f5139)Stats API extension:
GET /api/statsnow includes anautofscksection with enabled flag, config, per-user run history, and aggregated totals (d7f5139)
Management UI
Auto-fsck status banner: Check tab shows a teal status banner when auto-fsck is enabled, displaying interval, confidence, severity, last run age, and fixes applied (
d7f5139)Last Auto-Check stat card: Dashboard shows a 7th stat card with the age of the last auto-fsck run (conditional on auto-fsck being enabled) (
d7f5139)
Grafana Dashboard
Auto-fsck row: New "Auto-fsck" row with four panels — Last Auto-Check age (color thresholds: green <1h, yellow <24h, red >24h), Issues Found, Fixes Applied, and an Activity timeseries showing fixes applied and issues found per hour (
d7f5139)
Fsck Improvements
Apply idempotency:
apply_checktracks applied issue IDs and skips re-applying on repeated calls (d7a9b8a)Background cleanup task:
FsckStorenow hasstart_cleanup_task()/stop_cleanup_task()for periodic sweep of expired checks, wired into server lifespan (d7a9b8a)Apply validations: Category and memory type values in update actions are validated and stripped if invalid, preventing bad metadata from being written (
d7a9b8a)Ownership checks: Apply actions verify memory ownership before mutating, skipping memories belonging to other users (
d7a9b8a)Scroll pagination:
scroll_with_vectorsnow paginates correctly for large collections (d7a9b8a)FSCK_LLM_MODEL / FSCK_REASONING_EFFORT: Override the LLM model and reasoning effort specifically for fsck checks, independent of the main
LLM_MODEL(df4be81)LLM security re-evaluation: Regex-flagged memories are re-evaluated by the LLM before being reported as security issues, reducing false positives (
75febcf)Confidence field: All fsck issues now carry a
confidencescore (0.0–1.0) from the LLM, surfaced in the UI and used for auto-apply threshold filtering (75febcf)
Core Memories
Top-N non-pinned memories:
get_core_memoriesnow includes the top-N most important non-pinned memories per section, configurable viaCORE_TOP_MEMORIES(default 10) andCORE_MIN_IMPORTANCE(defaultnormal) (40c085e)
Documentation
Check UI screenshots: Three new screenshots for the Check tab (progress, results, detail) added to README (
4b87ca9)Periodic Maintenance section: README documents the auto-fsck feature with configuration example and how-it-works description (
d7f5139)
[1.3.0] — 2026-02-25
Management UI
Built-in web UI: Full management UI at
/ui— dashboard, search, browse/CRUD, and graph visualization. Alpine.js + Tailwind CSS + Chart.js + D3.js, all vendored as static files with zero external dependencies (14d1546)Dashboard: Memory totals, breakdowns by type/category/role (Chart.js donut charts), operation counts, per-user filtering, server version display, auto-refresh with manual refresh button (
66dbf1e)Search tab: Semantic search (
search_memories) and AI-powered find (find_memories) with filters — memory type, role, agent ID, categories multi-select, "has artifacts" toggle, include decayed, result limit. Sort by score, newest, or oldest (66dbf1e,33d2a7f,7cb089f)Browse tab: Full CRUD with server-side sorting (newest/oldest via Qdrant
order_by), Add Memory modal, inline edit modal (content, type, categories, importance, pinned, TTL), delete with confirmation, and artifact management (upload, view with pagination, delete) (bbeb69c,33d2a7f)Graph tab: D3.js force-directed visualization of memory relationships (shared categories = edges, node size = importance, color = memory type). Type filter checkboxes, node limit slider, click-to-select detail panel (
14d1546)Card layout: Two-zone badge row — left: type + importance +
#categorytags; right: agent badge + artifacts indicator + assistant chip + pinned star (7cb089f)Agent filtering: Agent ID dropdown filter in both Search and Browse tabs, with agent badges (robot icon + name) visible on cards without expanding (
7cb089f)Session persistence: API key and selected user stored in localStorage (persists across tab closes) (
8171f02)
Backend Improvements
Server-side sorting:
GET /api/memoriesacceptssortquery param (newest/oldest). Uses Qdrantorder_bywith automatic datetime payload index creation on startup (33d2a7f,ff83be4)Index management:
_ensure_indexes()extracted as separate method, runs on every startup (not just collection creation). Existing collections now get new indexes automatically (ff83be4)Ordering fallback:
get_all()gracefully falls back to Python-side sorting if Qdrantorder_byfails (e.g., missing index on older collections) (ff83be4)agent_id metadata fix:
format_memory_item()now injects top-levelagent_idback into metadata dict, fixing agent badges not appearing in API responses (7cb089f)OpenAPI sanitization: Schema cleanup for OpenAI function-calling compatibility (
7ce33a9)Non-conversational message filtering:
remember()ignores tool calls, system messages, and other non-conversational content (9f08f38)Runtime version loading: Package version loaded via
importlib.metadataat runtime with dev fallback (2640aad)
Extraction & Search
English extraction: Extraction prompts now require English output regardless of input language (
a567984)Third-party guidance: Extraction prompts include guidance for handling third-party information mentioned in conversations (
a567984)
Testing
End-to-end test suite: Comprehensive e2e tests exercising the full pipeline (extraction → storage → search) with real LLM calls and embedded Qdrant. Excluded from default
pytestrun via-m 'not e2e'(4b7353e)
Documentation
Client setup guides: Dedicated docs for Claude Code, ChatGPT, Claude Desktop, Open WebUI, OpenCode, Cursor, Windsurf, Cline, Continue.dev, and Codex CLI (
e283c48)UI screenshots: Dashboard, search, browse, and graph screenshots added to README (
47defec)
[1.2.0] — 2026-02-24
Monitoring
Prometheus metrics endpoint: New
/metricsendpoint with operation counters (mnemory_operations_total) and Qdrant-backed gauges for memory counts by type, category, role, decay, and pinned status. Configurable cache TTL and optionalprometheus_clientdependency (3951649)Management port: New
MGMT_PORTconfig to serve/healthand/metricson a separate port without authentication — designed for Kubernetes probes and Prometheus scraping (3951649)Grafana dashboard: Pre-built dashboard with memory overview, operation rates, and breakdowns by type/category/role with user and agent filtering (
f48c909)
Security
Prompt injection safeguards: All 6 LLM prompt builders hardened with Unicode boundary tags (
⟨user_input⟩,⟨existing_memories⟩) and anti-injection preamble. Content within tags is escaped to prevent breakout (95f61bb)Injection detection logging: Common prompt injection patterns (role overrides, instruction manipulation, boundary tag abuse) are detected and logged at WARNING level without blocking storage (
95f61bb)Category name validation:
project:<name>categories validated against a safe character regex to prevent prompt format injection (95f61bb)Role validation: REST
rememberendpoint and Pydantic schemas enforce an allowlist of valid message roles (95f61bb)Per-memory boundary tags: Core memories output wraps each memory in
⟨memory_item⟩tags to prevent cross-memory poisoning and section header forgery (5cb8daf)Agent identity gating:
role="assistant"memories now requireinfer=True— direct injection of arbitrary agent personality viainfer=Falseis blocked withValueError(5cb8daf)Input length validation:
infer=Falsepath now has the same 400K character cap asinfer=True. Pydanticmax_lengthconstraints added to 10 request fields across all schemas (5cb8daf)Output escaping: Markdown headers in memory text are escaped in
format_memory_item()and_format_memories()to prevent section forgery in search results and core memories (5cb8daf)Error sanitization:
initialize_memoryerror messages truncated to 200 chars with newlines stripped to prevent information leakage (5cb8daf)
[1.1.0] — 2026-02-24
REST API & Intelligence Layer
REST API foundation: Full memory CRUD + artifact operations as FastAPI sub-app mounted at
/api/, with auto-generated OpenAPI spec at/api/docs(ceb07f1)Recall endpoint (
POST /api/recall): Combined initialize + search in one call with server-side session tracking to avoid context bloat. First call returns instructions + core memories + AI-powered search; subsequent calls return only new memories (1747af6)Remember endpoint (
POST /api/remember): Fire-and-forget memory storage from conversation turns with rate limiting and session deduplication (1747af6)Configurable search modes: Per-request
search_mode(find vs search) andscore_thresholdon recall endpoint (2c240de,1f1e259,13b3dde)Cross-agent access control: Dual-scope search and agent memory isolation in REST endpoints (
7997e29)Input validation and session bounds: Request validation, response models, and
_MAX_KNOWN_IDScap on session tracking (bfd90a2)
Plugins
Open WebUI filter: Automatic recall on inlet, remember on outlet, with configurable status messages and
show_statususer valve (75bb955,6a43998,444b2d8)OpenCode plugin: TypeScript plugin with system prompt injection via
experimental.chat.system.transform, pre-fetched recall with async caching, fire-and-forget remember, and compaction persistence (f658c48,1592071)Managed instructions: New
build_managed_instructions()for plugin-driven setups — tells the LLM what's automatic and what's available for explicit use (1747af6)
Memory Intelligence
Context-aware query generation:
find_memoriesaccepts an optionalcontexthint (e.g., working directory) and injects the user'sproject:*categories into the query generation prompt for more targeted search (8247906)Temporal reasoning:
event_dateparameter onadd_memoryanchors relative time references ("yesterday" resolves correctly).find_memoriesgenerates date-aware queries using session timezone (d537d62,9ecdc64)Improved extraction quality: Better extraction rules, conversation-aware prompts that filter assistant noise, and LLM-backed metadata validation with retry (
737f7b2,a3f0e48,f9c1df5)
Artifacts
Auto-artifact creation: LLM-guided for
infer=True(extraction prompt decides viastore_artifactflag), size-based forinfer=False(content exceedingMAX_MEMORY_LENGTHauto-saved). Newremember()method for conversation processing (08a998c)M:N artifact linking: Artifacts decoupled from individual memories — one artifact can be referenced by multiple memories. Storage path changed from
{user_id}/{memory_id}/{artifact_id}/to{user_id}/{artifact_id}/(cee1f6a)Artifact garbage collection: Deleting a memory checks if other memories still reference the same artifact; orphaned artifacts are cleaned up (
cee1f6a)
LLM & Provider Compatibility
Provider adaptation: Automatic handling of parameter incompatibilities across OpenAI-compatible providers (reasoning_effort, json_schema support) (
7c585b7)Robust error handling: Retry logic and graceful handling of
BadRequestErrorfor chat completions (f2c11fa)
Benchmarks
LoCoMo benchmark suite: Evaluation on 1540 QA questions across 4 categories (single_hop, multi_hop, temporal, open_domain). Overall score: 73.2 with
gpt-5-mini(26798ff,7c976ca)
Bug Fixes
Serialize local embedded Qdrant write operations to prevent concurrency issues (
3efc793)Handle session compaction with fresh recall and re-injection (
bdef0e0)Configurable
request_timeoutin Open WebUI filter instead of hardcoded 10s (444b2d8)
Breaking Changes
Artifact storage path changed:
{user_id}/{memory_id}/{artifact_id}/{filename}→{user_id}/{artifact_id}/{filename}. Existing artifacts at the old path become inaccessible. Re-create affected artifacts or manually move them.
[1.0.0] — 2025-02-02
Initial release. MCP server with persistent two-tier memory (Qdrant + S3/filesystem), unified LLM extraction/classification/deduplication pipeline, semantic search with importance reranking, TTL-based memory decay, role-based scoping, and configurable behavioral instructions.
212 files · 196 not served here
- .dockerignore (not served here)
- .github/workflows/docker-publish.yml (not served here)
- .github/workflows/npm-publish.yml (not served here)
- .github/workflows/openclaw-test.yml (not served here)
- .github/workflows/python-publish.yml (not served here)
- .gitignore (not served here)
- AGENTS.md (not served here)
- ATTRIBUTION.md
- CHANGELOG.md
- Dockerfile (not served here)
- LICENSE
- Makefile (not served here)
- README.md
- benchmarks/README.md (not served here)
- benchmarks/__init__.py (not served here)
- benchmarks/fsck_allocations.py (not served here)
- benchmarks/locomo/__init__.py (not served here)
- benchmarks/locomo/__main__.py (not served here)
- benchmarks/locomo/answer.py (not served here)
- benchmarks/locomo/config.py (not served here)
- benchmarks/locomo/dataset.py (not served here)
- benchmarks/locomo/evaluate.py (not served here)
- benchmarks/locomo/ingest.py (not served here)
- benchmarks/locomo/report.py (not served here)
- benchmarks/locomo/runner.py (not served here)
- benchmarks/locomo/search.py (not served here)
- benchmarks/maintenance_fencing.py (not served here)
- benchmarks/maintenance_fsck.py (not served here)
- benchmarks/maintenance_scan.py (not served here)
- docker-compose.yaml (not served here)
- docs/README.md
- docs/architecture.md
- docs/cache-expiry-bound.md
- docs/clients/chatgpt.md (not served here)
- docs/clients/claude-code.md (not served here)
- docs/clients/claude-desktop.md (not served here)
- docs/clients/cline.md (not served here)
- docs/clients/codex.md (not served here)
- docs/clients/continue.md (not served here)
- docs/clients/cursor.md (not served here)
- docs/clients/hermes.md (not served here)
- docs/clients/open-webui.md (not served here)
- docs/clients/openclaw.md (not served here)
- docs/clients/opencode.md (not served here)
- docs/clients/windsurf.md (not served here)
- docs/configuration.md (not served here)
- docs/deletion.md
- docs/deployment.md (not served here)
- docs/development.md (not served here)
- docs/maintenance-performance.md
- docs/maintenance-recovery.md
- docs/management-ui.md
- docs/mcp-tools.md
- docs/memory-model.md
- docs/monitoring.md
- docs/quickstart.md (not served here)
- docs/resource-audit-optimizations.md
- docs/rest-api.md
- docs/system-prompts/claude-code.md (not served here)
- docs/system-prompts/openwebui-basic.md (not served here)
- docs/system-prompts/openwebui-personality.md (not served here)
- files/banner.png (not served here)
- files/screenshots/ui-check-detail.jpg (not served here)
- files/screenshots/ui-check-progress.jpg (not served here)
- files/screenshots/ui-check-results.jpg (not served here)
- files/screenshots/ui-dashboard.jpg (not served here)
- files/screenshots/ui-graph.jpg (not served here)
- files/screenshots/ui-memories.jpg (not served here)
- files/screenshots/ui-search.jpg (not served here)
- integrations/claude-code/README.md (not served here)
- integrations/claude-code/hooks.json (not served here)
- integrations/claude-code/scripts/recall.sh (not served here)
- integrations/claude-code/scripts/remember.sh (not served here)
- integrations/grafana/README.md (not served here)
- integrations/grafana/dashboard.json (not served here)
- integrations/hermes/README.md (not served here)
- integrations/hermes/__init__.py (not served here)
- integrations/hermes/client.py (not served here)
- integrations/hermes/config.py (not served here)
- integrations/hermes/helpers.py (not served here)
- integrations/hermes/hooks.py (not served here)
- integrations/hermes/plugin.yaml (not served here)
- integrations/hermes/pyproject.toml (not served here)
- integrations/hermes/tests/__init__.py (not served here)
- integrations/hermes/tests/test_config.py (not served here)
- integrations/hermes/tests/test_helpers.py (not served here)
- integrations/hermes/tools.py (not served here)
- integrations/openclaw/README.md (not served here)
- integrations/openclaw/client.ts (not served here)
- integrations/openclaw/config.ts (not served here)
- integrations/openclaw/index.test.ts (not served here)
- integrations/openclaw/index.ts (not served here)
- integrations/openclaw/openclaw.plugin.json (not served here)
- integrations/openclaw/openclaw.test.mjs (not served here)
- integrations/openclaw/package-lock.json (not served here)
- integrations/openclaw/package.json (not served here)
- integrations/openclaw/package.test.mjs (not served here)
- integrations/opencode/README.md (not served here)
- integrations/opencode/client.ts (not served here)
- integrations/opencode/helpers.test.ts (not served here)
- integrations/opencode/helpers.ts (not served here)
- integrations/opencode/hooks.test.ts (not served here)
- integrations/opencode/hooks.ts (not served here)
- integrations/opencode/index.ts (not served here)
- integrations/opencode/opencode.json (not served here)
- integrations/opencode/package.json (not served here)
- integrations/opencode/tools.ts (not served here)
- integrations/openwebui/README.md (not served here)
- integrations/openwebui/mnemory_filter.py (not served here)
- mnemory/__init__.py (not served here)
- mnemory/api/__init__.py (not served here)
- mnemory/api/auth.py (not served here)
- mnemory/api/deps.py (not served here)
- mnemory/api/evidence.py (not served here)
- mnemory/api/fsck.py (not served here)
- mnemory/api/memories.py (not served here)
- mnemory/api/recall.py (not served here)
- mnemory/api/remember.py (not served here)
- mnemory/api/schemas.py (not served here)
- mnemory/api/sessions.py (not served here)
- mnemory/api/ui.py (not served here)
- mnemory/api/ui_projections.py (not served here)
- mnemory/api/user_events.py (not served here)
- mnemory/auth.py (not served here)
- mnemory/cache.py (not served here)
- mnemory/categories.py (not served here)
- mnemory/config.py (not served here)
- mnemory/consolidation.py (not served here)
- mnemory/embeddings.py (not served here)
- mnemory/fsck.py (not served here)
- mnemory/inference.py (not served here)
- mnemory/instructions.py (not served here)
- mnemory/llm.py (not served here)
- mnemory/maintenance.py (not served here)
- mnemory/maintenance_state.py (not served here)
- mnemory/memory.py (not served here)
- mnemory/metrics.py (not served here)
- mnemory/migration.py (not served here)
- mnemory/prompts.py (not served here)
- mnemory/revisions.py (not served here)
- mnemory/sanitize.py (not served here)
- mnemory/server.py (not served here)
- mnemory/session.py (not served here)
- mnemory/sparse.py (not served here)
- mnemory/storage/__init__.py (not served here)
- mnemory/storage/artifact.py (not served here)
- mnemory/storage/session.py (not served here)
- mnemory/storage/vector.py (not served here)
- mnemory/tokens.py (not served here)
- mnemory/trusted_events.py (not served here)
- mnemory/ttl.py (not served here)
- mnemory/ui/__init__.py (not served here)
- mnemory/ui/src/input.css (not served here)
- mnemory/ui/static/css/app.css (not served here)
- mnemory/ui/static/index.html (not served here)
- mnemory/ui/static/js/api.js (not served here)
- mnemory/ui/static/js/app.js (not served here)
- mnemory/ui/static/js/fsck.js (not served here)
- mnemory/ui/static/js/graph.js (not served here)
- mnemory/ui/static/js/memories.js (not served here)
- mnemory/ui/static/js/metrics.js (not served here)
- mnemory/ui/static/js/search.js (not served here)
- mnemory/ui/static/js/sessions.js (not served here)
- mnemory/ui/static/js/user.js (not served here)
- mnemory/ui/static/vendor/alpine.min.js (not served here)
- mnemory/ui/static/vendor/chart.umd.min.js (not served here)
- mnemory/ui/static/vendor/d3.min.js (not served here)
- mnemory/ui/tailwind.config.js (not served here)
- pyproject.toml (not served here)
- tests/__init__.py (not served here)
- tests/conftest.py (not served here)
- tests/contract/fixtures/evidence_remember_v1.json (not served here)
- tests/test_agent_scoping.py (not served here)
- tests/test_api.py (not served here)
- tests/test_artifact.py (not served here)
- tests/test_cache.py (not served here)
- tests/test_cache_bounded.py (not served here)
- tests/test_categories.py (not served here)
- tests/test_config.py (not served here)
- tests/test_consolidation.py (not served here)
- tests/test_e2e.py (not served here)
- tests/test_evidence_transport.py (not served here)
- tests/test_fsck.py (not served here)
- tests/test_fsck_journal.py (not served here)
- tests/test_ghcr_workflow_contract.py (not served here)
- tests/test_jwt_auth.py (not served here)
- tests/test_labels.py (not served here)
- tests/test_llm.py (not served here)
- tests/test_maintenance.py (not served here)
- tests/test_maintenance_scheduling.py (not served here)
- tests/test_maintenance_state.py (not served here)
- tests/test_managed_inference.py (not served here)
- tests/test_memory.py (not served here)
- tests/test_memory_management_api.py (not served here)
- tests/test_metrics.py (not served here)
- tests/test_migration.py (not served here)
- tests/test_prompts.py (not served here)
- tests/test_resource_audit.py (not served here)
- tests/test_revision_preconditions.py (not served here)
- tests/test_revisions.py (not served here)
- tests/test_revisions_remote.py (not served here)
- tests/test_sanitize.py (not served here)
- tests/test_session.py (not served here)
- tests/test_sessions_api.py (not served here)
- tests/test_sparse.py (not served here)
- tests/test_tokens.py (not served here)
- tests/test_trusted_rejection.py (not served here)
- tests/test_trusted_semantic.py (not served here)
- tests/test_ttl.py (not served here)
- tests/test_user_event_ingestion.py (not served here)
- tests/test_validation_decay.py (not served here)
- uv.lock (not served here)
Advantages
- Intelligent extraction and contradiction resolution ensure memory accuracy and prevent duplicate entries. evidence: README.md
- Self-hosted architecture ensures data privacy with no third-party access to stored memories. evidence: README.md
- Supports a wide range of clients through the Model Context Protocol and dedicated plugins. evidence: README.md
Limitations
- Deletion is best-effort and does not guarantee verified erasure or compliance. evidence: README.md
- Most MCP clients require a specific system prompt instruction to initialize memory correctly. evidence: docs/README.md
Security
Risk level: Low risk
This brain runs
Agent instructions that run or fetch something (8)
AGENTS.md:docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/fpytloun/mnemory:latest .AGENTS.md:docker buildx build --platform linux/amd64,linux/arm64 --push -t ghcr.io/fpytloun/mnemory:latest .AGENTS.md:# Unit tests (fast, no API key needed, default pytest run)AGENTS.md:They are **excluded from the default `pytest` run** via `addopts = "-m 'not e2e'"` in `pyproject.toml`.AGENTS.md:**When to run e2e tests:**AGENTS.md:Migrations run automatically on startup before the server accepts requests.AGENTS.md:Each migration has a unique ID (e.g., `001_add_sparse_vectors`), a `description`, and a `run()` methodAGENTS.md:Migrations must be **idempotent** — safe to re-run if interrupted mid-way or if multiple instances start simultaneously
MCP servers (1)
README.md(mnemory):http://localhost:8050/mcp· uses the network
- Low risk: network-instructions (AGENTS.md:88)
Attribution and licence
- Created by
- Filip Pytloun
- Declared authors
- Filip Pytloun (declared in pyproject.toml)
- Publisher
- Filip Pytloun (Community)
- Source
- fpytloun/mnemory · commit 2d83c47
- Licence
- Apache License 2.0 (files served here)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Filip Pytloun.
Install from source
196 of its files are not served here, so there is no ZIP. fpytloun/mnemory at 2d83c47