- Preface
- Chapter 1: From Components to Agents
- Technical requirements
- What we mean by "agent"
- Meet Huddle
- Why Angular and Genkit
- The architecture in one picture
- One request, end to end
- Two ideas the whole book leans on
- Running it
- How the book is organised
- Summary
- Questions
- Further reading
- Chapter 2: Your First Flows
- Technical requirements
- A model call is a function
- Describe the answer you want
- What the model actually sees
- From text to a typed value
- Prompts as files
- The offline model
- Testing a flow without a model
- A checklist for a model call
- Summary
- Questions
- Further reading
- Chapter 3: Connecting Angular to Genkit
- Technical requirements
- Why a stream
- The contract first
- The route
- Writing a stream
- Reading a stream in the browser
- When something goes wrong
- One origin
- Testing the wire
- What Genkit offers here, and what we did not use
- A checklist for the wire
- Summary
- Questions
- Further reading
- Chapter 4: Streaming Chat UI with Signals
- Technical requirements
- A conversation is a list of messages made of blocks
- Why nothing is ever changed in place
- The reducer: events in, conversation out
- The service: signals around the pure core
- One path for live and restored
- Zoneless Angular and effects
- The template
- Accessibility, briefly
- What is tested, and what is not
- A checklist for a streaming interface
- Summary
- Questions
- Further reading
- Chapter 5: Tools
- Technical requirements
- What a tool is
- Your first tool
- The schema is a fence, and it has gaps
- Rules belong in code, not in the prompt
- Tools act as someone
- Showing the work
- Tools that talk to the UI
- Return errors, or throw them?
- Testing tools
- A checklist for a new tool
- Summary
- Questions
- Further reading
- Chapter 6: Memory and RAG
- Technical requirements
- Three kinds of memory
- Saving a conversation
- Load, change, save
- What the model sees: history
- The log, and what it costs
- A conversation that survives a restart
- Knowledge: finding the right passage
- Does it work? Measure
- Citations
- A checklist for memory
- Summary
- Questions
- Further reading
- Chapter 7: Agent Patterns
- Technical requirements
- Why write the steps down
- A planner that proposes
- Routing: a different plan for a different request
- Following the plan
- Reflection: checking your own work
- Making it visible
- What planning costs
- Evaluating plans
- Limits
- A checklist for planning and reflection
- Summary
- Questions
- Further reading
- Chapter 8: Generative UI
- Technical requirements
- Three ways to get UI out of a model
- The contract: four things the agent can draw
- Tools that build the UI
- The registry: one place that maps a name to a component
- Components that only show text
- Validating what arrives
- The day timeline: a component with arithmetic in it
- Reloading a page full of UI
- Limits
- A checklist for generative UI
- Summary
- Questions
- Further reading
- Chapter 9: Human-in-the-Loop
- Technical requirements
- Why a person, and where
- How Genkit pauses a tool
- From interrupt to card
- Holding the pause
- Deciding, and deciding once
- What an approval can change
- The card on the page
- Cancelling is the same, with a different front door
- Limits
- A checklist for approvals
- Summary
- Questions
- Further reading
- Chapter 10: Multi-Agent Systems
- Technical requirements
- What a specialist is
- Running a specialist
- The supervisor and its delegation tools
- Parallel, but only where the work is independent
- When a specialist fails
- What the team costs
- Trust between agents
- Limits
- A checklist for a team of agents
- Summary
- Questions
- Further reading
- Chapter 11: Ship It
- Technical requirements
- What "ready" has to mean
- Evaluating the agent
- Do the evaluators work?
- Rate limiting
- Validating what comes in
- Logs that cannot leak
- Configuration that refuses to be wrong
- Running and stopping it
- Packaging and the pipeline
- What this does not cover
- A checklist before you put an agent in front of people
- Summary
- Questions
- Further reading
- Appendix A: Running Huddle
- Getting the code
- Requirements
- Get it running
- Test, evaluate, build
- Run the production build without Docker
- Configuration
- Repository map
- Appendix B: Reference
- The event contract
- HTTP routes
- Tools
- Evaluators
- Measured facts quoted in the book
- Index
Building Agentic Applications Using Angular and Genkit
Design, build, test and ship an AI agent with a streaming Angular front end, Genkit tools, memory, approvals and evaluation
A language model is fluent and sometimes wrong. Your calendar, your customers and your budget are not allowed to be. Build one complete agent, a meeting-room booking assistant with an Angular front end and a Genkit back end, and learn what to put between the two.
Minimum price
$8.00
$10.00
You pay
Author earns
Buying multiple copies for your team? See below for a discount!
About
About the Book
Build a complete AI agent with a streaming Angular front end and a Genkit back end: tools, memory, retrieval with citations, planning, human approval, multi-agent delegation, evaluation and deployment. One working application, explained chapter by chapter, with every code listing checked against the repository.
What you will learn
- Define an agent's contract once in Zod and share it between the server and the Angular page
- Stream typed events over fetch and fold them into signal state with a pure, testable reducer
- Write Genkit tools that act as a particular user, keep rules in code and return errors the model can use
- Save conversations so they survive restarts, trim history safely, and answer questions from a document with citations
- Add planning and self-checking, and measure what they cost in model calls and tokens
- Let an agent answer with Angular components without ever letting a model write markup
- Pause a tool call for human approval, resume it exactly once, and limit what an approver can change
- Split work across specialist agents, and decide whether the team is worth its cost
- Evaluate the agent with Genkit evaluators, break it on purpose, then rate-limit, validate, log and deploy it.
Who this book is for
Web developers who have built something in Angular and now need to add an agent to a product, and back-end TypeScript developers who want to know what the front end of an agent has to do. You should be comfortable with TypeScript. No API key is required: the example application includes an offline scripted model, so every chapter runs on a laptop and every test is deterministic.
Team Discounts
Team Discounts
Get a team discount on this book!
Up to 3 members
- Minimum price
- $27.00
- Suggested price
- $35.00
Up to 5 members
- Minimum price
- $44.00
- Suggested price
- $56.00
Up to 10 members
- Minimum price
- $77.00
- Suggested price
- $98.00
Up to 15 members
- Minimum price
- $110
- Suggested price
- $140
Up to 25 members
- Minimum price
- $165
- Suggested price
- $210
Bundle
Bundles that include this book
Master Frontend bundle

23 Books
- Pricing
$250
Minimum priceBought separately$299Suggested price$300
Author
About the Author
Sandeep Kumar Patel is a senior web developer with more than 17 years of experience building web applications in object-oriented JavaScript and JSON. In 2012 he founded tutorialsavvy, a programming blog that developers have been reading ever since.
He is GATE-2005 Information Technology (IT) qualified and holds a Master's degree from VIT University, Vellore.
Contents
Table of Contents
Get the free sample chapters
Click the buttons to get the free sample in PDF or EPUB, or read the sample online here
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.)
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.