Choose the host you already use. The cockpit gives you the published path, the runtime checks that matter, and the boundary the integration does not cross.
Hook-capable hosts can participate in lifecycle events. MCP-and-rules hosts expose explicit tools and guidance without pretending a rules file is a hidden hook.
Start with the deterministic MockEmbedder, prove storage and retrieval locally, then choose a production embedding boundary deliberately.
Choose the environment that will actually launch Rust library. The selector never invents an unsupported translation.
The upstream crate contract currently declares Rust 1.75 as its minimum.
A binary or library crate where you own storage, lifecycle, and embedder configuration.
SQLite is authoritative; indexes and vector artifacts remain derived and rebuildable.
Begin with MockEmbedder. Select a production provider only after the local contract works.
Version 0.5.10 is the version documented by the current upstream README and Cargo manifest. The registry snapshot also observes 0.5.11, whose quick-start sample is not asserted here without matching source documentation.
cargo add semantic-memory@0.5.10
cargo add tokio --features macros,rtSave as src/main.rs. This fixture needs no hosted model or embedding download.
use semantic_memory::{EmbeddingConfig, MemoryConfig, MemoryStore, MockEmbedder};
use std::path::PathBuf;
#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), semantic_memory::MemoryError> {
let config = MemoryConfig {
base_dir: PathBuf::from("memory-example"),
embedding: EmbeddingConfig {
dimensions: 768,
..Default::default()
},
..Default::default()
};
let store = MemoryStore::open_with_embedder(
config,
Box::new(MockEmbedder::new(768)),
)?;
store
.add_fact("general", "Rust was first released in 2015", None, None)
.await?;
let results = store
.search("when was Rust released", Some(5), Some(&["general"]), None)
.await?;
for result in results {
println!("{:.4} {}", result.score, result.content);
}
Ok(())
}