KInventory is a small Fabric library which allows you to easily serialize inventories to JSON (or any other supported format) using kotlinx.serialization. It's fairly lightweight (only 80KB) and doesn't even depend on the Fabric API (though you will need Fabric Language Kotlin). For more information, please check the wiki.