| Crates.io | anda_object_store |
| lib.rs | anda_object_store |
| version | 0.2.1 |
| created_at | 2025-05-02 12:40:38.345053+00 |
| updated_at | 2025-09-02 08:02:33.378889+00 |
| description | A Rust library that extends the functionality of the object_store crate with metadata management and encryption. |
| homepage | |
| repository | https://github.com/ldclabs/anda_db/tree/main/rs/anda_object_store |
| max_upload_size | |
| id | 1657628 |
| size | 123,889 |
Anda Object Store is a Rust library that extends the functionality of the object_store crate with additional features like metadata management and encryption. It's designed to work seamlessly with Anda DB, providing enhanced storage capabilities for AI applications.
MetaStore is a wrapper around an ObjectStore implementation that adds metadata capabilities:
LocalFileSystem)use anda_object_store::MetaStoreBuilder;
use object_store::local::LocalFileSystem;
// Create a MetaStore with a local filesystem backend
let storage = MetaStoreBuilder::new(
LocalFileSystem::new_with_prefix("my_store").unwrap(),
10000, // metadata cache capacity
)
.build();
EncryptedStore provides transparent AES-256-GCM encryption and decryption for stored objects:
use anda_object_store::EncryptedStoreBuilder;
use object_store::local::LocalFileSystem;
// Create a secret key (in production, use a secure random key)
let secret = [0u8; 32];
// Create an encrypted store with a local filesystem backend
let store = LocalFileSystem::new_with_prefix("my_store").unwrap();
let encrypted_store = EncryptedStoreBuilder::with_secret(store, 1000, secret)
.with_chunk_size(1024 * 1024) // Set chunk size to 1 MB
.with_conditional_put() // Enable conditional put operations
.build();
Anda Object Store is designed to work seamlessly with Anda DB, providing the storage layer for this specialized database for AI Agents:
use anda_db::{
database::{AndaDB, DBConfig},
storage::StorageConfig,
};
use anda_object_store::EncryptedStoreBuilder;
use object_store::local::LocalFileSystem;
// Create a secret key (in production, use a secure random key)
let secret = [0u8; 32];
// Create an encrypted store with a local filesystem backend
let object_store = LocalFileSystem::new_with_prefix("my_store").unwrap();
let object_store = EncryptedStoreBuilder::with_secret(object_store, 100000, secret)
.with_chunk_size(1024 * 1024) // Set chunk size to 1 MB
.with_conditional_put() // Enable conditional put operations
.build();
// Configure and connect to Anda DB
let db_config = DBConfig {
name: "anda_db_demo".to_string(),
description: "Anda DB demo".to_string(),
storage: StorageConfig {
compress_level: 0, // no compression
..Default::default()
},
};
// Connect to the database using the object store
let db = AndaDB::connect(Arc::new(object_store), db_config).await?;
Add this to your Cargo.toml:
[dependencies]
anda_object_store = "0.1"
Copyright © 2025 LDC Labs.
ldclabs/anda-db is licensed under the MIT License. See LICENSE for the full license text.