Expand description
a3s-vec is A3S’s native Rust in-process vector database.
The crate provides the collection, document, schema, query, index, and durability primitives needed by an embedded vector store. It follows the zvec Rust API vocabulary while keeping the implementation free of a C/C++ runtime dependency, which makes the same source usable on Apple Silicon, current Intel macOS (deployment target 15.0), Linux, and Windows. macOS 12 Monterey Intel is unsupported.
A collection’s document snapshot and WAL are authoritative. Flat queries
execute against that snapshot; revision-tagged HNSW, IVF, metric-aware
Vamana, and product-quantized DiskANN generations select bounded
candidates before exact re-ranking. Each Vamana/DiskANN base also has an A3S-native,
sector-aligned recovery sidecar. Native
numeric vector encodings are preserved at rest and remain distinct from index-only
FP16/INT8/INT4 scalar quantization. Revisioned scalar and full-text indexes
accelerate structured and lexical retrieval, including Unicode n-grams,
ordered token filters, boolean groups, required/prohibited clauses, and
wildcard/fuzzy/range terms, boosts, and ordered phrase proximity. HNSW and
IVF also provide multi-bit RaBitQ families with exact re-ranking. DiskANN
uses deterministic PQ training, ADC graph traversal, and a typed choice of
positioned reads or a validated immutable anonymous mmap snapshot. With the
async feature, query, multi-query, and group-by entry points run that same
work on Tokio’s blocking pool. Writable collections can also opt into one
explicitly owned standard-thread maintenance scheduler, while public health
snapshots distinguish authoritative revision failures from derived-index
degradation and normal WAL checkpoint lag. Native async file reads and
direct file-backed mmap remain explicit future optimizations.
The external algorithm kernel is an implementation detail and is not part of the stable A3S API:
use a3s_vec::core;Modules§
- prelude
- Convenient import for the common collection workflow.
Structs§
- AddColumn
Option - Alter
Column Option - Collection
- Cheap, cloneable, thread-safe handle to one collection.
- Collection
Health - Machine-readable collection readiness and checkpoint-lag snapshot.
- Collection
Maintenance Health - Point-in-time diagnostics for one maintenance schedule.
- Collection
Maintenance Options - Periodic schedule for one explicitly owned collection maintenance worker.
- Collection
Maintenance Runtime - Owner of the standard-thread worker that periodically rebuilds derived indexes and checkpoints authoritative state.
- Collection
Options - Supported options for creating or opening a collection.
- Collection
Resource Limits - Collection-local logical resource budgets.
- Collection
Schema - Collection schema containing scalar and vector fields.
- Collection
Schema Builder - Fluent collection schema builder.
- Collection
Stats - Public collection statistics (the fields used by the official SDK are kept first; additional counters are additive).
- Config
Builder - Supported process-wide durability and sidecar-I/O configuration.
- Disk
AnnIndex Param - DiskANN/Vamana build parameters.
- Diskann
Query Params - Doc
- A typed document.
BTreeMapgives deterministic snapshots and tie-breaks. - DocIterator
- DocWrite
Result - Per-document outcome in a batch write.
- Error
- An error returned by a3s-vec.
- Field
Schema - Schema for one field.
- Flat
Index Param - Exact flat index parameters.
- Flat
Query Params - Fts
- FtsIndex
Param - Full-text index parameters.
- FtsQuery
Params - Full-text query controls.
- Group
BySearch Query - Group-by vector query payload.
- Hnsw
Index Param - HNSW build parameters.
- Hnsw
Query Params - IVFIndex
Param - IVF build parameters.
- Index
Params - Serializable index configuration.
- Index
Params Builder - Fluent index-parameter builder for callers that prefer typed construction.
- Index
Stat - Invert
Index Param - Scalar inverted-index parameters.
- IvfQuery
Params - IvfRabitq
Index Param - IVF
RaBitQbuild parameters. - IvfRabitq
Query Params - Multi
Query - A collection of sub-queries fused into one ranked result.
- Search
Query - A single dense, sparse, binary, id-based, or FTS query.
- Search
Query Builder - Fluent builder matching the official SDK’s naming.
- Stats
Snapshot - SubQuery
- A branch in a
MultiQuery. - Vamana
Index Param - Vamana graph parameters.
DiskANNuses the same graph with a disk layout. - Vector
Schema - Explicit vector schema (also useful to adapters that keep vectors separate).
- Write
Result - Result of a batch write.
Enums§
- Collection
Health Status - Readiness assessment for one collection handle.
- Collection
Maintenance Phase - Lifecycle phase of an explicitly owned maintenance worker.
- Data
Type - Data type of a collection field.
- DocOperator
- DML operation kind used by write-ahead records and telemetry.
- Durability
- WAL acknowledgement policy.
- Embedding
Input - Input accepted by an embedding provider.
- Error
Code - Stable status categories exposed by the collection API.
- Field
Value - Scalar and array field values accepted by a collection.
- Index
Type - Index implementation selected for a field.
- IoBackend
- Query-time backend for validated derived index sidecars.
- Metric
Type - Similarity metric. Search scores are always ordered from high to low; L2 is represented as negative squared distance at the API boundary.
- Quantize
Type - Scalar/vector quantization mode.
- Rerank
Method - Reranking strategy used to fuse branch results.
- Vector
Value - Dense and sparse vector payloads.
Traits§
- Dense
Embedding - Dense embedding provider. Implementations should be pure with respect to the collection; retries and network policy belong in the adapter.
- Query
Executor - Optional convenience for executing a query after embedding text.
- Sparse
Embedding - Sparse embedding provider.
Functions§
- check_
version - default_
config - Returns a fresh builder with portable defaults.
- initialize
- Sets the process defaults captured by collections created or opened after this call. Existing collection handles retain their resolved configuration.
- is_
initialized - Returns whether the runtime has been initialized explicitly.
- shutdown
- Resets process defaults and marks the runtime uninitialized.
- version
- Version of the native Rust implementation.
- version_
major - version_
minor - version_
patch
Type Aliases§
- DiskANN
Index Param - IvfIndex
Param - Result
- Specialized result type for all public operations.
- Vector
Query - Compatibility alias used by the zvec vocabulary.