use crate::fact::MemoryTier;

#[derive(Debug, Clone)]
pub struct VaultQuery {
    pub keyword: String,
    pub tiers: Vec<MemoryTier>,
    pub top_k: usize,
    pub min_confidence: Option<f32>,
    pub recency_days: Option<u32>,
}

impl VaultQuery {
    pub fn new(keyword: impl Into<String>) -> Self {
        Self {
            keyword: keyword.into(),
            tiers: Vec::new(),
            top_k: 10,
            min_confidence: None,
            recency_days: None,
        }
    }

    pub fn top_k(mut self, k: usize) -> Self {
        self.top_k = k;
        self
    }
    pub fn min_confidence(mut self, c: f32) -> Self {
        self.min_confidence = Some(c);
        self
    }
    pub fn recency_days(mut self, d: u32) -> Self {
        self.recency_days = Some(d);
        self
    }

    pub fn in_tier(mut self, tier: MemoryTier) -> Self {
        self.tiers.push(tier);
        self
    }
}
