Build Your Own AI

Welcome to Build Your Own AI! In this book, you will learn how to create your own AI applications using simple, real-world examples. The idea for this book came while I was working on a project to build an AI for PURISTA. The use cases in this book are based on real experiences, but the focus is on building a custom chatbot and understanding the techniques behind it. This book is not about the PURISTA framework itself; instead, it shows how to build your own AI application.

This book will guide you step-by-step through different use cases, with the goal of giving you the knowledge to build your own chatbots. Being a developer, I understand the challenges that other developers face, and I wrote this book to help you create your own AI applications.

Together, we will look at different ways to solve specific problems, like designing good prompts, managing large datasets, and connecting AI models to existing applications. We will learn which solutions work best for each situation and why some methods work better than others. This hands-on approach will help you gain the skills and knowledge needed to create your own AI projects.

What You'll Learn

In this book, we'll cover the following topics in a practical way:

  • The Basics:
    • Gaining a basic understanding of how large language models work
    • Running models locally
    • Interacting with large language models
  • Knowledge Handling:
    • Extracting knowledge
    • Providing knowledge using different strategies
  • Enabling AI Interaction with the Environment:
    • Generating JSON responses
    • Function and tool calling
  • Handling Conversation Histories
  • Building AI Agents

This book does not focus on one provider, language, or framework. This way, you can use what you learn in different situations. We will use free models to learn how to build real-world AI applications. By the end of the book, you will understand how to work with large language models, no matter which model, provider, or programming language you use.

All the source code for this book is available on GitHub: github.com/buildownai. Feel free to star the repository and explore my other projects—you might find some useful tools there!

The Big Goal

By the end of this book, you will have the skills to build stable and reliable AI applications. By working through practical examples, you will feel confident to bring your ideas to life.

Technical Requirements

Python is often used for AI and machine learning, but in this book, I will use TypeScript without any special framework. This way, the examples are easier to follow for developers using different programming languages or tools.

To follow the examples in this book, you'll need:

  • A code editor like VSCode, Zed, or any similar tool
  • Bun installed on your machine
  • A web browser
  • Docker

Your computer should be as powerful as possible. Running large language models locally works best with a powerful GPU (like an NVIDIA RTX 3080 or better) and at least 16 GB of RAM. For better performance, 32 GB or more is recommended. Additionally, be prepared to allocate several gigabytes of disk space for the models.

We will use Bun as our runtime and package manager because it starts faster and performs better than Node.js. This makes it a good choice for our examples. We'll also use Biome for linting and code style. Additionally, we'll leverage other excellent tools such as SurrealDB and Hono throughout the book.

Grab the book from my store!

Buy Now
Artificial Brain