Context7
ส่งคู่มือการใช้ไลบรารีและเฟรมเวิร์กรุ่นล่าสุดให้ AI อ่านก่อนตอบ ช่วยให้โค้ดที่ AI เขียนไม่ใช้คำสั่งเก่าที่เลิกใช้แล้ว
คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)
A fully local MCP server for long-term memory with semantic search
สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน
ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry
เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง
ต้องเตรียมก่อน
คุณใช้แอปไหน
เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”
เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json
{
"mcpServers": {
"longterm-memory": {
"command": "npx",
"args": [
"-y",
"longterm-memory-mcp"
]
}
}
}พิมพ์คำสั่งนี้ใน Terminal
claude mcp add longterm-memory -- npx -y longterm-memory-mcpวางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json
{
"mcpServers": {
"longterm-memory": {
"command": "npx",
"args": [
"-y",
"longterm-memory-mcp"
]
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
วางในไฟล์ .vscode/mcp.json ของโปรเจกต์
{
"servers": {
"longterm-memory": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"longterm-memory-mcp"
]
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น
ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี
ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README
รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง
เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 6 พ.ย. 2569
ชื่อใน registry ยืนยันด้วยบัญชี GitHub MarcelRoozekrans ซึ่งเป็นเจ้าของ repo
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต
ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน
รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต
เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo
จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น
registry ไม่ได้ระบุว่าต้องใช้กุญแจ แต่บางตัวจะขอให้ล็อกอินตอนใช้ครั้งแรก
รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)
repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (1.6.1) เข้า registry 6 วันที่ผ่านมา
โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Node.js ในเครื่องด้วย
ในหมวดเดียวกันมี Context7, Codebase Memory, Exa
server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว
อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi
ส่งคู่มือการใช้ไลบรารีและเฟรมเวิร์กรุ่นล่าสุดให้ AI อ่านก่อนตอบ ช่วยให้โค้ดที่ AI เขียนไม่ใช้คำสั่งเก่าที่เลิกใช้แล้ว
Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.
Connect AI agents to Exa for web search, content fetching, and multi-step research.
ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ
A fully local MCP server that gives AI agents persistent, semantic long-term memory — without any cloud dependencies.
Inspired by mcp-mem0, but runs 100% on your machine:
| Feature | mcp-mem0 | This project |
|---|---|---|
| Storage | PostgreSQL / Supabase | SQLite (Node's built-in node:sqlite) |
| Embeddings | OpenAI API | Local transformer (all-MiniLM-L6-v2) |
| Vector search | Cloud vector DB | In-process cosine similarity |
| LLM dependency | OpenAI / OpenRouter / Ollama | None |
| Setup | Database + API keys | `npx longterm-memory-mcp` |
| Tool | Description |
|---|---|
save_memory | Store text with auto-generated semantic embedding, tags, importance, and type |
search_memory | Find relevant memories using natural language queries (cosine similarity) |
update_memory | Modify an existing memory's content, metadata, tags, importance, or type |
delete_memory | Remove a specific memory by ID |
delete_all_memories | Wipe all memories (irreversible) |
get_all_memories | List all stored memories (paginated) |
memory_stats | Get count and database location |
| Tool | Description |
|---|---|
search_by_type | Filter memories by category (general, fact, preference, conversation, task, ephemeral) |
search_by_tags | Find memories matching any of the provided tags |
search_by_date_range | Find memories created within a specific date range (ISO format) |
| Tool | Description |
|---|---|
create_backup | Manually trigger a database backup with JSON export |
Install via the Claude Code marketplace — this sets up both the MCP server and a companion skill that teaches Claude how to use memory effectively:
/plugin marketplace add MarcelRoozekrans/LongtermMemory-MCP
/plugin install longterm-memory@longterm-memory-marketplace
This automatically:
long-term-memory skill (Claude learns to recall context at session start, save insights after tasks, and deduplicate memories)npx longterm-memory-mcp
npx keeps running the version it cached first and does not look for updates. To move to a new release, name the version, as in npx -y longterm-memory-mcp@1.6.0, or use @latest, which checks the registry on every start.
npm install -g longterm-memory-mcp
longterm-memory-mcp
git clone https://github.com/MarcelRoozekrans/LongtermMemory-MCP.git
cd LongtermMemory-MCP npm install && npm run build npm start
If you installed via the plugin marketplace, the MCP server is already configured. For manual setup, add to your MCP settings (~/.claude/settings.json or project .claude/settings.json):
{
"mcpServers": { "longterm-memory": { "command": "npx", "args": ["-y", "longterm-memory-mcp"] } } }
Add to claude_desktop_config.json:
{
"mcpServers": { "longterm-memory": { "command": "npx", "args": ["-y", "longterm-memory-mcp"] } } }
The repo includes agent instructions that teach AI agents how to use memory effectively (automatic recall, save patterns, deduplication):
| File | Purpose |
|---|---|
skills/long-term-memory/SKILL.md | Self-contained skill — auto-loaded by Claude Code plugin, can be referenced from any MCP client |
By default, memories are stored in a shared, user-scoped location:
~/.longterm-memory-mcp/memories.db
This means every project and every MCP client shares the same memory pool — you save a memory in one project and it's available everywhere.
Several sessions can use the same database at once. Each server process reads and writes the shared file directly (SQLite in WAL mode), so a memory saved in one session is visible to every other session right away, and no session overwrites what another saved. Requires Node.js 22.13 or later.
Databases from older releases open unchanged. A database from v1.0–1.3, which has no schema_meta table, is migrated in place with all its memories kept; a copy named memories.db.pre-migration- .bak is written next to it first.
Upgrading from 1.4 or earlier: stop every running session that uses the old version before starting one with the new version. Older releases keep the whole database in memory and rewrite the file on each save, so an old process left running would overwrite what new sessions saved.
To isolate memories for a specific project, set the MEMORY_DB_PATH environment variable:
{
"mcpServers": { "longterm-memory": { "command": "npx", "args": ["-y", "longterm-memory-mcp"], "env": { "MEMORY_DB_PATH": "/path/to/project/memories.db" } } } }
Each memory has a memory_type that determines how it's categorized and how quickly it decays:
| Type | Description | Decay half-life |
|---|---|---|
general | Default catch-all | 60 days |
fact | Verified information | 120 days |
preference | User/project preferences | 90 days |
conversation | Conversation context | 45 days |
task | Task-related notes | 30 days |
ephemeral | Short-lived context | 10 days |
["auth", "backend"]). Search with search_by_tags.core, identity, or pinned skip decay entirely.Memories decay over time to keep the store relevant:
Memory content is hashed (SHA-256) on save. If identical content already exists, the save is rejected with a reference to the existing memory ID. This prevents duplicate entries automatically.
Memories end up in the database and in its JSON backups, so content is filtered before it is stored:
… is never stored, embedded or hashed. An unclosed removes everything after it. Content that is empty once the spans are removed is rejected.save_memory and update_memory refuse content, metadata values and tags that look like a secret. The error names the pattern that matched and never the value.| Pattern | Matches |
|---|---|
private-key | PEM / OpenSSH / PGP private key headers (certificates are allowed) |
github-token | ghp_, gho_, ghu_, ghs_, ghr_ and github_pat_ tokens |
api-key | sk-… style API keys |
aws-access-key | AKIA… / ASIA… access key ids |
jwt | JSON Web Tokens |
slack-token | xoxb-, xoxp- and similar Slack tokens |
secret-assignment | random-looking values after password=, token:, secret=, api_key=, KEY= and similar. References ($VAR, ${{ … }}), placeholders (<…>), calls and plain words are allowed |
Configure it with environment variables:
{
"mcpServers": { "longterm-memory": { "command": "npx", "args": ["longterm-memory-mcp"], "env": { "MEMORY_GUARD_DISABLE": "jwt,slack-token", "MEMORY_GUARD_EXTRA_PATTERNS": "{\"internal-host\": \"\\\\b[a-z0-9-]+\\\\.corp\\\\.example\\\\b\"}" } } } }
MEMORY_GUARD_DISABLE: a comma-separated list of pattern names to turn off, or all for every built-in pattern. spans are removed either way. An unknown name stops the server at startup.MEMORY_GUARD_EXTRA_PATTERNS: a JSON object of extra patterns to reject, as name → regular expression.The guard applies to new saves and updates only. Memories stored before it existed are not rescanned.
The Claude Code plugin ships a UserPromptSubmit hook that recalls memories without the agent having to ask. On the first prompt of each session it searches with the prompt text and adds the best matches to the context as a short list:
Long-term memories that may be relevant (longterm-memory; search_memory gives the full text):
recall-sessions/ next to the database. Later prompts in that session cost one node start, about 30 ms, and no search.npx longterm-memory-mcp@ recall --hook, so a cached older copy is never used. The plugin's MCP server is pinned the same way.Configure it with environment variables in your Claude Code settings (env in ~/.claude/settings.json). The hook runs in Claude Code's environment, not the MCP server's, so a custom MEMORY_DB_PATH has to be set there too.
| Variable | Default | Meaning |
|---|---|---|
MEMORY_RECALL_ENABLED | true | false turns the hook off |
MEMORY_RECALL_K | 5 | at most this many memories (1–50) |
MEMORY_RECALL_THRESHOLD | 0.5 | minimum cosine similarity (-1 to 1) |
MEMORY_RECALL_MAX_TOKENS | 400 | cap on the injected block, estimated at 4 characters per token |
MEMORY_RECALL_STATE_DIR | /recall-sessions | where the once-per-session markers live; markers older than 30 days are removed |
The hook calls the recall subcommand, which also works on its own:
npx longterm-memory-mcp recall "how do we deploy the stack"
npx longterm-memory-mcp recall --k 3 --threshold 0.4 --project docker "deploy"
It prints the same list the hook injects, or No relevant memories found. on stderr. Options: --k, --threshold, --max-tokens and --project (default: the current directory's name, "" for none). It does not create a database that does not exist yet. With --hook it reads a Claude Code UserPromptSubmit event from stdin and answers with additionalContext.
Backups are managed automatically and can also be triggered manually via the create_backup tool.
ตัดมาแค่ช่วงต้น อ่านต่อใน repo