chapter one

1 Using generative AI in web apps

 

This chapter covers

  • What are generative AI web applications and what can they do?
  • How generative AI compares to traditional AI
  • How generative AI apps work
  • Handling the concerns and implications of AI

Generative AI web apps are web applications that integrate advanced AI models—most commonly large language models (LLMs)—to create original text, images, audio, or video. By generating content dynamically rather than relying solely on predefined logic or static data, these apps deliver personalized, adaptive, and highly interactive user experiences. This shift fundamentally changes how we build and engage with digital products, enabling conversational interfaces, intelligent automation, and entirely new categories of applications.

This book teaches you how to harness these capabilities and build scalable, production-ready generative AI web apps. You’ll learn to integrate AI features using popular models and providers such as OpenAI and Google AI, while developing your applications with React, Next.js, and the Vercel AI SDK. Toward the end, you’ll see how to work with the Model Context Protocol (MCP) to access external tools and data sources in a secure and standardized way.

We assume a basic understanding of JavaScript and familiarity with building simple React applications; everything else will be introduced as needed. Our focus is on the concepts and techniques essential for designing, developing, and deploying AI-powered web experiences.

1.1 What generative AI can do for web applications

1.1.1 Gen AI capabilities

1.1.2 Real-world uses of generative AI

1.2 How a generative AI web app works

1.2.1 Core components

1.2.2 The flow of user interactions

1.3 AI tools and ecosystem

1.3.1 Key technologies creating AI-powered apps

1.3.2 Choosing the right model

1.4 Generative vs traditional AI

1.5 Handling the concerns and implications of generative AI

1.5.1 What are the limitations of generative AI?

1.5.2 Will developers lose jobs because of AI?

1.5.3 Are generative AI outputs reliable?

1.6 References

1.7 Summary