How to Train your Chatbot - Full outline
We'll build 15 LLM-powered applications on all sorts of cool domains.
Hey! I just finished drafting the outline for the applications section of my upcoming book on using LLMs to build all sorts of cool stuff: How to Train your Chatbot.
I’m super excited about this book because we will spend a lot of time building some of the coolest applications you can imagine. Each will be a small but self-contained solution to a practical problem—or sometimes an esoteric but equally cool problem.
We will integrate LLMs in different roles in each app, from frontend chatbots that interact with the user to reasoning engines hidden in the backend.
Here is a short list of what we have in the plan.
In Chapter 8 - The Basic Chatbot we build our first LLM-powered application: a basic chatbot. We will learn how to set up a conversation loop and how to keep track of previous messages to simulate short-term memory for the bot. We will also learn how to stream messages for a better user experience (simulating a typing animation instead of waiting for the full response).
(This one is already published.)
Next up, in Chapter 9 - The PDF Bot we tackle our first augmented chatbot: a PDF question-answering system. We will build our own version of a vector store, and learn how to convert a large document into indexable chunks that can be retrieved at query time and injected into the bot prompt.
(This one is ready and comes out later this week.)
Leveling up a bit, in Chapter 10 - The Search Bot we build a search-powered chatbot that can browse the web and provide relevant answers with proper citations.
In Chapter 11 - The Data Analyst we start playing with chatbots that can execute code independently. We’ll build a simple data analyst that can answer questions from a CSV file by running Pandas queries and generating charts. We’ll learn how to decide whether a textual response or a code/chart is more appropriate and how to generate structured responses.
(These two are almost ready and come out in the next couple of weeks.)
Next, in Chapter 12 - The Terminal Bot we’ll take a quick detour from our standard UI to build a command-line bot that has access to your terminal and can run commands on it, so you’ll never have to google how to unzip a tar.gz file again.
Then, in Chapter 13 - The Shopping Bot we will build a more advanced code-execution bot. This time is a shopping helper that can search for items on behalf of the user, add them to the checkout cart, buy them, and track their delivery status—all based on a simulated online store. We’ll learn how to teach an LLM to call methods from an arbitrary API and write our own plugin system.
Jumping from code execution to more traditional text generation, in Chapter 14 - The Writing Assistant we’ll code a writing assistant that will help us create an article or text document in general. We’ll learn prompt techniques to summarize, outline, proofread, and edit textual content. We will also learn how to use an LLM to interactively modify a document, adding, modifying, or deleting arbitrary sections.
And then, building on top of that same workflow, in Chapter 15 - The Coding Assistant we build a coding assistant, who can interact with a codebase adding, modifying, refactoring, and deleting code and files.
Up to this point, all we have coded are chatbot-style applications. These are mainly conversational interfaces where the bulk of the interaction is a chat between a user and a model. In the next few chapters, we will distance ourselves from the classic chatbot style and start using LLMs as core components in other applications, where sometimes the end user won’t directly talk to the language model.
We continue with Chapter 16 - The Planner building a planning tool that can scan our emails, output a structured list of events, activities, and TODOs, and integrate them into our calendar.
Then, in Chapter 17 - The Feed Digest we’ll write a feed summarizer to create newsletter digests from a variety of sources, classifying and selecting the most relevant articles according to whatever criteria we desire.
Based on what we have so far, in Chapter 18 - The Journal we’ll build an interactive journal that will help you capture our day-to-day thoughts and reflections, summarize your achievements and goals, and provide guidance.
In Chapter 19 - The Graph Builder we’ll build an ontology learning tool that can create a knowledge graph from an arbitrary corpus of data, detecting entities and relations, and then ask questions about it. We will learn how to prompt an LLM for structured information extraction, and how to augment prompts with graph-like information.
Building on the previous functionality, in Chapter 20 - The Research Assistant we’ll build a research assistance tool that can create complete reports on an arbitrary topic by locating relevant articles, extracting information, summarizing key points, and constructing tables and graphics.
And then things will turn to weird and nerd side. In Chapter 21 - The Dungeon Master we will write a small but complete text-based fantasy game, using an LLM for everything from world and character design to dialogues and interactions. We’ll learn how to ground the LLM in an actual world model to avoid hallucinations and enable consistent gameplay.
Finally, in Chapter 22 - The Storyteller we will build a fully automated storyteller that can weave a consistent story with simulated characters who have goals and necessities, interact with each other, and learn by navigating a consistent world. These last two chapters are more towards pushing the boundary of what current language models can do, to give you a glimpse of the near future.
And that’s it! At least, that’s the plan for now. 15 applications of LLMs to the most varied problems, many of which could become the Product Hunt product of the day if you take them to completion.
If they sound a bit like science fiction, well, in part it is! LLMs are super powerful—albeit full of limitations—and we’re just discovering the extent of their capabilities. But rest assured, I work with LLMs all day and I’ve built dozens of applications using the concepts and techniques we’ll leverage in these chapters.
If this sounds exciting to you, there are two ways you can get your hands on it. First, all the drafts will be published first as free articles in this blog.
But if you want the final, polished version, as well as full access to the source code so you can build your own version on top, and a private space where you can ask questions and get feedback from me, secure your early access copy to How to Train your Chatbot while it’s 50% off!