Export a compact artifact
Export a collection as an ultra-small read-only serve artifact (quantized slab + provenance) and open it on any device.
save() persists the full working collection — f32 base, external id map, lexical tokens. When the index itself is the deliverable (ship repo memory to a device, bundle it with a release, serve it read-only), export_compact() writes an ultra-small artifact instead: the quantized slab, the partition directory, and the provenance columns — and nothing else.
What the artifact keeps and drops
quantized vector slab (vectors.i8)
f32 base slab
partition directory + remap (rowids.i64, manifest.json)
external id map (ids come back as internal ints)
provenance columns (col_*.npy)
lexical tokens (no mode="lexical" on artifacts)
Consequences, all by design: artifacts are read-only (mutation raises), vector search only, and off-key filters are refused — partition-key (where on the scope_key) scoping works.
Export, then open anywhere
Build the source collection at dtype="int8"
Compact export quantizes at seal time — the source collection must be created with dtype="int8" so the int8 slab exists to keep.
col = telys.create_collection(
"repo_symbols",
dim=emb.profile.dimension,
partition_by="scope_key",
embedder=emb,
dtype="int8",
filter_columns=["path", "language", "symbol_type"],
)
col.upsert_texts(texts, ids, metadata)
col.compact()Open and search on any device
The artifact is self-contained — no engine directory, no id map, no rebuild:
cx = telys.open_compact("./dist/repo_symbols_artifact", embedder=emb)
res = cx.search_text("qualname_under_test", top_k=8, with_metadata=True)
# res["ids"] are internal ints; provenance comes from the columns:
top = res["metadata"][0] # {"path": ..., "language": ..., "symbol_type": ...}Next steps
Last updated
Was this helpful?