1mod add;
2mod builder;
3pub mod constants;
4mod crud;
5pub mod decay;
6mod engine;
7pub(crate) mod graph_pipeline;
8pub mod payload;
9mod pipeline;
10mod prompts;
11pub(crate) mod rehearsal;
12mod search;
13
14use mem7_error::{Mem7Error, Result};
15
16pub use builder::MemoryEngineBuilder;
17pub use engine::MemoryEngine;
18
19pub(crate) fn require_scope(
20 operation: &str,
21 user_id: Option<&str>,
22 agent_id: Option<&str>,
23 run_id: Option<&str>,
24) -> Result<()> {
25 if user_id.is_none() && agent_id.is_none() && run_id.is_none() {
26 return Err(Mem7Error::Config(format!(
27 "{operation} requires at least one of user_id, agent_id, or run_id"
28 )));
29 }
30 Ok(())
31}