---
title: Feedback
description: Collect private ratings on assistant messages
---

Use Feedback to add private upvote and downvote actions to your assistant messages. Only you can access ratings on your conversations, and public shares do not expose them.

## Installation

### Add the plugin

```bash
bunx chat-js@alpha add feedback
```

When you install the plugin, the CLI registers the `feedback` router, message actions, and conversation cleanup callback.

### Migrate the database

```bash
bun run db:generate
# Review the generated SQL, then apply it to your database.
bun run db:migrate
```

Your existing reference-app data keeps the same table and keys. See [plugin migrations](./using-plugins#database-migrations).

## Usage

Use the rating actions below an assistant message in your own conversation. Voting does not move the chat in history or change its update timestamp. Each rating refers to the exact conversation and assistant message, so different branches keep their own feedback.

Your message actions share one cached ratings query per conversation. A successful vote cancels stale reads before updating the cache.

## Schema

You store ratings in the plugin-owned `EveVote` table, keyed by conversation and native assistant-message ID. When you delete a conversation, you remove only its votes, even when other branches keep the logical chat alive.

Before saving your rating, the plugin validates the message against an EVE snapshot and rechecks ownership and bound state under the conversation-family lock.

## Customization

Edit `chatjs/plugins/feedback/` to change the rating UI, queries, or validation. The `MessageActions` placement receives `conversationId`, `messageId`, and `disabled`.

When you delete conversations, cleanup uses `onDeleteConversations` inside the core deletion transaction. Feedback does not use `updateOwnedChat`, because voting must not update chat recency. See the [Plugin API](../reference/plugin-api).
