Expand description
Core embedded database primitives for building durable AI memory systems.
anda_db combines three retrieval modes behind a single collection model:
- B-Tree indexes for exact match and range filters
- BM25 indexes for full-text retrieval
- HNSW indexes for vector similarity search
The crate is designed for agent memory workloads where data must be:
- schema-validated on write
- incrementally searchable through multiple index types
- persisted to a generic
object_storebackend - recoverable after partial flushes or process restarts
Typical usage:
- Create or connect to an
database::AndaDB - Create or open a
collection::Collection - Define a schema via
schemaorAndaDBSchema - Add B-Tree, BM25, and/or HNSW indexes
- Insert documents and query them through
query
Feature flags:
full: enablesobject_store/fs, the local-filesystem backend used by the bundleddb_demoexample and by file-backed deployments.
Tantivy-backed tokenization (including Jieba) is not optional: this
crate always depends on anda_db_tfs with its full feature, because
[index::bm25] re-exports default_tokenizer/jieba_tokenizer
unconditionally and every collection::Collection installs
default_tokenizer() when it opens. The tantivy and tantivy-jieba
feature flags that used to be listed here gated nothing — they toggled a
second, unused copy of the dependency — and were removed; enabling them is
now a manifest error rather than a silent no-op.
See also the technical guide in docs/anda_db.md for architecture,
lifecycle, indexing, and operational guidance.
Modules§
- collection
- Collection-level document storage, indexing, and query execution.
- database
- Database-level lifecycle and collection management.
- error
- Error types returned by the core library. Error types for schema module
- index
- Index abstractions and concrete B-Tree, BM25, and HNSW integrations.
- query
- Query structures for hybrid search, filters, and reranking.
- schema
- Schema types re-exported from
anda_db_schema. - storage
- Object-store-backed persistence, compression, and cached I/O.
Functions§
- unix_ms
- Returns the current Unix timestamp in milliseconds.