blazen-memory 0.1.131

Memory and vector store for Blazen with ELID integration
docs.rs failed to build blazen-memory-0.1.131
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: blazen-memory-0.1.121

blazen-memory

Memory and vector store for Blazen with ELID integration.

This crate provides a memory store that can operate in two modes:

  • Full mode: Uses an EmbeddingModel to generate embeddings, encodes them with ELID into compact sortable identifiers, and uses LSH (Locality-Sensitive Hashing) bands for efficient approximate nearest-neighbor retrieval.

  • Local mode: Uses string-level SimHash for lightweight similarity search without requiring an embedding model.

Quick start

use blazen_memory::{Memory, MemoryStore, MemoryEntry, InMemoryBackend};
use std::sync::Arc;

# async fn example(embedder: Arc<dyn blazen_llm::EmbeddingModel>) -> blazen_memory::error::Result<()> {
let memory = Memory::new(embedder, InMemoryBackend::new());

memory.add(vec![
    MemoryEntry::new("The cat sat on the mat"),
    MemoryEntry::new("The dog played in the park"),
]).await?;

let results = memory.search("animals sitting", 5, None).await?;
for r in results {
    println!("{:.3}{}", r.score, r.text);
}
# Ok(())
# }

Local-only mode

use blazen_memory::{Memory, MemoryStore, MemoryEntry, InMemoryBackend};

# async fn example() -> blazen_memory::error::Result<()> {
let memory = Memory::local(InMemoryBackend::new());

memory.add(vec![MemoryEntry::new("hello world")]).await?;

// Use search_local instead of search — no embedding model needed.
let results = memory.search_local("hello", 5, None).await?;
# Ok(())
# }