网页 综合 更新时间 2026-04-29 10:00:00

Introducing the Nuxt Agent · Nuxt Blog

自动蜘蛛 nuxt.com 正文约 6000 字
Introducing the Nuxt Agent · Nuxt Blog
Announcements·Apr 29, 2026·7 min read
Our own AI agent on nuxt.com, grounded in the official docs and the Nuxt ecosystem. We built it internally using the AI SDK, our MCP server, and Nuxt UI components.
The Nuxt Agent is now in Beta on nuxt.com. We built it ourselves, plugged it into the site, and connected it to our docs, modules catalog, blog, and deployment guides.
Kapa AI served us well as a docs Q&A widget for the past couple of years. It searched the docs and summarized an answer, and that was about it. But Nuxt is more than docs. There are modules, templates, deployment providers, a changelog, GitHub issues, playgrounds, and real navigation across the site.
We wanted an agent that could handle all of it, with the same design language as the rest of nuxt.com and the same content pipeline (Nuxt Content) we already run. So we built our own on top of the Nuxt MCP server we shipped last November.
Here's what the agent does today:
You can reach the agent three ways:
Ask "how do I customize this for my app?" while reading a doc and the agent automatically pulls that page in as context. A small "Agent is using this page" indicator in the footer makes it explicit, and you can dismiss it whenever you want.
Answers come back as more than text. Ask about a module and you get a module card with metadata pulled live from api.nuxt.com. Ask for starter templates and you get a row of clickable template cards. Ask about deployment and you get provider cards that link to the right guide. Need to reproduce a bug? The agent can generate a StackBlitz playground link from the conversation itself.
Every assistant message has a thumbs up/down. If you want to share more (a missing piece, a wrong answer, an idea), the Report issue action opens a short form and creates a Linear ticket on our side with the conversation attached, so we have everything we need to follow up.
The agent can open that form itself, too. If you ask to "submit feedback" or "report an issue", or if the conversation starts to feel frustrated, the agent calls the report_issue tool and the same form opens inline. No button hunting required.
Conversations are saved and resume across reloads, so you can step away and pick up where you left off.
The agent's grounding comes from the Nuxt MCP server, the same one Cursor, Claude Desktop and ChatGPT connect to. That means the Nuxt Agent and your local AI assistant share the same structured data: the official docs, the modules catalog, the blog, deployment guides, and the Nuxt repositories' changelog.
On top of that grounding, the agent has a small set of native tools that render as UI in the chat: module and template cards, hosting providers, blog posts, StackBlitz playground links, and a GitHub issue search across nuxt, nuxt-modules and nuxt-content. The agent reaches for that issue search first whenever you paste an error.
The web is available too, through Anthropic's native web_search, but only as a fallback for things the model couldn't reasonably know: a brand new Vue release, a freshly published RFC, recent ecosystem news. It's not a general-purpose search engine, and the system prompt is explicit about that. We never use web_search for anything that should be answered from the docs or the rest of the Nuxt content exposed through MCP.
A single Nitro handler at server/api/agent.post.ts drives everything. On the client, an @ai-sdk/vue Chat instance points at /api/agent. On the server, AI SDK v6 streamText calls claude-sonnet-4.6, with tools merged from our own MCP server (/mcp, same origin) and a few native ones (show_*, open_playground, report_issue). Chat state lives in Drizzle ORM, and evlog wraps the model for structured telemetry on tokens, cost, and tool calls.
The whole pipeline runs on the AI SDK v6 UIMessage streaming model. The server side looks like this:
Two details are worth pointing out. stopWhen: stopWhenResponseComplete is a custom predicate that ends the loop as soon as the model produces text without another tool call, with a hard ceiling at 10 steps. That avoids the classic "model loops forever on tools" failure mode. And event.waitUntil(saveChat(...)) pushes persistence outside the response lifecycle, so the stream finishes for the user right away while the chat row gets upserted in the background.
The agent and external AI assistants talk to the same MCP server. That's the single most important architectural choice we made. The route handler opens an HTTP MCP client pointed at its own /mcp endpoint:
Those tools then get merged with the native UI tools into a single tools object passed to streamText. The payoff: any tool we add to the MCP server is immediately available to the Nuxt Agent and to every external assistant pointed at it, with no extra wiring. We wrote a separate post about how the MCP server itself works back in November.
Chats live in a single agent_chats table, keyed by the x-chat-id header the client sends on every request. Drizzle's onConflictDoUpdate accumulates token usage, estimated cost, duration, and request count across the lifetime of a conversation. That gives us per-chat analytics for free.
Every request also goes through a small consumeAgentRateLimit helper before streaming starts. The current cap is 20 messages per day per IP fingerprint, which is enough for real use and low enough to prevent runaway costs if something starts looping.
A lot of agent quality comes from the prompt. A few rules carried most of the weight: reach for search_github_issues first whenever the user pastes an error, prefer show_module over get_module when the answer should render as a card, never call web_search unless the question is genuinely outside what the model could know, and never end a turn with only a tool call. Together those rules cut tool-spam and hallucinations enough that the agent stays focused on the task at hand.
The agent is launching in Beta. In the short term, we're focused on the basics: better answer quality, richer memory across turns, and cleaner
访问原文 返回搜索 https://nuxt.com/blog/introducing-nuxt-agent
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。