# mempalace | MemPalace | Knowledge Base | Instagit

The best-benchmarked open-source AI memory system. And it's free.

GitHub Stars: 54.2k

Repository: https://github.com/MemPalace/mempalace

---

## Articles

### [MemPalace Agent Diary System and Cross-Wing Navigation: Complete Technical Guide](/MemPalace/mempalace/mempalace-agent-diary-cross-wing-navigation)

Explore the MemPalace agent diary system and cross-wing navigation. Learn how this local-first architecture uses hierarchical drawers and graph tunnels for semantic concept connections across projects.

- Tags: technical-guide
- Published: 2026-06-07

### [MemPalace Docker Deployment with GPU Acceleration: Multi-Stage CUDA Build Guide](/MemPalace/mempalace/mempalace-docker-deployment-gpu-acceleration)

Deploy MemPalace with Docker and GPU acceleration. This guide details a multi-stage CUDA build for high-performance embedding inference using onnxruntime-gpu.

- Tags: how-to-guide
- Published: 2026-06-07

### [MemPalace Multi-Language Embedding Support and Configuration: A Deep Architectural Guide](/MemPalace/mempalace/mempalace-multi-language-embedding-support-configuration)

Explore MemPalace multi-language embedding support and configuration. Learn how to leverage the Embeddinggemma ONNX model and configure CPU fallback for efficient NLP.

- Tags: deep-dive
- Published: 2026-06-07

### [Implementing Contradiction Detection in MemPalace: A Complete Technical Guide](/MemPalace/mempalace/implementing-contradiction-detection-mempalace)

Implement contradiction detection in MemPalace. This guide details offline comparison against local data for confusion and mismatch identification, no external APIs needed.

- Tags: how-to-guide
- Published: 2026-06-07

### [Using the MemPalace Sweeper for Per-Message Verbatim Recall](/MemPalace/mempalace/using-mempalace-sweeper-per-message-verbatim-recall)

Master per-message verbatim recall with the MemPalace sweeper. Efficiently process Claude-Code JSONL transcripts for complete, resume-safe message storage.

- Tags: how-to-guide
- Published: 2026-06-07

### [Preventing Prompt Contamination with MemPalace query_sanitizer: A 4-Step Recovery Strategy](/MemPalace/mempalace/preventing-prompt-contamination-mempalace-query-sanitizer)

Learn how to prevent prompt contamination with MemPalace query_sanitizer. Recover retrieval accuracy from 1% to 90% using our four-step strategy.

- Tags: how-to-guide
- Published: 2026-06-07

### [Input Validation and Sanitization in MemPalace config.py: A Complete Guide](/MemPalace/mempalace/input-validation-sanitization-mempalace-config-py)

Learn input validation and sanitization in MemPalace config.py. Discover how strict functions protect data by stripping malformed Unicode, enforcing length limits, and validating dates.

- Tags: how-to-guide
- Published: 2026-06-07

### [How to Migrate MemPalace Between ChromaDB Versions Without Data Loss](/MemPalace/mempalace/migrating-mempalace-between-chromadb-versions)

Safely migrate MemPalace between ChromaDB versions. Our built-in tool rebuilds your palace extracting data from SQLite, ensuring no data loss. Learn more.

- Tags: migration-guide
- Published: 2026-06-07

### [How to Repair MemPalace Palace Inconsistencies with the repair Module](/MemPalace/mempalace/repairing-mempalace-inconsistencies-repair-module)

Easily repair MemPalace palace inconsistencies using the dedicated mempalace.repair module. Detect and fix HNSW index corruption with on-disk operations for enhanced safety and efficiency.

- Tags: how-to-guide
- Published: 2026-06-07

### [MemPalace Deduplication Strategies for Mined Content: A Technical Guide](/MemPalace/mempalace/mempalace-deduplication-strategies-mined-content)

Learn MemPalace deduplication strategies for mined content. Discover how MemPalace uses a greedy longest match algorithm to remove redundant text and preserve complete documents.

- Tags: tutorial
- Published: 2026-06-07

### [How to Export Palace Data Using the MemPalace Exporter Module](/MemPalace/mempalace/how-to-export-mempalace-data-exporter-module)

Learn how to export palace data with MemPalace exporter module. Convert ChromaDB storage to Markdown safely and efficiently with export_palace().

- Tags: how-to-guide
- Published: 2026-06-07

### [Ensuring Privacy with MemPalace's Local-First Architecture: A Technical Deep Dive](/MemPalace/mempalace/ensuring-privacy-mempalace-local-first-architecture)

Discover how MemPalace's local-first architecture ensures your data privacy by default. Learn the technical details of keeping information secure on your machine.

- Tags: deep-dive
- Published: 2026-06-07

### [Performance Tuning for MemPalace Hooks Under 500ms Latency](/MemPalace/mempalace/performance-tuning-mempalace-hooks-under-500ms-latency)

Achieve sub 500ms latency for MemPalace hooks. Tune performance by optimizing SAVE_INTERVAL, pinning MEMPAL_PYTHON, and selecting the all-MiniLM-L6-v2 embedder for a smoother experience.

- Tags: performance
- Published: 2026-06-07

### [Customizing Entity Detection for Domain-Specific Content in MemPalace](/MemPalace/mempalace/customizing-entity-detection-domain-specific-content-mempalace)

Customize MemPalace entity detection for your domain. Tailor people, project and topic extraction with our flexible two-pass pipeline supporting multilingual patterns and JSON filtering.

- Tags: how-to-guide
- Published: 2026-06-07

### [How to Integrate LLM Reranking into the MemPalace Search Pipeline: A Complete Guide](/MemPalace/mempalace/integrating-llm-reranking-mempalace-search-pipeline)

Learn to integrate LLM reranking into your MemPalace search pipeline. Enhance relevance scoring with a semantic layer for superior search results. Follow our complete guide.

- Tags: how-to-guide
- Published: 2026-06-07

### [Switching Embedding Models in MemPalace: Gemma-300m vs all-MiniLM-L6-v2](/MemPalace/mempalace/switching-embedding-models-mempalace-gemma-vs-minilm)

Easily switch embedding models in MemPalace between Gemma-300m and all-MiniLM-L6-v2 by setting an environment variable. Rebuild your vector index for improved performance.

- Tags: deep-dive
- Published: 2026-06-07

### [Understanding the Wing/Room/Drawer Palace Structure in MemPalace](/MemPalace/mempalace/understanding-mempalace-wing-room-drawer-structure)

Learn the Wing Room Drawer palace structure in MemPalace. Master semantic search and navigation with this intuitive hierarchy for your memory palace.

- Tags: internals
- Published: 2026-06-07

### [Configuring Claude Code Auto-Save Hooks for Session Persistence in MemPalace](/MemPalace/mempalace/configuring-claude-code-auto-save-hooks-session-persistence-mempalace)

Configure Claude Code auto-save hooks in MemPalace to prevent session expiration and data loss. Persist your palace state to disk with simple shell scripts.

- Tags: how-to-guide
- Published: 2026-06-07

### [Adding Custom MCP Tools to the MemPalace Server: A Complete Developer Guide](/MemPalace/mempalace/adding-custom-mcp-tools-mempalace-server)

Learn to add custom MCP tools to your MemPalace server. This guide details defining Python handlers, creating JSON Schemas, and registering your tools for seamless integration.

- Tags: how-to-guide
- Published: 2026-06-07

### [How to Use the Knowledge Graph with Temporal Validity Windows in MemPalace](/MemPalace/mempalace/how-to-use-mempalace-knowledge-graph-temporal-validity-windows)

Learn to use temporal validity windows in MemPalace's knowledge graph. Query facts valid at specific times using SQLite and the as of parameter. Master temporal data management.

- Tags: how-to-guide
- Published: 2026-06-07

### [Understanding the AAAK Compression Dialect for Index Scanning in MemPalace](/MemPalace/mempalace/understanding-mempalace-aaak-compression-dialect-index-scanning)

Learn how the AAAK compression dialect in MemPalace enables instant scanning of massive indices. Transform documents into human-readable summaries for efficient LLM access.

- Tags: deep-dive
- Published: 2026-06-07

### [How MemPalace Hybrid BM25 and Vector Search Ranking Works](/MemPalace/mempalace/mempalace-hybrid-bm25-vector-search-ranking-explained)

Discover how MemPalace hybrid ranking merges BM25 and vector search. Achieve balanced results with semantic awareness and keyword precision. Learn more about its configurable weights and normalization.

- Tags: deep-dive
- Published: 2026-06-07

### [How to Implement a Custom Storage Backend for MemPalace: A Complete Developer's Guide](/MemPalace/mempalace/how-to-implement-custom-storage-backend-mempalace)

Learn how to implement a custom storage backend for MemPalace. Follow this developer's guide to subclass base classes, implement CRUD methods, and expose your custom backend.

- Tags: how-to-guide
- Published: 2026-06-07

### [Understanding the Architectural Relationship Between Wings, Rooms, and Drawers in MemPalace](/MemPalace/mempalace/mempalace-wings-rooms-drawers-architecture)

Explore the MemPalace architecture: discover how Wings, Rooms, and Drawers form a hierarchical tree for organizing your memory palace data efficiently.

- Tags: architecture
- Published: 2026-06-06

### [How the MemPalace Entity Registry Maps Real Names to AAAK Codes](/MemPalace/mempalace/entity-registry-real-names-aaak-codes-mapping)

Discover how the MemPalace Entity Registry maps real names to AAAK codes. Learn about the onboarding process generating unique prefixes for the dialect encoder.

- Tags: internals
- Published: 2026-06-06

### [How QuerySanitizer Prevents Prompt Contamination in MemPalace](/MemPalace/mempalace/query-sanitizer-prevent-prompt-contamination)

QuerySanitizer prevents prompt contamination in MemPalace by deterministically removing system prompts before embedding. Discover how it ensures genuine user intent dominates vector representations.

- Tags: how-to-guide
- Published: 2026-06-06

### [How to Configure the Embedding Wrapper for Different Embedder Models in MemPalace](/MemPalace/mempalace/configure-embedding-wrapper-embedder-models)

Learn to configure the MemPalace embedding wrapper for diverse ONNX models like MiniLM and EmbeddingGemma using environment variables or a config file for efficient embedding generation.

- Tags: how-to-guide
- Published: 2026-06-06

### [How the MemPalace closet_llm Module Interfaces with Local LLM Runtimes](/MemPalace/mempalace/closet-llm-module-local-llm-interface)

Discover how the closet_llm module interfaces with local LLM runtimes like Ollama for seamless offline operation. Learn about automatic endpoint detection and unified provider interfaces.

- Tags: internals
- Published: 2026-06-06

### [How Claude Code Hooks Integrate with MemPalace: Complete Technical Guide](/MemPalace/mempalace/claude-code-hooks-integration-mempalace)

Discover how Claude Code hooks integrate with MemPalace using Bash scripts. Learn to auto-ingest conversation transcripts by parsing JSON payloads from Stop and PreCompact events. A complete technical guide.

- Tags: how-to-guide
- Published: 2026-06-06

### [How the MemPalace Repair Module Performs Palace Consistency Checks](/MemPalace/mempalace/repair-module-palace-consistency-checks)

Discover how the MemPalace repair module ensures data integrity with its three-stage consistency check pipeline, verifying data and safely rebuilding indexes.

- Tags: internals
- Published: 2026-06-06

### [How the MemPalace Migrate Module Handles ChromaDB Version Migration](/MemPalace/mempalace/migrate-module-chromadb-version-migration)

Learn how MemPalace's migrate module safely handles ChromaDB version migration. It detects schema versions, verifies compatibility, and performs atomic swaps with full backups.

- Tags: migration-guide
- Published: 2026-06-06

### [How the MemPalace dedup Module Identifies and Handles Duplicate Content](/MemPalace/mempalace/dedup-module-duplicate-content-handling)

Learn how the MemPalace dedup module efficiently identifies and handles duplicate content using cosine distance similarity. Preserves the most complete versions.

- Tags: deep-dive
- Published: 2026-06-06

### [How to Filter Semantic Search Results by Wing and Room in MemPalace](/MemPalace/mempalace/filter-semantic-search-wing-room-mempalace)

Learn to filter semantic search results in MemPalace by wing and room. Enhance your searches by passing optional parameters to search_memories() or the CLI to refine ChromaDB queries.

- Tags: how-to-guide
- Published: 2026-06-06

### [How MemPalace Performs Semantic Search with ChromaDB Vectors: A Hybrid Retrieval Pipeline](/MemPalace/mempalace/searcher-semantic-search-chromadb-vectors)

Discover how MemPalace achieves powerful semantic search using ChromaDB vectors. Explore its hybrid retrieval pipeline combining vector search and BM25 keyword scoring for superior results.

- Tags: deep-dive
- Published: 2026-06-06

### [How the palace_graph Module Detects Tunnels in MemPalace](/MemPalace/mempalace/palace-graph-tunnel-detection)

Learn how the palace_graph module detects tunnels in MemPalace using a three-stage pipeline of JSON loading, deduplication, and dynamic connection synthesis for efficient graph navigation.

- Tags: internals
- Published: 2026-06-06

### [How Room Traversal and BFS Navigation Work in MemPalace’s palace_graph Module](/MemPalace/mempalace/palace-graph-room-traversal-bfs-navigation)

Explore the MemPalace palace_graph module. Learn how it builds a graph from ChromaDB metadata and uses BFS for room traversal, finding connected rooms sorted by proximity and relevance.

- Tags: internals
- Published: 2026-06-06

### [Which Chat Formats Does the MemPalace Normalize Module Support?](/MemPalace/mempalace/normalize-module-supported-chat-formats)

Explore MemPalace normalize module's support for seven chat formats including Claude OpenAI Gemini Slack and plain text. Auto-detects formats for seamless integration.

- Tags: api-reference
- Published: 2026-06-06

### [How the MemPalace Normalize Module Converts Chat Exports to Standard Transcripts](/MemPalace/mempalace/normalize-module-chat-format-conversion)

Discover how the MemPalace normalize module converts diverse chat exports like ChatGPT, Slack, and Gemini into clean, standard transcripts. Learn about its multi-stage parsing pipeline.

- Tags: internals
- Published: 2026-06-06

### [How Entity Detection and Registry Handle Name Disambiguation in MemPalace](/MemPalace/mempalace/entity-detection-registry-name-disambiguation-mempalace)

Discover how MemPalace handles name disambiguation using entity detection and registry. Learn about flagging common words and regex context matching.

- Tags: architecture
- Published: 2026-06-06

### [How to Subclass BaseBackend and BaseCollection for Custom Storage in MemPalace](/MemPalace/mempalace/subclass-basebackend-basecollection-custom-storage-mempalace)

Learn to subclass BaseBackend and BaseCollection for custom storage in MemPalace. Implement CRUD operations and a factory, then register your custom storage solution.

- Tags: how-to-guide
- Published: 2026-06-06

### [How to Implement a Custom Storage Backend in MemPalace: A Complete Guide](/MemPalace/mempalace/implement-custom-storage-backend-mempalace)

Learn to implement a custom storage backend in MemPalace. This guide details subclassing BaseBackend, implementing CRUD, and exposing your backend via pyproject.toml entry points.

- Tags: how-to-guide
- Published: 2026-06-06

### [How MemPalace Handles Fact Invalidation in Its Temporal Knowledge Graph](/MemPalace/mempalace/mempalace-knowledge-graph-fact-invalidation)

Learn how MemPalace handles fact invalidation by closing temporal intervals and preserving historical data in its SQLite knowledge graph. Explore its temporal approach.

- Tags: internals
- Published: 2026-06-06

### [How MemPalace Handles Temporal Entity-Relationship Queries with Time Filtering](/MemPalace/mempalace/knowledge-graph-temporal-queries-time-filtering)

Discover how MemPalace handles temporal entity-relationship queries with time filtering using ISO-8601 intervals and normalized text comparisons in SQLite.

- Tags: how-to-guide
- Published: 2026-06-06

### [How the MemPalace 4-Layer Memory Stack (L0–L3) Works](/MemPalace/mempalace/mempalace-4-layer-memory-stack-explained)

Explore the MemPalace 4 layer memory stack L0 L3. Learn how L1 L2 L3 layers provide rich context efficiently, keeping prompts small and improving retrieval. Essential for AI development.

- Tags: internals
- Published: 2026-06-06

### [What Entity Codes Does the AAAK Compression Dialect Use? A Technical Guide to MemPalace Compression](/MemPalace/mempalace/aaak-compression-entity-codes)

Discover the entity codes used by the AAAK compression dialect. This guide details its hybrid system of explicit mappings, dictionary lookups, and three-letter abbreviations for efficient entity name compression.

- Tags: deep-dive
- Published: 2026-06-06

### [What Is the AAAK Compression Dialect in MemPalace?](/MemPalace/mempalace/what-is-aaak-compression-dialect-30x-lossless)

Understand the AAAK compression dialect in MemPalace. Discover how this summarization format efficiently encodes data for LLMs, offering a unique approach to data representation.

- Tags: internals
- Published: 2026-06-06

### [How the MemPalace MCP Server Implements I-9 Tools for Reading, Writing, and Maintaining the Palace](/MemPalace/mempalace/how-mcp-server-implements-19-tools-mempalace)

Discover how the MemPalace MCP server uses a JSON-RPC dispatcher and schema-enforced I-9 tools for efficient data reading, writing, and maintenance. Learn more about its robust implementation.

- Tags: internals
- Published: 2026-06-06

