Overview

The Allternit Memory Fabric is the unified memory and persistence layer for the Allternit platform. It provides a common Rust interface for storing, retrieving, and querying memory across backends, with an append-only, cryptographically chained ledger for auditability.

Base URL

The fabric is consumed as a library crate. The top-level memory service exposes HTTP endpoints at:

Components

Core traits

MemoryProvider

Every memory backend implements:

MemoryFabric

The recommended entry point for Rust services:

Data types

MemoryEntry

MemoryQuery

Backend types

Routing rules

MemoryRouter::determine_backend evaluates rules in priority order:
  1. TagMatch — route by memory tag.
  2. TenantSpecific / SessionSpecific — route by tenant or session.
  3. PersistenceRequired — route to a persistent backend.
  4. PerformanceRequirement — route by latency requirement.
  5. SizeThreshold — reserved for size-based routing.
If no rule matches, the configured default_backend is used. Fallbacks are tried when the selected backend fails ping and fallback_enabled is true.

Ledger format

The HistoryLedger writes one JSON object per line (JSONL). Each line is a LedgerEntry:
Integrity verification checks that every content_hash matches its content, the first entry has a null prev_hash, and each subsequent entry’s prev_hash equals the previous entry’s content_hash.

Error codes

All fabric operations return MemoryError: