Chat History
Chat History allows your agents to store and retrieve past conversations, enabling persistent context across sessions. When a user returns to your agent, their previous messages and interactions are available, creating a seamless conversational experience.
How It Works
Section titled “How It Works”Chat history is automatically available through Frontend Cloud. Conversations are stored per user session and can be retrieved by your agent to maintain continuity. This enables your agents to:
- Resume conversations where users left off
- Reference previous interactions for context-aware responses
- Build long-term memory of user preferences and past requests
- Display conversation threads in your agent’s UI
Schema
Section titled “Schema”| Column | Type | Description |
|---|---|---|
id | UUID | Primary key |
user_id | UUID | The user who owns the chat |
title | text | Display title for the conversation |
project_id | text | The project this chat belongs to |
search_index | text | Full-text search index for finding chats |
metadata | jsonb | Arbitrary metadata for custom fields and attributes |
Messages
Section titled “Messages”| Column | Type | Description |
|---|---|---|
id | UUID | Primary key |
chat_id | UUID | Foreign key to the parent chat |
user_id | UUID | The user who sent or received the message |
role | text | Either user or assistant |
parts | jsonb[] | Message content parts following the Vercel AI SDK UIMessage format |
metadata | jsonb | Arbitrary metadata for custom fields and attributes |
The parts field is an array of typed content blocks, supporting text, tool calls, tool results, and other multi-modal content as defined by the Vercel AI SDK’s UIMessage specification.
Getting Started
Section titled “Getting Started”When you create a new agent project, chat history is ready to use. The Vercel AI SDK’s message persistence integrates directly with Frontend Cloud to store and load conversation threads automatically.