Skip to main content

create_memory_backend

Function create_memory_backend 

Source
pub fn create_memory_backend(
    settings: &Settings,
) -> Option<Arc<dyn MemoryBackend>>
Expand description

Create a memory backend if memory is enabled in settings.

Under the Oxi Foundation v1 host, the only durable-memory authority is the oxibrain daemon (plan §5). Local SQLite/Mnemopi/JSON/file-summary fallbacks are explicitly forbidden (§5.h, §6.f): the Foundation host MUST NOT silently run a second durable store.

Returns a crate::foundation::brain::BrainMemoryBackend when memory_enabled is set and the daemon’s socket exists at the canonical path (or $OXIBRAIN_SOCKET). The backend is not eagerly connected — the first call attaches and surfaces degraded per call when the daemon is unreachable. When the socket is absent, returns None: the agent memory tools surface a typed “backend unavailable” result naming the socket and the recovery command (oxibrain serve). Code work continues; only durable-memory tool calls fail visibly.