Files
claude-mem/docs/i18n/README.id.md
T
Alex Newman 36b0929fae Server-beta: Postgres storage + independent runtime + BullMQ queue (Phases 1–3) (#2351)
* Add server beta runtime foundation

* Address server beta review findings

* Resolve server beta review comments

* Tighten server beta review follow-ups

* Harden server beta auth and search

* Avoid unnecessary FTS rebuilds

* Block scoped keys from creating projects

* Release BullMQ claims best effort on close

* Address server beta review blockers

* Reset BullMQ claims best effort

* Add Postgres observation storage foundation

* feat(server-beta): add independent runtime service

Introduce src/server/runtime/ as a self-contained server-beta runtime
that owns its lifecycle, Postgres bootstrap, and HTTP boundary without
depending on WorkerService.

ServerBetaService wraps the existing Server class, exposes
/healthz and /v1/info with runtime="server-beta", and persists state
to dedicated paths (.server-beta.pid|.port|.runtime.json). The four
boundary managers (queue, generation worker, provider registry, event
broadcaster) are intentionally disabled in this phase and report their
status through /v1/info; later phases activate them.

Adds plans/2026-05-07-finish-bullmq-branch-ship-plan.md to track the
remaining work for this branch.

Phase 2 of plans/2026-05-07-server-beta-independent-bullmq-observation-runtime.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(server-beta): route CLI lifecycle and bundle separate runtime

scripts/build-hooks.js now produces plugin/scripts/server-beta-service.cjs
as a separate Node CJS bundle, alongside the existing worker-service
bundle. The server-beta runtime is now installable independently.

src/npx-cli/commands/server.ts routes start|stop|restart|status to the
server-beta lifecycle instead of the legacy worker. The worker keeps its
own start|stop|restart|status under the worker namespace; the two
runtimes can be operated independently.

src/services/worker-service.ts adds a server-* command parser branch
that delegates to the sibling server-beta-service.cjs bundle so
direct worker-service invocations still route to the right runtime.

tests/npx-cli-server-namespace.test.ts updated to expect server-beta
lifecycle routing.

Includes rebuilt plugin/scripts/*.cjs bundles produced by
build-and-sync.

Phase 2 of plans/2026-05-07-server-beta-independent-bullmq-observation-runtime.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(server-beta): add BullMQ job queue primitives

Introduce src/server/jobs/ as the queue-side primitives that Phase 3 of
the server-beta runtime needs to operate.

types.ts defines a discriminated union over the four job kinds (event,
event-batch, summary, reindex) and maps each to a per-kind BullMQ queue
name and deterministic-ID prefix.

job-id.ts builds deterministic, colon-free BullMQ jobIds from
(kind, team, project, source). The colon ban exists because BullMQ uses
':' as a Redis key separator internally; embedding ':' in jobIds
breaks scan and state lookups.

ServerJobQueue.ts is a thin wrapper over BullMQ Queue + Worker that
enforces autorun:false, default concurrency 1, and an attached error
listener — all per BullMQ docs requirements. Test seams accept queue
and worker factories so unit tests do not need Redis.

outbox.ts publishes through the Postgres ObservationGenerationJob
repository as canonical history. enqueueOutbox writes the row first,
then publishes to BullMQ; if BullMQ throws, the row is transitioned to
failed and a failed event is appended. reconcileOnStartup re-enqueues
queued + processing rows after a restart, replacing terminal BullMQ
jobs that may still be holding the deterministic ID slot. markCompleted
and markFailed wrap transitionStatus and append the matching event row.

Includes 20 unit tests covering deterministic ID stability, colon-free
output, queue lifecycle, error-listener attachment, double-start
refusal, idempotent enqueue, BullMQ failure rollback, startup
reconciliation, max-attempts skipping, and completion / failure /
retry transitions.

Phase 3 commit 1 of plans/2026-05-07-server-beta-independent-bullmq-observation-runtime.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(server-beta): activate queue boundary in runtime service

Wire ActiveServerBetaQueueManager into the server-beta runtime graph.
The active manager owns one ServerJobQueue per generation kind (event,
event-batch, summary, reindex) and surfaces lane metadata through
boundary health.

Selection is opt-in and fail-fast: if CLAUDE_MEM_QUEUE_ENGINE is set to
bullmq the active manager is constructed (and any Redis/config error
throws — no silent fallback to SQLite, per Phase 3 anti-pattern guard).
For any other engine the disabled boundary remains so worker-era and
test setups stay compatible.

Widens ServerBetaBoundaryHealth.status to a discriminated union
('disabled' | 'active' | 'errored') with optional details. The disabled
adapter still emits status='disabled', which keeps the existing
server-beta-service test green.

ServerBetaService receives the manager through a new optional
queueManager field on CreateServerBetaServiceOptions so test graphs
and Phase 4 wiring can inject custom managers.

Adds tests/server/runtime/active-queue-manager.test.ts covering bullmq
guard, active health shape, per-kind queue access, close behavior, and
post-close errored health.

Phase 3 commit 2 of plans/2026-05-07-server-beta-independent-bullmq-observation-runtime.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(server-beta): cap /v1/events/batch at 500 events

Prevents unbounded array DoS surface flagged in PR review.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 01:20:07 -07:00

13 KiB

🌐 Ini adalah terjemahan otomatis. Koreksi dari komunitas sangat dipersilakan!



Claude-Mem

🇨🇳 中文🇹🇼 繁體中文🇯🇵 日本語🇧🇷 Português🇰🇷 한국어🇪🇸 Español🇩🇪 Deutsch🇫🇷 Français 🇮🇱 עברית🇸🇦 العربية🇷🇺 Русский🇵🇱 Polski🇨🇿 Čeština🇳🇱 Nederlands🇹🇷 Türkçe🇺🇦 Українська🇻🇳 Tiếng Việt🇮🇩 Indonesia🇹🇭 ไทย🇮🇳 हिन्दी🇧🇩 বাংলা🇵🇰 اردو🇷🇴 Română🇸🇪 Svenska🇮🇹 Italiano🇬🇷 Ελληνικά🇭🇺 Magyar🇫🇮 Suomi🇩🇰 Dansk🇳🇴 Norsk

Sistem kompresi memori persisten yang dibangun untuk Claude Code.

License Version Node Mentioned in Awesome Claude Code

thedotmack/claude-mem | Trendshift


Claude-Mem Preview

Mulai CepatCara KerjaAlat PencarianDokumentasiKonfigurasiPemecahan MasalahLisensi

Claude-Mem secara mulus mempertahankan konteks di seluruh sesi dengan secara otomatis menangkap observasi penggunaan alat, menghasilkan ringkasan semantik, dan membuatnya tersedia untuk sesi mendatang. Ini memungkinkan Claude untuk mempertahankan kontinuitas pengetahuan tentang proyek bahkan setelah sesi berakhir atau tersambung kembali.


Mulai Cepat

Mulai sesi Claude Code baru di terminal dan masukkan perintah berikut:

> /plugin marketplace add thedotmack/claude-mem

> /plugin install claude-mem

Restart Claude Code. Konteks dari sesi sebelumnya akan secara otomatis muncul di sesi baru.

Fitur Utama:

  • 🧠 Memori Persisten - Konteks bertahan di seluruh sesi
  • 📊 Progressive Disclosure - Pengambilan memori berlapis dengan visibilitas biaya token
  • 🔍 Pencarian Berbasis Skill - Query riwayat proyek Anda dengan mem-search skill
  • 🖥️ Web Viewer UI - Stream memori real-time di http://localhost:37777
  • 💻 Claude Desktop Skill - Cari memori dari percakapan Claude Desktop
  • 🔒 Kontrol Privasi - Gunakan tag <private> untuk mengecualikan konten sensitif dari penyimpanan
  • ⚙️ Konfigurasi Konteks - Kontrol yang detail atas konteks apa yang diinjeksikan
  • 🤖 Operasi Otomatis - Tidak memerlukan intervensi manual
  • 🔗 Kutipan - Referensi observasi masa lalu dengan ID (akses melalui http://localhost:37777/api/observation/{id} atau lihat semua di web viewer di http://localhost:37777)
  • 🧪 Beta Channel - Coba fitur eksperimental seperti Endless Mode melalui peralihan versi

Dokumentasi

📚 Lihat Dokumentasi Lengkap - Jelajahi di situs web resmi

Memulai

Praktik Terbaik

Arsitektur

Konfigurasi & Pengembangan


Cara Kerja

Komponen Inti:

  1. 5 Lifecycle Hooks - SessionStart, UserPromptSubmit, PostToolUse, Stop, SessionEnd (6 skrip hook)
  2. Smart Install - Pemeriksa dependensi yang di-cache (skrip pre-hook, bukan lifecycle hook)
  3. Worker Service - HTTP API di port 37777 dengan web viewer UI dan 10 endpoint pencarian, dikelola oleh Bun
  4. SQLite Database - Menyimpan sesi, observasi, ringkasan
  5. mem-search Skill - Query bahasa alami dengan progressive disclosure
  6. Chroma Vector Database - Pencarian hybrid semantik + keyword untuk pengambilan konteks yang cerdas

Lihat Ringkasan Arsitektur untuk detail.


mem-search Skill

Claude-Mem menyediakan pencarian cerdas melalui mem-search skill yang secara otomatis dipanggil saat Anda bertanya tentang pekerjaan masa lalu:

Cara Kerja:

  • Tanya saja secara alami: "Apa yang kita lakukan sesi terakhir?" atau "Apakah kita sudah memperbaiki bug ini sebelumnya?"
  • Claude secara otomatis memanggil mem-search skill untuk menemukan konteks yang relevan

Operasi Pencarian yang Tersedia:

  1. Search Observations - Pencarian teks lengkap di seluruh observasi
  2. Search Sessions - Pencarian teks lengkap di seluruh ringkasan sesi
  3. Search Prompts - Cari permintaan pengguna mentah
  4. By Concept - Temukan berdasarkan tag konsep (discovery, problem-solution, pattern, dll.)
  5. By File - Temukan observasi yang mereferensikan file tertentu
  6. By Type - Temukan berdasarkan tipe (decision, bugfix, feature, refactor, discovery, change)
  7. Recent Context - Dapatkan konteks sesi terbaru untuk sebuah proyek
  8. Timeline - Dapatkan timeline terpadu dari konteks di sekitar titik waktu tertentu
  9. Timeline by Query - Cari observasi dan dapatkan konteks timeline di sekitar kecocokan terbaik
  10. API Help - Dapatkan dokumentasi API pencarian

Contoh Query Bahasa Alami:

"What bugs did we fix last session?"
"How did we implement authentication?"
"What changes were made to worker-service.ts?"
"Show me recent work on this project"
"What was happening when we added the viewer UI?"

Lihat Panduan Alat Pencarian untuk contoh detail.


Fitur Beta

Claude-Mem menawarkan beta channel dengan fitur eksperimental seperti Endless Mode (arsitektur memori biomimetik untuk sesi yang diperpanjang). Beralih antara versi stabil dan beta dari web viewer UI di http://localhost:37777 → Settings.

Lihat Dokumentasi Fitur Beta untuk detail tentang Endless Mode dan cara mencobanya.


Persyaratan Sistem

  • Node.js: 18.0.0 atau lebih tinggi
  • Claude Code: Versi terbaru dengan dukungan plugin
  • Bun: JavaScript runtime dan process manager (otomatis diinstal jika tidak ada)
  • uv: Python package manager untuk pencarian vektor (otomatis diinstal jika tidak ada)
  • SQLite 3: Untuk penyimpanan persisten (terbundel)

Konfigurasi

Pengaturan dikelola di ~/.claude-mem/settings.json (otomatis dibuat dengan default saat pertama kali dijalankan). Konfigurasi model AI, port worker, direktori data, level log, dan pengaturan injeksi konteks.

Lihat Panduan Konfigurasi untuk semua pengaturan dan contoh yang tersedia.


Pengembangan

Lihat Panduan Pengembangan untuk instruksi build, testing, dan alur kerja kontribusi.


Pemecahan Masalah

Jika mengalami masalah, jelaskan masalah ke Claude dan troubleshoot skill akan secara otomatis mendiagnosis dan memberikan perbaikan.

Lihat Panduan Pemecahan Masalah untuk masalah umum dan solusi.


Laporan Bug

Buat laporan bug yang komprehensif dengan generator otomatis:

cd ~/.claude/plugins/marketplaces/thedotmack
npm run bug-report

Kontribusi

Kontribusi sangat dipersilakan! Silakan:

  1. Fork repositori
  2. Buat branch fitur
  3. Buat perubahan Anda dengan tes
  4. Perbarui dokumentasi
  5. Kirim Pull Request

Lihat Panduan Pengembangan untuk alur kerja kontribusi.


License

This project is licensed under the Apache License 2.0 (Apache-2.0).

Copyright (C) 2025 Alex Newman (@thedotmack). All rights reserved.

See the LICENSE file for full details.

Apache-2.0 allows broad use, modification, distribution, and commercial use, subject to its terms.

Ragtime note: The ragtime/ directory is licensed under the Apache License 2.0. See ragtime/LICENSE for details.


Dukungan


Built with Claude Agent SDK | Works with Claude Code | Made with TypeScript