# Class ConversationStore

java.lang.Object
com.codename1.ai.ConversationStore

public final class ConversationStore extends Object

JSON-backed persistent conversation history.

Stores `ChatMessage` lists in `Storage` under a caller-chosen key so apps can rehydrate a `ChatView` after process restart. Multimodal parts (`ImagePart`, `ToolResultPart`) are serialized to a lossy text fallback -- image data is not round-tripped (apps that need full multimodal persistence should encode the bytes themselves and keep them in `FileSystemStorage`).

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ConversationStore(String storageKey)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `clear()`
  `String`
  `getStorageKey()`
  `List<ChatMessage>`
  `load()`
  `void`
  `save(List<ChatMessage> messages)`

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ConversationStore

    public ConversationStore(String storageKey)

- ## Method Details

  - ### save

    public void save(List<ChatMessage> messages) throws java.io.IOException
    Throws:
      `java.io.IOException`

  - ### load

    public List<ChatMessage> load() throws java.io.IOException
    Throws:
      `java.io.IOException`

  - ### clear

    public void clear()

  - ### getStorageKey

    public String getStorageKey()