#!/usr/bin/env python3
"""
记忆银行工厂：根据配置创建不同后端实现
"""
from __future__ import annotations

import os
from typing import Optional

from jixia_academy.core.memory_bank.interface import MemoryBankInterface


def get_memory_backend(prefer: Optional[str] = None) -> MemoryBankInterface:
    """
    获取记忆银行后端
    默认使用内存实现
    """
    from jixia_academy.core.memory_bank.memory_impl import MemoryBankImpl
    
    # 使用内存实现
    memory_bank = MemoryBankImpl(storage_path="jixia_academy/data/memory")
    print("🧠 使用内存记忆银行后端")
    return memory_bank
