Context7
ส่งคู่มือการใช้ไลบรารีและเฟรมเวิร์กรุ่นล่าสุดให้ AI อ่านก่อนตอบ ช่วยให้โค้ดที่ AI เขียนไม่ใช้คำสั่งเก่าที่เลิกใช้แล้ว
คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)
Context GC for LLM agents: offload large tool outputs and recall them to save tokens.
สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน
ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry
เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง
LETHE_DBต้องเตรียมก่อน
คุณใช้แอปไหน
เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”
เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json
{
"mcpServers": {
"lethe": {
"command": "uvx",
"args": [
"lethe-llm-context"
],
"env": {
"LETHE_DB": "ใส่ค่าของคุณ"
}
}
}
}พิมพ์คำสั่งนี้ใน Terminal
claude mcp add lethe --env LETHE_DB='ใส่ค่าของคุณ' -- uvx lethe-llm-contextเติมค่าที่เว้นว่างไว้ก่อนรัน
วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json
{
"mcpServers": {
"lethe": {
"command": "uvx",
"args": [
"lethe-llm-context"
],
"env": {
"LETHE_DB": "ใส่ค่าของคุณ"
}
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
วางในไฟล์ .vscode/mcp.json ของโปรเจกต์
{
"servers": {
"lethe": {
"type": "stdio",
"command": "uvx",
"args": [
"lethe-llm-context"
],
"env": {
"LETHE_DB": "ใส่ค่าของคุณ"
}
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น
ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี
LETHE_DB envค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README
รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง
เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 10 พ.ย. 2569
ชื่อใน registry ยืนยันด้วยบัญชี GitHub JesusGarcia9009 ซึ่งเป็นเจ้าของ repo
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต
ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน
รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต
เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo
จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น
registry ไม่ได้ระบุว่าต้องใช้กุญแจ แต่บางตัวจะขอให้ล็อกอินตอนใช้ครั้งแรก
รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)
repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.6.2) เข้า registry 5 เดือนที่ผ่านมา
โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Python (uv) ในเครื่องด้วย
ในหมวดเดียวกันมี Context7, Codebase Memory, Exa
server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว
อ่านการ์ด:↓ ดาวน์โหลดต่อสัปดาห์i★ ดาว 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 รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ
Live Ephemeral Token & History Engine — offload big tool outputs out of your LLM agent's context and recall them on demand, so long tasks cost fewer tokens.
🌍 This README is bilingual. English · Español
LETHE ships as an MCP server. Two lines and your agent can move big outputs out of its context and recall them on demand — fewer tokens on every long task. / LETHE viene como servidor MCP. Dos líneas y tu agente saca outputs grandes del contexto y los recupera cuando los necesita — menos tokens en cada tarea larga.
Claude Code:
pip install "lethe-llm-context[mcp]"
claude mcp add lethe -- lethe-mcp
Codex: add an MCP block to ~/.codex/config.toml — see integrations/codex/mcp-config.md.
Then drop in the guiding skill so the agent archives on its own: integrations/claude-code/SKILL.md.
Tools exposed: lethe_archive · lethe_recall · lethe_status. Full guide: integrations/claude-code/mcp-config.md.
python -m lethe.examples.mcp_demo
LETHE — offload big tool outputs, recall on demand, save tokens
The agent runs 4 commands. Each returns a wall of text:
→ build.log 857 tok in context —archive→ stub '[paged: build.log | handle=6d48a1c2]' → pytest.txt 479 tok in context —archive→ stub '[paged: pytest.txt | handle=1e56b0f4]' → db_dump.json 829 tok in context —archive→ stub '[paged: db_dump.json | handle=ec02...]' → trace.txt 414 tok in context —archive→ stub '[paged: trace.txt | handle=d888...]'
lethe_status: 4 blocks archived, 2579 tokens moved out of context
30 steps later the agent needs a buried fact. It recalls by keyword:
lethe_recall("launch_code") → found launch_code = 4242 (rehydrated losslessly from the archive)
Context window cost without LETHE : 2579 tok (everything stays resident) with LETHE : 38 tok (only tiny stubs remain) saved : 2541 tok (-99%)
This runs the same logic the MCP tools use — lethe_archive / lethe_recall / lethe_status.
When an LLM agent runs a long task (tens to hundreds of steps), its context window fills with material that *was* useful but no longer is: stale tool outputs, files read 30 steps ago, big JSON dumps. That means more tokens per turn, higher cost, and eventually the context ceiling.
LETHE gives the agent an external, lossless scratch store so that heavy content lives *outside* the context window and only a tiny handle stays inside. Two ways to use it:
1. As an MCP server (the install path above). The agent calls lethe_archive(content) on a big output and keeps only the returned 4–8-char handle; later it calls lethe_recall(handle) or lethe_recall("keywords") to bring the full text back. Nothing is ever deleted — recall is lossless. The guiding skill tells the agent *when* to do this, so it happens near-automatically. This is provider-agnostic: it works in any MCP host (Claude Code, Codex).
2. As a Python library (in-loop context GC). ContextManager runs an automatic pass inside your agent loop: a heuristic Curator scores each block (recency, whether later blocks cite it, block kind, plus an optional cheap-model relevance call) and an Archivist pages the coldest blocks out to a store — losslessly, leaving stubs — to hold the working set under a token budget. Referenced handles are paged back in on demand.
Be clear about the mechanism. An MCP server *cannot* silently rewrite the host's context
window. LETHE works by giving the agent explicit offload/recall tools plus a skill that makes
using them near-automatic — not by magic. That honesty is the point.
The multi-provider, ensemble, and semantic-retrieval design below is the long-term vision, not what's implemented. Here is the honest split:
| Capability | Status |
|---|---|
MCP server: archive / recall / status, lossless | ✅ works, shipped |
| Guiding skill for near-automatic offload | ✅ works, shipped |
| Python library: heuristic Curator + budget eviction + lossless paging | ✅ works, tested |
| Needle-in-haystack proof (working set held under budget, fact recovered) | ✅ 1721→199 tok, ~88% ↓ |
| Optional cheap-model relevance scoring in the Curator | ✅ works (Claude / any adapter) |
| Recall search | 🟡 lexical/keyword (SQLite FTS5), not semantic yet |
| Compactor (summarize cold runs into dense notes) | 🟡 in the codebase, not yet wired into the auto loop |
| Providers | 🟡 Claude + a test adapter today; GPT/Gemini/Llama designed, not built |
| Ensemble curation (multi-model voting) | 🗺️ vision, not started |
| Embedding / semantic retrieval | 🗺️ vision, not started |
One-line wrap() drop-in | 🗺️ vision, not started |
| Full eval harness (LoCoMo, ablations, latency) | 🗺️ only the needle eval exists |
Each milestone ships as a tagged release — full notes in CHANGELOG.md.
LETHE is designed like an operating system managing virtual memory. This analogy guides the architecture; the ✅/🟡 above says how much of it runs automatically today.
| Operating system | LETHE |
|---|---|
| Physical RAM | The context window (working set) |
| Disk | External store (SQLite / in-memory) |
| Page-table entry | Stub / handle left in context |
| Page-in on fault | Rehydrating an evicted block |
| Eviction policy | Curator (relevance scoring) — ✅ heuristic today |
| Cold-page compression | Compactor (consolidation notes) — 🟡 not yet wired |
| Wired / non-swappable memory | Pinned blocks |
Mem0, Zep, Letta and friends persist facts *across sessions*. LETHE targets the opposite: managing the live, in-session working context of a running loop — deciding what to keep in the window right now. It's complementary to a long-term memory product, not a competitor. Whether that difference is decisive is something the roadmap above still has to prove.
python -m pytest -q # run the full test suite, including the needle test
python -m lethe.examples.fake_loop # WATCH it work: live view, blocks paging out, budget held
$env:ANTHROPIC_API_KEY="sk-..." # PowerShell
python -m lethe.examples.claude_loop
docs/specs/2026-06-12-lethe-vertical-slice-design.md — approved design of the built slicedocs/LETHE_engineering_design.md — the full long-term engineering vision (multi-provider, ensemble, embeddings). Read it as the roadmap, not the current state.Released into the public domain under the Unlicense. Free for everyone, anywhere.
Cuando un agente LLM ejecuta una tarea larga (decenas o cientos de pasos), su ventana de contexto se llena de material que *fue* útil pero ya no lo es: resultados de herramientas obsoletos, archivos leídos hace 30 pasos, dumps de JSON enormes. Eso significa más tokens por turno, más costo y, al final, el techo de contexto.
LETHE le da al agente un almacén externo y sin pérdida para que el contenido pesado viva *fuera* de la ventana de contexto y dentro solo quede un handle diminuto. Dos formas de usarlo:
1. Como servidor MCP (la instalación de arriba). El agente llama lethe_archive(content) sobre un output grande y conserva solo el handle de 4–8 caracteres; después llama lethe_recall(handle) o lethe_recall("palabras") para traer el texto completo. Nada se borra nunca — el recall es sin pérdida. El skill guía le dice al agente *cuándo* hacerlo, así que ocurre casi-automáticamente. Es agnóstico al proveedor: funciona en cualquier host MCP (Claude Code, Codex).
2. Como librería Python (GC de contexto dentro del loop). ContextManager corre una pasada automática dentro de tu loop: un Curator heurístico puntúa cada bloque (recencia, si bloques posteriores lo citan, tipo de bloque, más una llamada opcional a un modelo barato) y un Archivist pagina los bloques más fríos a un almacén — sin pérdida, dejando stubs — para mantener el working set bajo un presupuesto de tokens. Los handles referenciados se repaginan bajo demanda.
Seamos claros con el mecanismo. Un servidor MCP *no puede* reescribir en silencio la
ventana de contexto del host. LETHE funciona dándole al agente tools explícitas de
offload/recall más un skill que hace que usarlas sea casi automático — no por magia. Esa
honestidad es el punto.
El diseño multi-proveedor, ensamble y retrieval semántico de abajo es la visión a largo plazo, no lo implementado. La división honesta:
| Capacidad | Estado |
|---|---|
Servidor MCP: archive / recall / status, sin pérdida | ✅ funciona, publicado |
| Skill guía para offload casi-automático | ✅ funciona, publicado |
| Librería: Curator heurístico + expulsión por presupuesto + paginación sin pérdida | ✅ funciona, con tests |
| Prueba aguja-en-pajar (working set bajo presupuesto, dato recuperado) | ✅ 1721→199 tok, ~88% ↓ |
| Scoring opcional con modelo barato en el Curator | ✅ funciona (Claude / cualquier adapter) |
| Búsqueda de recall | 🟡 léxica/keyword (SQLite FTS5), aún no semántica |
| Compactor (resumir runs frías en notas densas) | 🟡 está en el código, aún no conectado al loop |
| Proveedores | 🟡 Claude + un adapter de prueba hoy; GPT/Gemini/Llama diseñados, no construidos |
| Curación por ensamble (voto multi-modelo) | 🗺️ visión, sin empezar |
| Retrieval por embeddings / semántico | 🗺️ visión, sin empezar |
Drop-in wrap() de una línea | 🗺️ visión, sin empezar |
| Harness de eval completo (LoCoMo, ablations, latencia) | 🗺️ solo existe el needle eval |
Cada milestone se publica como release etiquetada — notas completas en CHANGELOG.md.
LETHE se diseña como un sistema operativo que gestiona memoria virtual. La analogía guía la arquitectura; el ✅/🟡 de arriba dice cuánto de eso corre automáticamente hoy.
| Sistema operativo | LETHE |
|---|---|
| Memoria RAM | La ventana de contexto (working set) |
| Disco | Almacén externo (SQLite / en memoria) |
| Entrada de tabla de páginas | Stub / handle que queda en contexto |
| Traer página al fallar | Rehidratar un bloque expulsado |
| Política de expulsión | Curator (puntúa relevancia) — ✅ heurístico hoy |
| Compresión de páginas frías | Compactor (notas de consolidación) — 🟡 aún no conectado |
| Memoria fija / no intercambiable | Bloques fijados (pinned) |
Mem0, Zep, Letta y compañía persisten hechos *entre sesiones*. LETHE apunta a lo contrario: gestionar el **contexto viv
ตัดมาแค่ช่วงต้น อ่านต่อใน repo