A Log-Structured Merge-Tree (LSM-Tree) is a write-optimized data structure used in storage engines that batches writes in a fast, in-memory component (the memtable) before sequentially flushing them to immutable, sorted files (SSTables) on disk. This design transforms random writes into sequential disk operations, dramatically increasing write throughput and making it ideal for agentic memory systems that must log high volumes of state changes, events, and interactions. The core trade-off is that reads may require checking multiple levels of files, which is optimized through bloom filters and compaction.
