Skip to main content

Crate terraphim_persistence

Crate terraphim_persistence 

Source
Expand description

Storage abstraction layer for Terraphim AI.

Provides a unified interface over multiple OpenDAL-backed storage operators (memory, DashMap, SQLite, S3). Operators are ordered by speed; slower backends write back to the fastest operator transparently via a fire-and-forget tokio::spawn so the load path is never blocked.

Objects larger than 1 MB are compressed with zstd before being stored. If a cached entry fails to deserialise (schema evolution), it is evicted and the value is re-fetched from the persistent backend.

§Key Types

  • DeviceStorage – singleton wrapping all configured operators
  • [ConversationPersistence] – trait for storing and loading conversations
  • Persistable – blanket trait implemented by every serialisable type

Re-exports§

pub use error::Error;
pub use error::Result;

Modules§

compression
Compression utilities for cache write-back
conversation
document
error
memory
Memory-only utilities for testing and development
settings
thesaurus

Structs§

DeviceStorage
Singleton wrapping all configured storage operators.

Traits§

Persistable
A trait for persisting objects

Functions§

load_documents_by_ids
Load multiple documents by their IDs