Vercel AI SDK
Feedback on your traces.
Did your Vercel AI SDK agent actually help?
Your traces show what the agent did and your evals score the output. Neither answers the question the team actually has, which is whether the person got what they came for. This captures that at the moment the task resolves, from the user, and binds it to the session you are already tracing.
Install
Install
One package. It sits beside your existing tracing rather than replacing any of it.
npm install @uservane/vercel-aiWiring
Wrap the chat, then resolve the task
// app/providers.tsx (client component)
"use client";
import { UserVaneProvider } from "@uservane/vercel-ai";
export function Providers({ children }: { children: React.ReactNode }) {
return (
<UserVaneProvider
apiKey={process.env.NEXT_PUBLIC_USERVANE_KEY!}
surveySlug="post-task"
>
{children}
</UserVaneProvider>
);
}
// wherever the task genuinely finishes
const { resolveTask } = useUserVane();
resolveTask({ outcome: "refunded" });
What binds to what. The rating is bound server-side to the sessionId you pass to Langfuse propagateAttributes, so a score cannot be re-pointed at a session it did not come from.
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.
- It is not a tracer
- It does not record your prompts, outputs, latency or tool tree. Your observability tool does that. This adds the user-satisfaction signal on top and lands it on the same session.
- It asks at resolution, not per turn
- Scores attach to the session rather than to each message. Asking after every turn is how you train people to dismiss the widget, and a dismissed widget measures nothing.
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.