factories • AI Agent SDK

Memory Adapter Factory Functions

factories

AI Agent

Memory Adapter Factory Functions

Provides factory functions for heavy memory adapters that replace hardcoded imports in memory/memory.py. These enable lazy loading of heavy dependencies while maintaining the protocol-driven architecture.

Each factory function:

  1. Lazy imports the required dependencies
  2. Creates and returns an adapter instance that implements MemoryProtocol
  3. Raises clear ImportError with installation instructions if dependencies missing

This approach follows the protocol-driven core principle by moving heavy implementations out of the core Memory class while preserving backward compatibility.

Import

python
from praisonaiagents.memory.adapters import factories

Classes

Functions