def get_chat_history(chat_id: str) -> List[Dict[str, Any]]

Parameters

  • chat_id (str): Identifier of the conversation to retrieve.

Returns

  • List[Dict[str, Any]]: A list of message dictionaries in chronological order.

Each message dictionary contains:

  • role – either "user" or "assistant"
  • content – the original text of the message
  • timestamp – ISO-8601 timestamp string

Example

db = Morphik()
history = db.get_chat_history("chat_123")
for msg in history:
    print(f"[{msg['role']}] {msg['content']}")