MemPalace
🇹🇭 ภาษาไทย
Open-source, local-first AI memory system เก็บ conversation history แบบ verbatim และดึงกลับมาด้วย semantic search โครงสร้างแบบ hierarchical palace ช่วยให้ค้นหาแบบ scoped ได้แทนที่จะค้นทั้ง flat corpus
GitHub: github.com/MemPalace/mempalace
PyPI: pip install mempalace
Docs: mempalaceofficial.com
Scam Alert
โดเมนที่ถูกต้องมีแค่ GitHub, PyPI, และ mempalaceofficial.com เท่านั้น โดเมน
mempalace.techเป็น impostor
สถาปัตยกรรมหลัก
หลักการเก็บข้อมูล เก็บ conversation history แบบ verbatim — ไม่สรุป ไม่ paraphrase ไม่ตีความ ต่างจากระบบอย่าง LLM Wiki Pattern ที่ LLM จะสังเคราะห์เนื้อหาก่อนเก็บ
โครงสร้าง Palace
Wing (คน หรือ โปรเจกต์)
└── Room (หัวข้อ หรือ บริบท)
└── Drawer (เนื้อหาจริง)
การค้นหาสามารถ scope ลงมาในระดับ wing หรือ room ได้ ไม่ต้องค้นทั้งหมด
Backend ที่เปลี่ยนได้
- ค่าเริ่มต้น: ChromaDB
- Interface:
mempalace/backends/base.py - สามารถสลับ backend ได้โดยไม่กระทบส่วนอื่น
Knowledge Graph Temporal entity-relationship graph พร้อม validity windows เก็บใน SQLite แยกจาก vector store
ผลการทดสอบ Benchmark
| Benchmark | Metric | Score | หมายเหตุ |
|---|---|---|---|
| LongMemEval (raw) | R@5 | 96.6% | ไม่ใช้ LLM เลย |
| LongMemEval (hybrid v4, held-out) | R@5 | 98.4% | ทดสอบกับ 450q ที่ไม่เคยเห็น |
| LongMemEval (hybrid + LLM rerank) | R@5 | ≥99% | ใช้ LLM ใดก็ได้ |
| LoCoMo (hybrid v5) | R@10 | 88.9% | 1,986 questions |
| ConvoMem | Avg recall | 92.9% | 50 items/category |
| MemBench (ACL 2025) | R@5 | 80.3% | 8,500 items |
การใช้งาน
mempalace mine ~/projects/myapp # index project files
mempalace mine ~/chats/ --mode convos # index conversation exports
mempalace search "why did we switch to GraphQL"
mempalace wake-up # load context for new sessionMCP Server: 29 tools ครอบคลุม palace reads/writes, knowledge-graph, cross-wing navigation Claude Code Hooks: auto-save 2 hooks — ตามเวลาและก่อน context compression
Related
- RAG vs Wiki — MemPalace อยู่ฝั่ง verbatim retrieval ของ spectrum นี้
- LLM Wiki Pattern — แนวคิดที่ขัดแย้งกัน: สังเคราะห์ก่อน vs. เก็บดิบแล้วค้น
- Semantic Search — เทคนิคหลักใน retrieval layer
🇬🇧 English
Open-source, local-first AI memory system that stores conversation history verbatim and retrieves it via semantic search. The hierarchical “palace” structure enables scoped searches instead of scanning a flat corpus.
GitHub: github.com/MemPalace/mempalace | PyPI: pip install mempalace
The only legitimate domains are GitHub, PyPI, and mempalaceofficial.com.
mempalace.techis an impostor.
Core Architecture
Storage Philosophy Stores all conversation history verbatim — no summarization, no paraphrasing, no interpretation. This is the opposite of LLM Wiki Pattern, where the LLM synthesizes content before storing it.
Palace Structure
Wing (person or project)
└── Room (topic or context)
└── Drawer (actual content)
Searches can be scoped to a specific wing or room, avoiding full-corpus scans.
Pluggable Backend
- Default: ChromaDB
- Interface:
mempalace/backends/base.py - Swap backends without affecting other components
Knowledge Graph Temporal entity-relationship graph with validity windows (knows when information was true). Stored in SQLite, separate from the vector store.
Benchmark Performance
| Benchmark | Metric | Score | Notes |
|---|---|---|---|
| LongMemEval (raw) | R@5 | 96.6% | No LLM involved |
| LongMemEval (hybrid v4, held-out) | R@5 | 98.4% | Tested on 450 unseen questions |
| LongMemEval (hybrid + LLM rerank) | R@5 | ≥99% | Works with any LLM |
| LoCoMo (hybrid v5) | R@10 | 88.9% | 1,986 questions |
| ConvoMem | Avg recall | 92.9% | 50 items/category |
| MemBench (ACL 2025) | R@5 | 80.3% | 8,500 items |
No direct comparison with Mem0, Mastra, or Zep due to differing metrics. Read these numbers in the context of MemPalace's own methodology.
Integration
mempalace mine ~/projects/myapp # index project files
mempalace mine ~/chats/ --mode convos # index conversation exports
mempalace search "why did we switch to GraphQL"
mempalace wake-up # load context for new sessionMCP Server: 29 tools covering palace reads/writes, knowledge-graph operations, cross-wing navigation, drawer management, and agent diaries. Works with Claude Code and any MCP-compatible tool. Claude Code Hooks: Two auto-save hooks — time-based saves and pre-context-compression saves.
Requirements: Python 3.9+, ChromaDB, ~300 MB for embedding model, no API key needed.