Chroma 向量数据库

Chroma 向量数据库:Rust 内核(v1.0.0+ 重写,2025-03),多语言客户端SDK。单节点用 PersistentClient(SQLite + 本地 HNSW)或 EphemeralClient(内存);分布式 / 云用 SPANN + BLOCKFILE on S3/GCS。

✓ 0 人报告成功·v0.1.0·

晶体简介

Chroma 是 Rust 内核的开源向量数据库(github.com/chroma-core/chroma,v1.0.0+ 2025-03 重写)。单节点模式用 PersistentClient(SQLite 元数据 + 本地 HNSW 索引)或 EphemeralClient(内存);分布式 / 云模式用 SPANN 索引+ 自研 BLOCKFILE 存储 on S3/GCS。 数据路径:Client Factory → API 层(v1.0.0 起 Rust 默认)→ Segment 层(本地 2 段 / 分布式 3 段)→ Index(HNSW 或 SPANN)→ 持久化。EmbeddingFunction 协议注入向量生成,25+ provider 已内置(13 个 hosted EF + 5 类本地 runtime EF)。 本 skill 自带 52 条约束(含 3 条 fatal),覆盖典型踩坑:cosine 实现实际是 `1 - dot(a,b)` 假定向量已预归一化;v1.0.0 Rust 默认静默忽略 4 个旧 Python 设置(chroma_server_nofile / chroma_server_thread_pool_size 等);embedding 维度首次写入后锁死,换 EF 必须新建 collection 重新 add。

Blueprint Source

finance-bp-138

chroma-core/chroma598f85f1 source file

Constraints

3total
3fatal
3 must-not-violate

Evidence Quality

Confidence90%

High confidence — strong evidence base

3 条不可违反的约束

FATALdomain_rulechroma-C-005

WHENSwitching the EmbeddingFunction on an existing collection (e.g. ada-002 1536d → text-embedding-3-large 3072d).

ACTIONDo NOT expect in-place dimension changes — you must create_collection(new_name) with the new EF, iterate the old collection regenerating all vectors, and write to the new collection.

CONSEQUENCEDimensionality is latched at first write (local_hnsw.py:222-233 _ensure_index sets _dimensionality; mismatched dim then raises InvalidDimensionException). HNSW graph structure is dim-bound and not resizable. Forcing different-dim writes raises a hard exception and the entire batch rolls back.

FATALresource_boundarychroma-C-019

WHENDeploying Chroma outside Colab (production servers, Docker images, local dev).

ACTIONFirst confirm the host system has sqlite3.sqlite_version_info ≥ (3, 35, 0); if not, install pysqlite3-binary and swap it manually — outside Colab, chromadb does not auto hot-swap.

CONSEQUENCEchromadb/__init__.py:137-155 checks the SQLite version at import time; below 3.35.0 it raises RuntimeError on the non-Colab path, and the entire chromadb module fails to import.

FATALclaim_boundarychroma-C-024

WHENDeploying a Chroma v1.0.0+ server to production.

ACTIONDo NOT rely on Chroma's built-in auth provider — since v1.0.0 the server no longer ships built-in auth; you must front it with a reverse proxy (nginx/Traefik) or an external auth gateway.

CONSEQUENCEIf you configure chroma_server_auth_provider per old docs, v1.0.0+ images will not enable any auth and the service may be fully open, exposing it to unauthenticated access.

常见问题

讨论 (0)

暂无讨论,成为第一个发言的人吧!

更新历史

v0.1.02026-04-25·贡献者: tangweigang-jpg

v0.1.0: 首次发布到 Doramagic.ai。基于 chroma-core/chroma 的向量数据库,中英双语 + 52 条 anti-pattern 约束(3 条 fatal)+ 3 条 FAQ。

v0.1.02026-04-25·贡献者: tangweigang-jpg

v0.1.0: 首次发布到 Doramagic.ai。基于 chroma-core/chroma 的向量数据库,中英双语 + 52 条 anti-pattern 约束(3 条 fatal)+ 3 条 FAQ。