Context7
ส่งคู่มือการใช้ไลบรารีและเฟรมเวิร์กรุ่นล่าสุดให้ AI อ่านก่อนตอบ ช่วยให้โค้ดที่ AI เขียนไม่ใช้คำสั่งเก่าที่เลิกใช้แล้ว
คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)
AI that remembers. Local-first cross-session, cross-project long-term memory for coding tools.
สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน
ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry
เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง
OPENAI_API_KEY, NAN_FORGET_EMBEDDING_PROVIDER, NAN_FORGET_USER_ID, NAN_FORGET_PROJECT_ROOTค่าที่ติดป้ายความลับคือกุญแจของบัญชีคุณ อย่าส่งให้ใคร และอย่าวางในแชต
ต้องเตรียมก่อน
คุณใช้แอปไหน
เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”
เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json
{
"mcpServers": {
"nan-forget": {
"command": "npx",
"args": [
"-y",
"nan-forget"
],
"env": {
"OPENAI_API_KEY": "ใส่ค่าของคุณ",
"NAN_FORGET_EMBEDDING_PROVIDER": "ใส่ค่าของคุณ",
"NAN_FORGET_USER_ID": "ใส่ค่าของคุณ",
"NAN_FORGET_PROJECT_ROOT": "ใส่ค่าของคุณ"
}
}
}
}พิมพ์คำสั่งนี้ใน Terminal
claude mcp add nan-forget --env OPENAI_API_KEY='ใส่ค่าของคุณ' --env NAN_FORGET_EMBEDDING_PROVIDER='ใส่ค่าของคุณ' --env NAN_FORGET_USER_ID='ใส่ค่าของคุณ' --env NAN_FORGET_PROJECT_ROOT='ใส่ค่าของคุณ' -- npx -y nan-forgetเติมค่าที่เว้นว่างไว้ก่อนรัน
วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json
{
"mcpServers": {
"nan-forget": {
"command": "npx",
"args": [
"-y",
"nan-forget"
],
"env": {
"OPENAI_API_KEY": "ใส่ค่าของคุณ",
"NAN_FORGET_EMBEDDING_PROVIDER": "ใส่ค่าของคุณ",
"NAN_FORGET_USER_ID": "ใส่ค่าของคุณ",
"NAN_FORGET_PROJECT_ROOT": "ใส่ค่าของคุณ"
}
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
วางในไฟล์ .vscode/mcp.json ของโปรเจกต์
{
"servers": {
"nan-forget": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"nan-forget"
],
"env": {
"OPENAI_API_KEY": "ใส่ค่าของคุณ",
"NAN_FORGET_EMBEDDING_PROVIDER": "ใส่ค่าของคุณ",
"NAN_FORGET_USER_ID": "ใส่ค่าของคุณ",
"NAN_FORGET_PROJECT_ROOT": "ใส่ค่าของคุณ"
}
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น
ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี
NAN_FORGET_EMBEDDING_PROVIDER envNAN_FORGET_USER_ID envNAN_FORGET_PROJECT_ROOT envค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README
รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง
เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 7 พ.ย. 2569
ชื่อใน registry ยืนยันด้วยบัญชี GitHub NaNMesh ซึ่งเป็นเจ้าของ repo
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต
ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน
รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต
เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo
จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น
ต้องใส่ค่าเหล่านี้: OPENAI_API_KEY
รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)
repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.6.8) เข้า registry 7 เดือนที่ผ่านมา
โปรแกรมที่รองรับ 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 รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ
Long-term memory for AI coding tools.
Your AI forgets everything when the session ends. NaN Forget fixes that.
npx nan-forget setup
That's it. The wizard installs Ollama, embeddings, Claude hooks, MCP config, and a project AGENTS.md for Codex-style agents. Restart Claude Code or reopen Codex. Your AI now remembers.
No API keys needed. No Docker needed. Runs locally. Free forever.
flowchart LR
A["You talk to your AI tool"] --> B["It learns things"] B --> C["nan-forget saves to SQLite"] C --> D["Session ends"] D --> E["New session starts"] E --> F["nan-forget loads context"] F --> G["Your AI remembers"]
~/.nan-forget/memories.db. Aging memories get automatically compacted into long-term entries.You never call save or search manually. Here's what happens behind the scenes:
| Event | What fires | What happens |
|---|---|---|
| Session starts | memory_sync | Lightweight handshake — checks health, loads stats, lists projects. No heavy search. |
| You send a message | UserPromptSubmit hook | nan-forget recall auto-searches memory for relevant context and injects it into the conversation. |
| You discuss a topic | memory_search | Claude searches the DB dynamically whenever relevant context might exist — like how you recall things on-demand. |
| Claude learns something | memory_save | Claude saves decisions, preferences, and facts immediately. Tool descriptions tell Claude "you MUST call this." |
Claude writes a .md file | PostToolUse hook | memory-sync.js intercepts the write, parses frontmatter, and auto-saves it to SQLite via nan-forget add. |
| Session ends | SessionEnd hook | session-end.js scans the conversation transcript for unsaved decisions/facts and saves the top 5 to the DB. |
| Every 10 saves or 24h | Auto-consolidate | Aging memories get clustered and compacted into long-term entries. Originals are archived. |
Four layers of protection ensure nothing is lost:
Codex and similar agents work well with nan-forget, but they usually need instruction files or shell/API fallbacks instead of Claude's hook model:
npx nan-forget setupsync, search, save, and checkpoint automatically.localhost:3456 or local commands like nan-forget sync, nan-forget search, nan-forget add, and nan-forget checkpoint.The REST API and CLI now mirror the important memory workflows closely enough that memories saved by Claude are searchable from Codex and vice versa.
# Start the REST API
nan-forget api
nan-forget prompt
Type these in Claude Code:
| Command | What it does |
|---|---|
/nan-forget | Load context from past sessions |
/nan-forget stats | Show memory health |
/nan-forget clean | Run garbage collection |
/nan-forget compact | Force memory consolidation |
/nan-forget health | Check if services are running |
/nan-forget start | Start all services |
Claude uses MCP. Codex can use AGENTS.md plus CLI/REST fallback:
# Start the API
nan-forget api
nan-forget prompt
Codex, Cursor, and Claude all share the same memory database.
curl http://localhost:3456/memories/search?q=auth
curl -X POST http://localhost:3456/memories/sync -d '{"project":"my-app"}' curl -X POST http://localhost:3456/memories/checkpoint \ -H 'content-type: application/json' \ -d '{"task_summary":"Fixed auth regression","problem":"Expired tokens were not refreshed","solution":"Added refresh handling in middleware","files":["src/auth.ts"],"concepts":["auth","jwt"],"project":"my-app"}'
nan-forget add "We use FastAPI, not Django. Railway deploys faster."
nan-forget add --type decision "Auth is Clerk, not custom JWT" nan-forget search "what auth system" nan-forget stats
Everything below is for developers who want to understand how nan-forget works under the hood.
LLMs have no memory between sessions. Every conversation starts from zero. You re-explain your stack, Claude contradicts decisions from last month, and context disappears when the session ends.
Existing solutions (Mem0) target app developers embedding memory into products. We target you — the developer using AI tools daily who wants AI that just remembers.
flowchart TB
subgraph Short["Short-Term Memory"] MD[".md files Current session context Disposable scratch paper"] end subgraph Long["Long-Term Memory"] DB["SQLite + sqlite-vec ~/.nan-forget/memories.db Semantic search + decay"] end subgraph Auto["Automatic Processes"] Hook["Hooks (3) PostToolUse: .md → DB UserPromptSubmit: auto-recall SessionEnd: transcript sweep"] Consolidate["Consolidation Engine Clusters + summarizes aging memories"] GC["Garbage Collection Decay, dedup, expiry"] end MD -->|"hook intercepts"| Hook Hook -->|"nan-forget add"| DB DB --> Consolidate Consolidate --> DB DB --> GC
Short-term memory = Claude's built-in .md files. Disposable. Current session only.
Long-term memory = SQLite database with sqlite-vec vector search. Single file. Permanent. Searchable across all sessions, all projects, all LLM tools.
Three hooks handle memory automatically:
.md file writes and saves them to the DB.nan-forget recall on every user message, auto-searching memory for relevant context.Memory search follows the same path as human recall:
flowchart LR
Q["Query"] --> S1["Stage 1: Recognition Fast vector match Returns summaries only"] S1 --> S2["Stage 2: Recall Full content fetch Cross-project expansion"] S2 --> S3["Stage 3: Association Spreading activation Related memories surface"] S3 --> R["Results ranked by similarity x decay x frequency x confidence"]
| Stage | What happens | Cost |
|---|---|---|
| Recognition (blur) | Prefetch 50 candidates, return top 5 summaries. Cheap. | 1 vector search |
| Recall (clarity) | Fetch full content. Expand search cross-project (no project filter). | N point lookups |
| Association | Centroid-based related-memory search over sqlite-vec. Spreading activation from positive IDs. | 1 vector search |
Scoring formula:
final_score = vector_similarity * decay_weight * frequency_boost * confidence_boost
decay_weight = (0.5 ^ (days / 30)) ^ (1 - confidence) frequency_boost = log2(access_count + 1) / 10 + 1 confidence_boost = 0.5 + 0.5 * confidence
High-confidence memories (debate-validated, human-approved) decay much slower and rank higher. A core memory at 0.85 confidence decays at ~15% of normal rate — effectively permanent unless superseded. Cross-project search means auth decisions from Project A surface when you work on Project B.
Aging memories don't just get deleted — they get compacted into long-term entries:
flowchart TB
A["10+ aging memories about the same topic"] --> B["Cluster by project + type
available?"} C -->|"Yes"| D["LLM summarizes cluster into 1-2 sentences"] C -->|"No"| E["Deterministic merge concatenate + deduplicate"] D --> F["Save consolidated entry with fresh vector embedding"] E --> F F --> G["Archive originals with backlink"]
Triggers automatically after every 10 saves or 24 hours. No user action needed.
| Tool | Purpose |
|---|---|
memory_sync | Lightweight session handshake: health check + stats + project list |
memory_save | Save a memory (auto-called by Claude, proactively) |
memory_search | Semantic search with 3-stage retrieval (depth 1-3) |
memory_get | Fetch a specific memory by ID |
memory_update | Change content, type, or tags |
memory_archive | Soft-delete (hidden from search, never truly deleted) |
memory_consolidate | Force consolidation of aging memories |
memory_clean | Garbage collection (decay, dedup, expiry, MEMORY.md sync) |
memory_stats | Memory health dashboard |
memory_health | Check if Ollama, REST API are running |
memory_start | Boot Ollama + REST API |
memory_checkpoint | Save full problem→solution context after completing a task |
memory_compress | Compress persisted .md memory files to minimal stubs |
memory_save accepts structured fields for richer vector representation:
| Field | Type | Purpose |
|---|---|---|
content | string | Full description (required) |
type | string | fact, decision, preference, task, context |
project | string | Project name |
problem | string | What was the challenge |
solution | string | How it was solved |
concepts | string[] | Searchable tags (["auth", "jwt", "middleware"]) |
files | string[] | Files involved (["src/auth.ts"]) |
confidence | number | Trust level 0.0–1.0 (default based on provenance) |
provenance | string | save, checkpoint, debate, human |
tier | string | regular or core (auto-derived from provenance) |
All fields are embedded together into a single vector. Searches for "JWT auth bug" find memories tagged with those concepts even if the content text doesn't match literally.
Not all memories are equal. Debate-validated and human-approved memories are core — they decay slower, rank higher in search, and survive garbage collection longer.
| Provenance | Default Confidence | Auto Tier | Decay Rate |
|---|---|---|---|
save | 0.5 | regular | Normal (30-day half-life) |
checkpoint | 0.65 | regular | ~35% slower |
debate | 0.85 | core | ~85% slower |
human | 0.95 | core | ~95% slower |
Core memories are designed for the upcoming nan-debate system — multi-AI debate results validated by human approval get persisted as high-trust knowledge that almost never fades.
After completing a task, call memory_checkpoint with task_summary, problem, solution, files, concepts, and project. Saves the full problem→solution context to long-term memory. Every completed task = one checkpoint.
memory_compress scans .claude/projects/*/memory/ for .md files already persisted to the DB. Persisted files are replaced with minimal stubs. Reduces context window bloat.
Shares the same SQLite database as the MCP server — memories saved by Claude are searchab
ตัดมาแค่ช่วงต้น อ่านต่อใน repo