Leanpub Header

Skip to main content

From Frontend to AI Engineering

A Practical Guide to AI Agents, RAG, MCP Servers and LLM Apps in TypeScript

This book is 100% completeLast updated on 2026-06-08

Build real AI products with TypeScript — no Python required. Learn LLMs, RAG, Agents, MCP, and production AI engineering from a frontend developer's perspective.

Interested in this book? Show your support by saying what you'd like to pay for it!

$
PDF
EPUB
WEB
APP
About

About

About the Book

Most AI development content assumes Python. If you're a TypeScript developer who's tried to get started with AI — and kept hitting a wall of Python libraries, Python tutorials, and Python examples — this book is for you.

The core insight behind it: for most real products, AI development is fundamentally about calling APIs. Calling HTTP endpoints, handling async streams, validating structured responses — that's exactly what TypeScript developers already do. The switching cost is nearly zero. TypeScript's type system is actually a genuine advantage: Zod pairs naturally with LLM structured output, and sharing types between frontend and backend removes friction across the full stack.

This book takes you from your first LLM API call to a deployable, production-ready AI workbench — covering agents, RAG, MCP servers, and multimodal AI, all in TypeScript.

What you'll build:

  • A production multi-turn conversation system with context compression and cost tracking
  • A hybrid RAG pipeline (BM25 + vector search + reranking) backed by PostgreSQL and pgvector
  • A multi-tenant knowledge base where each customer's data stays strictly isolated
  • A ReAct agent that reasons over tool results across multiple steps
  • A multi-agent system that decomposes goals, executes subtasks in parallel, and synthesizes results
  • An autonomous coding agent that writes, runs, and self-repairs code in a sandbox
  • An MCP server you can publish to npm and reuse across any MCP-compatible host
  • A complete AI workbench integrating RAG, agents, MCP, and multimodal capabilities — deployable to Vercel and Railway

What's covered:

The book is organized into six parts. It starts with full-stack TypeScript foundations — the server patterns and type-safe API design you'll need before touching any LLM. Then it moves into LLM integration: streaming output, prompt engineering, and reliable structured output with Zod.

The RAG section covers the full pipeline from document ingestion to production retrieval — including hybrid search, hallucination detection, and multi-tenant isolation. The Agents section is the heart of the book: from the ReAct loop through tool calling, browser automation, and multi-agent orchestration.

Part Five covers MCP — Anthropic's Model Context Protocol — from building your first server through publishing a reusable tool package to npm. Part Six covers multimodal AI (vision, speech, documents) and the production concerns you can't skip before going live: observability with LangFuse, rate limiting, prompt injection defense, and cost monitoring.

Who this is for:

TypeScript or JavaScript developers who want to build AI applications. You should be comfortable with async/await and basic Node.js. You don't need Python, and you don't need a machine learning background. This is not a research book — it's an engineering book.

If you've been watching AI development from the sidelines because the ecosystem felt like it belonged to Python developers, this book is your on-ramp.

---

**600+ pages. 24 chapters. All code in TypeScript.**

Author

About the Author

Kristin and Aaron

Kristin is a full-stack engineer with ten years of frontend development experience, currently working as a Senior AI Development Engineer at an AI startup, where she leads AI capability integration and architecture design.

Her career spans Vue, React, and Angular, with hands-on work in micro-frontend architecture, real-time communication, and data visualization across enterprise SaaS platforms and government projects, where she served as frontend lead and architect.

In recent years she has shifted her focus to AI engineering — exploring how to build real, production-grade AI applications using the toolchain TypeScript developers already know. That journey from frontend to full-stack AI is the origin of this book. She knows exactly where the barrier stands that stops so many frontend developers from entering this space, and she found a way through it.

---

Aaron is a full-stack architect and technical consultant with over ten years of engineering experience. He spent a decade at a multinational software company as a principal engineer and engineering manager, leading core module development for international-grade engineering software.

Since then, he has served as technical lead and senior architecture partner at several companies, with a long track record of delivering complex systems to production and taking AI content generation and full-stack products from prototype to real-world deployment.

He brings deep firsthand experience in turning complex technology into products that actually ship and helping clients get results on the ground. That is also the book's core conviction: AI development is not a research problem — it is an engineering problem. And engineering problems can be solved systematically.

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub