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.
💾 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.
📇 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.
📜 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.
🔌 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.
🔐 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
Design Principles
- Separation of concerns — each layer has one job and does it well
- Testability — layers can be unit-tested independently
- Extensibility — swap SQLite for PostgreSQL? Change the Storage Layer. Add vector search? Extend the Index Layer
- Security by default — the Crypto Layer wraps everything; encryption is not optional
- Auditability — every cross-layer operation is logged