Skip to main content
NetScriptdocs Search docs ⌘K v0.0.9
Browse documentation

AI Chat

This track builds a durable AI chat app, the kind of support assistant a product ships next to its docs. Most chat UIs keep the conversation in component state, so a refresh, a dropped socket or a second tab loses it. Here the transcript (messages, streaming markdown, tool-call cards and MCP widgets) lives in a durable session stream, and the UI is a view of it: the same log replays on reload, on reconnect and in every tab watching, and replies stream in as the model produces them.

The track uses three NetScript packages:

What you will build

A chat-app/ Fresh workspace whose home screen is a working chat. The same project grows chapter by chapter, so do the chapters in order.

For separate queued work that publishes a result to a stream, follow Deliver a result from a worker. The chat chapters below keep the model turn in the session route; a durable transcript alone does not make that route's execution survive process termination.

Before you begin

  • Deno 2.x, the Aspire CLI and Docker. The quickstart covers installing them; chapter 1 checks each one.
  • An ANTHROPIC_API_KEY. The track calls Anthropic directly through @tanstack/ai. Any provider @tanstack/ai supports works; Anthropic keeps the examples concrete. Chapter 1 shows where to set the key.

The arc: route → UI → tools → MCP → live streaming

Each chapter adds one link to the durable-chat spine.

When you finish, the AI & Agents guides pick up where the track stops. Start with chapter 1.

Search all documentation

Type a term to search the documentation.