1use adk_core::{Content, Result};
2use async_trait::async_trait;
3use chrono::{DateTime, Utc};
4
5#[derive(Debug, Clone)]
6pub struct MemoryEntry {
7 pub content: Content,
8 pub author: String,
9 pub timestamp: DateTime<Utc>,
10}
11
12#[derive(Debug, Clone)]
13pub struct SearchRequest {
14 pub query: String,
15 pub user_id: String,
16 pub app_name: String,
17}
18
19#[derive(Debug, Clone)]
20pub struct SearchResponse {
21 pub memories: Vec<MemoryEntry>,
22}
23
24#[async_trait]
25pub trait MemoryService: Send + Sync {
26 async fn add_session(
27 &self,
28 app_name: &str,
29 user_id: &str,
30 session_id: &str,
31 entries: Vec<MemoryEntry>,
32 ) -> Result<()>;
33 async fn search(&self, req: SearchRequest) -> Result<SearchResponse>;
34}