Evaluate replacing Kùzu with LadybugDB (Kùzu is archived; Ladybug is the maintained fork)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- typescript
- Lĩnh vực
- database
Hướng nghiên cứu
Bắt đầu với package.json và src/store/kuzu_store.ts để hiểu ranh giới phụ thuộc và cách sử dụng hiện tại của Database, Connection, QueryResult và KuzuValue. Sau đó kiểm tra src/query/graph_query.ts và chạy quá trình tải cùng toàn bộ bộ truy vấn trên một repository mẫu, so sánh kết quả với Kùzu. Được xem là hoàn tất khi dependency ổn định của LadybugDB hoạt động trên các nền tảng được hỗ trợ, các graph và query được dựng lại tạo ra kết quả tương đương, và yêu cầu dựng lại storage đã được ghi lại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Kùzu — the embedded graph database codespine is built on — was archived in October 2025 after the company was acquired by Apple. The kuzu npm package has been frozen at 0.11.3 since 2025-10-10: no further bug fixes, security patches, or releases. We are sitting on an abandoned core dependency.
LadybugDB is the most prominent community fork of Kùzu, created by the post-archival fork wave. It is a direct fork of the same C++ codebase, keeps the same Cypher dialect and the same Node.js API, and is actively developed (stable 0.17.1 in June 2026, daily nightly builds). Because it shares Kùzu's lineage, migrating codespine to it is a near drop-in swap rather than a rewrite.
Recommendation: yes, we should plan this migration. It is low-urgency (the pinned kuzu build keeps working) but high-leverage (gets us off a dead dependency back onto a maintained one), and the cost is small thanks to the shared API. This issue is the evaluation; it does not change any code yet.
Background: what happened to Kùzu
- Kùzu Inc. was acquired by Apple; the upstream repo was archived in October 2025.
- Several community forks emerged afterward. Per Gábor Szárnyas' survey, the notable ones are:
- LadybugDB (LadybugDB / Arun Sharma) — "embedded graph database built for query speed and scalability"; security fixes + Arrow/DuckDB/Parquet integration.
- Ryu / Ryugraph (Predictable Labs) — embedded, vector + full-text search focus.
- Bighorn (Kineviz) — visualization integration, embedded + standalone server modes.
- Vela (Vela Partners) — AI-agent memory, concurrent multi-writer focus.
- LadybugDB is the most visible of the four (~1.4k GitHub stars, 77 contributors, 16 releases). It explicitly positions itself as the successor and tells Kùzu users to migrate.
Why LadybugDB specifically
kuzu (current) |
@ladybugdb/core |
|
|---|---|---|
| Status | Archived Oct 2025 | Active (stable 0.17.1, June 2026; daily nightlies) |
| npm last publish | 2025-10-10, frozen at 0.11.3 |
created 2026-03-01, ongoing |
| Lineage | original | fork of the same codebase |
| Cypher dialect | Kùzu | same (CREATE NODE/REL TABLE, var-length rels) |
| Node.js API | Database, Connection, QueryResult |
identical class/method surface |
| Install | npm i kuzu |
npm i @ladybugdb/core |
The other forks would also be Cypher-compatible, but LadybugDB has the most momentum and the clearest "drop-in for Kùzu users" stance, so it is the lowest-risk target.
How much of codespine touches the database
The graph database is the heart of codespine: it stores the TypeScript code knowledge graph (GraphNode + Edge + GraphMeta tables) and answers all the analysis queries (blast radius, who-calls, dead exports, clustering input, hotspots, webview export).
Roughly ~3,500 lines across ~15 files import or call kuzu, but almost all of it goes through one abstraction:
src/store/kuzu_store.ts— the centralKuzuStorewrapper (new Database(dbPath)/new Connection(db), schema DDL,prepare/execute,getAll/close).src/query/graph_query.ts— ~25 Cypher queries (the actual analysis logic).src/cluster/graph_clusterer.ts,src/enrich/runtime_enricher.ts,src/report/report_data.ts, and thesrc/commands/*CLI commands.
The import surface is uniform:
import { Connection, Database, QueryResult } from 'kuzu';
import type { KuzuValue } from 'kuzu';
That KuzuStore boundary is exactly what makes this cheap — there is essentially one seam to cut.
Compatibility check (verified against the LadybugDB type definitions)
The published @ladybugdb/core .d.ts exposes the same API codespine already uses:
class Database { constructor(...); close() }class Connection { constructor(database, numThreads?); query(); execute(); prepare(); close() }class PreparedStatementclass QueryResult { hasNext(); getNext(); each(); getAll(); all(); close() }- Value shapes
NodeValue(_label,_id),RelValue(_src,_dst,_label),RecursiveRelValue— identical to Kùzu's. The only rename is the value union type:KuzuValue→LbugValue.
The Cypher we rely on is the Kùzu dialect and carries over unchanged, including the non-standard bits:
CREATE NODE TABLE/CREATE REL TABLE (FROM … TO …)DDL.- Variable-length relationships with an inline edge predicate —
-[e:Edge*1..N (r, n | WHERE r.kind = 'CALLS')]-(the blast-radius query). - Prepared statements + parameter records.
What actually needs to change
- Dependency swap —
"kuzu": "^0.11.3"→"@ladybugdb/core": "^0.17"inpackage.json. - Import path in the ~15 files:
from 'kuzu'→from '@ladybugdb/core', and theKuzuValue→LbugValuetype rename. - Rebuild the on-disk database. LadybugDB's storage format (v0.17) is newer than Kùzu 0.11, so existing
graph.kuzufiles are not guaranteed to open. This is a non-issue for us: codespine regenerates the graph from JSONL viaload, so users just re-run extraction/load. Worth a note in docs/changelog. - Re-check
KUZU_MAX_REL_BOUND = 30ingraph_query.ts— Kùzu's parser rejectedN > 30on variable-length edges. LadybugDB may have lifted this; verify and relax the clamp if so. - Cosmetic (optional, separate PR): rename
kuzu_store.ts/KuzuStore/KUZU_*to neutral names (e.g.graph_store.ts/GraphStore) so we are not naming things after a dead project.
Effort
Because it is a same-API fork (not a port to a different database), this is roughly a day of work, not the ~2 weeks a true database swap (SQLite/Postgres) would take:
- Swap dependency + imports: ~1–2 hours (mechanical).
- Build native addon for our platforms / CI, smoke-test
load→query: ~½ day. - Run the existing query suite against a rebuilt graph and diff results vs. Kùzu: ~½ day.
Risks / open questions
- Fork is young.
@ladybugdb/coreonly appeared on npm in March 2026; it is a0.xproject with daily dev builds. Pin to a stable tag (0.17.1), not nightlies. - Ecosystem fragmentation. Four forks are competing for the Kùzu mantle (LadybugDB, Ryu, Bighorn, Vela). There is a small risk of backing the one that loses momentum. Mitigation: our
KuzuStoreseam keeps us portable — any Cypher-compatible fork is a similar swap later. - Native addon / platform coverage. Confirm prebuilt binaries exist for the platforms codespine ships to (macOS arm64 at minimum); otherwise we depend on
cmake-jsbuilding from source. - Storage-format migration affects anyone with a cached
graph.kuzu— needs a one-line "re-run load" note.
Proposed plan
- Spike on a branch: swap to
@ladybugdb/[email protected], runload+ the full query suite on a sample repo, diff against current Kùzu output. - If clean, land the dependency/import swap as one PR; keep the
KuzuStorename in that PR to minimize diff. - Follow-up PR: rename the kuzu-flavored identifiers and update docs (storage rebuild note,
KUZU_MAX_REL_BOUNDre-check).
Sources: LadybugDB repo · Kùzu forks survey (Szárnyas) · npm registry (kuzu frozen at 0.11.3 2025-10-10; @ladybugdb/core latest 0.17.1).
- Ngôn ngữ chính
- TypeScript
- Star
- 7
- Fork
- 0
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của jeromeetienne/codespine
-
enhancement vision
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
jeromeetienne/codespine#234 · 1 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
jeromeetienne/codespine#233 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
jeromeetienne/codespine#223 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
jeromeetienne/codespine#220 · 1 bình luận ·
-
pending projectsĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
jeromeetienne/codespine#213 · 1 bình luận ·
Tất cả issue của jeromeetienne/codespine
Issue tương tự
-
pending close triaging
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 74/100
anomalyco/opencode#63090 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-driven-qa bug claude Cosmetic
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-driven-qa bug claude Minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
linagora/twake-mail-admin#609 ·
Maintainer thường phản hồi trong vòng 1 ngày