praxis_context/
strategy.rs

1use std::sync::Arc;
2use anyhow::Result;
3use praxis_llm::Message;
4use async_trait::async_trait;
5use praxis_persist::PersistenceClient;
6
7/// Result of context retrieval
8#[derive(Debug, Clone)]
9pub struct ContextWindow {
10    pub system_prompt: String,
11    pub messages: Vec<Message>,
12}
13
14/// Strategy for building context window from conversation history
15#[async_trait]
16pub trait ContextStrategy: Send + Sync {
17    /// Get context window for a conversation
18    async fn get_context_window(
19        &self,
20        thread_id: &str,
21        persist_client: Arc<dyn PersistenceClient>,
22    ) -> Result<ContextWindow>;
23}
24