---
title: "Discussion on \"Pydantic AI chat history in a database or Redis: store result.conversation per user and thread\" | Hashnode"
description: "Discussion on \"Pydantic AI chat history in a database or Redis: store result.conversation per user and thread\". Keep Pydantic AI chats across restarts: one Conversation per user and thread in SQLite, Postgres or Redis, plus an append-only option for long chats."
url: "https://hashnode.com/posts/pydantic-ai-persist-message-history-database-redis/6af9daed91aa885427122d5d"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Pydantic AI chat history in a database or Redis: store result.conversation per user and thread](https://memorysync.hashnode.dev/pydantic-ai-persist-message-history-database-redis?utm_source=hashnode&utm_medium=feed)

Keep Pydantic AI chats across restarts: one Conversation per user and thread in SQLite, Postgres or Redis, plus an append-only option for long chats.

2h ago · 13 min read · memorysync.hashnode.dev  
Read the article

-   [#pydantic-ai](https://hashnode.com/tag/pydantic-ai)
-   [#python](https://hashnode.com/tag/python)
-   [#ai](https://hashnode.com/tag/ai)
-   [#agents](https://hashnode.com/tag/agents)
-   [#tutorial](https://hashnode.com/tag/tutorial)

## Written by

[MemorySync](https://hashnode.com/@memorysync)

@memorysync · San Francisco, USA

  
[View profile](https://hashnode.com/@memorysync)

Building MemorySync (memorysync.io) — persistent memory infrastructure for AI agents, Cursor, and Claude Code.

Building MemorySync (memorysync.io) — persistent memory infrastructure for AI agents, Cursor, and Claude Code.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
