Build a Streaming AI Assistant in TypeScript
Build a working AI writing assistant with TypeScript, Express, and React. Stream responses in real time, maintain conversation history, and handle failures gracefully — all in one hands-on session.
About the Workshop
You know how to build web apps. In this two-hour workshop, you’ll build one with AI at its core, using TypeScript and React. You’ll learn how models fail and how to build around those failures.
You’ll build a writing assistant that drafts emails, bios, and product descriptions. Replies appear as they arrive, and follow-ups like “make it shorter” revise the previous draft. Along the way, you’ll understand what the model receives, how conversation history works, and what happens when a reply fails.
You’ll code along live, with checkpoint branches to help you catch up if you fall behind. You’ll leave with a working app and an understanding of how its AI features fit together.
What You'll Learn
- Understand how tokens, context limits, and temperature affect a model’s replies
- Call a model from Node.js with the AI SDK and inspect its reply, finish reason, and token usage
- Keep API keys on the server and validate requests before sending them to the model
- Maintain a conversation by sending previous messages with each request
- Stream replies from an Express server into a React chat interface with the AI SDK’s
streamTextanduseChat - Add completed replies to conversation history and recover when a reply fails, gets cut off, or is stopped
Prerequisites
- Familiarity with React components and
useState - Comfortable reading TypeScript and using JavaScript’s
async/awaitandfetch - Able to clone a Git repository, install dependencies with npm, and run terminal commands
- Node.js 22.18 or newer and Git installed
Who This Workshop Is For
- React and TypeScript developers building their first AI feature
- Developers who’ve made a model API call and want to add streaming replies and conversation history
- Developers comfortable with React basics who want to understand how the browser, server, and model work together
Agenda
8 parts · 2 hours · Times in WAT
Open and demo: see the finished app
8 min
How LLMs work: tokens, the context window, temperature
15 min
First call from Node
15 min
Chat with memory
25 min
Break
5 min
Handling failures and interrupted streams
37 min
Failure tests and token growth
7 min
What’s missing before you go public
8 min
Your instructor
Chimezie Enyinnaya
Chimezie Enyinnaya is a software engineer and educator focused on building practical, real-world applications. He has experience designing backend systems, building developer tools, and working across the stack with TypeScript, Node.js, and PHP. Through Mezie Labs, he helps developers turn technical concepts into working applications through hands-on learning.