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.
Status: Implementation IMPLEMENTED (library) × Exposure —. Earlier versions of this page said the memory service “exposes HTTP endpoints” at http://127.0.0.1:3008. services/memory/src registers no routes; 3008 is only the default port in the service config struct, and its main.rs does not start an HTTP listener. No binary in cmd/ (including allternit-api) depends on allternit-memory-fabric today; it is consumed by other workspace crates under services/memory/.

Usage

The fabric is a library crate (allternit-memory-fabric). There is no public HTTP API for it. For user-facing memory endpoints see Memory and Memory stores.

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:

How this relates to the Agency Kernel

The fabric is a storage layer beneath the memory kernel. It is not part of the Agency Kernel public contracts.