The Kotlin SDK models all data — beyond the dedicated record types — using kotlinx.serialization JSON types. Read methods return a JsonElement; write methods accept a JsonObject.
Source: surrealdb.kotlin
Building values
Construct objects with buildJsonObject.
Decoding values
Rather than navigating raw JsonElement trees, decode results into your own @Serializable types with .queryAs<T>(), .awaitAs<T>(), or .decode<T>().