use async_trait;
use crate::;
/// Persistent conversation history attached to a [`Chain`](crate::Chain).
///
/// A memory implementation stores and retrieves [`Message`] turns so that
/// subsequent chain calls have access to prior context. Implementations may
/// keep history in process memory, a database, or a vector store.
///
/// # Example
///
/// ```rust,ignore
/// use rune_chain_core::{Memory, Message};
///
/// memory.add(Message::human("What is 2 + 2?")).await?;
/// memory.add(Message::ai("4")).await?;
///
/// let history = memory.messages().await?;
/// assert_eq!(history.len(), 2);
/// ```