Skip to content

Base

Backend adapter abstractions for gllm-memory.

This module defines the internal adapter contract used to isolate memory-engine selection and native runtime/client construction from MemoryManager.

BaseMemoryBackendAdapter

Bases: ABC

Abstract adapter interface for one internal memory backend.

Attributes:

Name Type Description
backend_key str

Stable internal identifier for the backend implementation.

build_configured_client(*, config, instruction=None, timeout_sec=30) abstractmethod

Build one configured memory client for this backend.

Parameters:

Name Type Description Default
config dict[str, Any] | MemoryManagerConfig

Memory configuration candidate.

required
instruction str | None

Optional instruction override. Defaults to None.

None
timeout_sec int

Request timeout in seconds. Defaults to 30.

30

Returns:

Name Type Description
BaseMemoryClient BaseMemoryClient

Concrete client instance for the selected backend.

can_handle_config(config) abstractmethod

Determine whether this adapter can handle one config object or payload.

Parameters:

Name Type Description Default
config dict[str, Any] | MemoryManagerConfig

Memory configuration candidate.

required

Returns:

Name Type Description
bool bool

True if this adapter can build a runtime for the given config.