1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! RecallBench — A universal benchmark harness for AI memory systems.
//!
//! This library exposes the core traits and types needed to implement
//! memory system adapters for benchmarking.
//!
//! # Implementing a Memory System
//!
//! ```rust,ignore
//! use recallbench::traits::MemorySystem;
//! use recallbench::types::{ConversationSession, IngestStats, RetrievalResult};
//!
//! struct MySystem;
//!
//! #[async_trait::async_trait]
//! impl MemorySystem for MySystem {
//! fn name(&self) -> &str { "my-system" }
//! fn version(&self) -> &str { "1.0.0" }
//! async fn reset(&self) -> anyhow::Result<()> { Ok(()) }
//! async fn ingest_session(&self, session: &ConversationSession) -> anyhow::Result<IngestStats> {
//! Ok(IngestStats::default())
//! }
//! async fn retrieve_context(&self, query: &str, date: Option<&str>, budget: usize) -> anyhow::Result<RetrievalResult> {
//! Ok(RetrievalResult { context: String::new(), items_retrieved: 0, tokens_used: 0, duration_ms: 0 })
//! }
//! }
//! ```