use serde::{Deserialize, Serialize};
use std::collections::HashMap;
#[derive(Debug, Deserialize)]
pub struct CreateMemoryRequest {
pub content: String,
pub user_id: Option<String>,
pub agent_id: Option<String>,
pub run_id: Option<String>,
pub actor_id: Option<String>,
pub role: Option<String>,
pub memory_type: Option<String>,
pub custom: Option<HashMap<String, serde_json::Value>>,
}
#[derive(Debug, Deserialize)]
pub struct UpdateMemoryRequest {
pub content: String,
}
#[derive(Debug, Deserialize)]
pub struct BatchDeleteRequest {
pub ids: Vec<String>,
}
#[derive(Debug, Deserialize)]
pub struct BatchUpdateRequest {
pub updates: Vec<MemoryUpdate>,
}
#[derive(Debug, Deserialize)]
pub struct MemoryUpdate {
pub id: String,
pub content: String,
}
#[derive(Debug, Serialize)]
pub struct BatchOperationResponse {
pub success_count: usize,
pub failure_count: usize,
pub errors: Vec<String>,
pub message: String,
}
#[derive(Debug, Deserialize)]
pub struct SearchMemoryRequest {
pub query: String,
pub user_id: Option<String>,
pub agent_id: Option<String>,
pub run_id: Option<String>,
pub actor_id: Option<String>,
pub memory_type: Option<String>,
pub limit: Option<usize>,
pub similarity_threshold: Option<f32>,
}
#[derive(Debug, Deserialize)]
pub struct ListMemoryQuery {
pub user_id: Option<String>,
pub agent_id: Option<String>,
pub run_id: Option<String>,
pub actor_id: Option<String>,
pub memory_type: Option<String>,
pub limit: Option<usize>,
}
#[derive(Debug, Serialize)]
pub struct MemoryResponse {
pub id: String,
pub content: String,
pub metadata: MemoryMetadataResponse,
pub created_at: String,
pub updated_at: String,
}
#[derive(Debug, Serialize)]
pub struct MemoryMetadataResponse {
pub user_id: Option<String>,
pub agent_id: Option<String>,
pub run_id: Option<String>,
pub actor_id: Option<String>,
pub role: Option<String>,
pub memory_type: String,
pub hash: String,
pub importance_score: Option<f32>,
pub custom: HashMap<String, serde_json::Value>,
}
#[derive(Debug, Serialize)]
pub struct SearchResponse {
pub results: Vec<ScoredMemoryResponse>,
pub total: usize,
}
#[derive(Debug, Serialize)]
pub struct ScoredMemoryResponse {
pub memory: MemoryResponse,
pub score: f32,
}
#[derive(Debug, Serialize)]
pub struct ListResponse {
pub memories: Vec<MemoryResponse>,
pub total: usize,
}
#[derive(Debug, Serialize)]
pub struct SuccessResponse {
pub message: String,
pub id: Option<String>,
}
#[derive(Debug, Serialize)]
pub struct ErrorResponse {
pub error: String,
pub code: String,
}
#[derive(Debug, Serialize)]
pub struct HealthResponse {
pub status: String,
pub vector_store: bool,
pub llm_service: bool,
pub timestamp: String,
}
#[derive(Debug, Serialize)]
pub struct LLMStatusResponse {
pub overall_status: String,
pub completion_model: ModelStatus,
pub embedding_model: ModelStatus,
pub timestamp: String,
}
#[derive(Debug, Serialize)]
pub struct ModelStatus {
pub available: bool,
pub provider: String,
pub model_name: String,
pub latency_ms: Option<u64>,
pub error_message: Option<String>,
pub last_check: String,
}
#[derive(Debug, Serialize)]
pub struct LLMHealthResponse {
pub completion_model_available: bool,
pub embedding_model_available: bool,
pub timestamp: String,
}