🏗️ 5-Layer Architecture

Five distinct layers, each with a clear responsibility. Together, they form a complete memory system for AI agents.

UAML's architecture separates concerns into five layers. Each layer can be understood, tested, and replaced independently. This modularity makes the system robust, extensible, and auditable.

1

💾 Storage Layer

The foundation. SQLite databases store all memory entries with full ACID guarantees. WAL mode enables concurrent reads during writes. Each memory type gets its own table with optimized schema. Backup is as simple as copying a file.

2

📇 Index Layer

Makes memories findable. Full-text search (FTS5) for keyword queries. BM25 ranking for relevance scoring. Topic-based indexes for categorical retrieval. Temporal indexes for time-range queries. The Index Layer turns raw data into searchable knowledge.

3

📜 Policy Layer

Governs what happens with data. Retention policies control how long memories live. Access policies determine who can read what. Recall policies shape how memories are retrieved. Classification policies label data sensitivity. The Policy Layer ensures data governance without manual intervention.

4

🔌 Interface Layer

How applications talk to UAML. A clean Python API (uaml.facade.UAML) provides high-level operations: learn, recall, search, forget. Behind the scenes, the Interface Layer coordinates all other layers. One call to learn() triggers storage, indexing, policy evaluation, and encryption.

5

🔐 Crypto Layer

Secures everything. Post-quantum encryption (ML-KEM-768) protects data at rest. Signed exports verify data integrity. Shamir's Secret Sharing enables secure key backup. The Crypto Layer wraps all other layers — data is encrypted before storage and decrypted after retrieval.

How They Work Together

# What happens when you call uaml.learn(): uaml.learn("Q1 revenue exceeded targets by 12%", topic="finance", source_type="report") # 1. Interface Layer receives the call # 2. Policy Layer checks: retention? classification? consent? # 3. Crypto Layer encrypts the data # 4. Storage Layer writes to SQLite # 5. Index Layer updates FTS and topic indexes # 6. Audit log records the operation # What happens when you call uaml.recall(): results = uaml.recall("revenue performance") # 1. Interface Layer receives the query # 2. Policy Layer applies recall rules and budget # 3. Index Layer finds matching memories (BM25 + filters) # 4. Storage Layer retrieves the records # 5. Crypto Layer decrypts the data # 6. Interface Layer returns ranked, budgeted results

Design Principles

← Back to UAML