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: enables full-text search integrations exposed by the workspace setuptantivy: enables the Tantivy-backed text search dependencytantivy-jieba: enables Tantivy plus Jieba tokenization support
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.