CopilotKit

Feedback on your traces.

Did your CopilotKit assistant actually help?

CopilotKit gives you the thread. What it cannot give you is whether the person on the other end got what they needed. This asks them, once, when the task resolves, and keeps the answer attached to the thread it came from.

Install

Install

One package. It sits beside your existing tracing rather than replacing any of it.

npm install @uservane/copilotkit @copilotkit/react-core
# peer: react >= 18
# pin CopilotKit >= 1.63 (threadId propagation bug in older versions, #2624)

Wiring

Mint with sessionId = threadId

// app/api/feedback-token/route.ts (server only)
import { mintFeedbackToken } from "@uservane/copilotkit/server";

const threadId = body.threadId; // same value as <CopilotKit threadId={...}>

const { tokens } = await mintFeedbackToken({
  secretKey: process.env.USERVANE_SECRET_KEY!, // uv_sk_... never to the client
  respondentId: userId,
  sessionId: threadId,
});

What binds to what. Mint with sessionId set to the same threadId you pass to <CopilotKit threadId={...}>, and the rating lands on that thread.

Limits

What it does not do

Worth reading before you wire it in, because both of these are things people reasonably assume and neither is true.

Pin CopilotKit 1.63 or later
Earlier versions do not propagate threadId reliably (CopilotKit #2624). Without a stable thread id there is nothing to bind a rating to, so the correlation is the thing that breaks.
One ask per thread, not per message
The score belongs to the piece of work rather than to each exchange inside it. Asking after every message trains people to dismiss the prompt on sight, and a widget everyone dismisses measures nothing while still costing you goodwill.

The number

The number you get back

Every score ships with its margin of error and the sample it came from, and a sample too thin to report is suppressed rather than printed. An agent satisfaction number off twelve responses is not a metric, and a tool that shows it to you anyway is not doing you a favour.

Free to start, no card. The SDKs are MIT and open source at github.com/uservane/uservane-js.