"""Top-level memory facade."""

from __future__ import annotations

from typing import Any, Callable

from thryve.config import MemoryConfig
from thryve.core.memory.manager import MemoryManager
from thryve.core.memory.types import MemoryChunk


def create_memory(
    config: MemoryConfig | None = None,
    embedding_fn: Callable[[list[str]], list[list[float]]] | None = None,
) -> MemoryManager:
    """Create a :class:`MemoryManager` from config."""
    if config is None:
        config = MemoryConfig()

    return MemoryManager(
        storage_path=config.storage_path,
        embedding_fn=embedding_fn,
        short_term_retention_days=config.short_term_retention_days,
        vector_weight=config.vector_weight,
        bm25_weight=config.bm25_weight,
    )
