Expand description
High-level MemexEngine API for library consumers.
The MemexEngine provides a simple, ergonomic interface for storing and
searching vector embeddings. It wraps the lower-level StorageManager and
EmbeddingClient to provide a unified API.
§Example
ⓘ
use rust_memex::{MemexEngine, MemexConfig};
use serde_json::json;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// Quick setup for an app
let engine = MemexEngine::for_app("my-app", "documents").await?;
// Store a document
engine.store("doc-1", "Hello world!", json!({"source": "test"})).await?;
// Search for similar documents
let results = engine.search("greeting", 5).await?;
// Get by ID
if let Some(doc) = engine.get("doc-1").await? {
println!("Found: {}", doc.text);
}
// Delete
engine.delete("doc-1").await?;
Ok(())
}Re-exports§
pub use crate::rag::SearchResult as Document;
Structs§
- Batch
Result - Result of a batch operation
- Dive
Result - Result of a dive operation for a single layer
- Layer
Stats - Statistics for a single layer in dive results
- Memex
Config - Configuration for MemexEngine.
- Memex
Engine - High-level API for vector memory operations.
- Meta
Filter - Metadata filter for search and deletion operations.
- Store
Item - Item for batch storage operations.