mattone
dopo mattoneTHE BOOK SERIES
IT/EN
Cover of Building an Agentic AI, Brick by Brick
← The books in the series

SWIFT · JARVIS · VELIA

Building an Agentic AI, Brick by Brick

A real experience, from the idea to the first executable loop.

Velia is the assistant I am building in the Jarvis project. The book follows the questions and decisions behind that work: how to distinguish a model from a system that uses tools, how to divide responsibilities in code, and how to check that a result belongs to the work in progress.

FIRST COLLECTION · ENGLISH PDF

Introduction and chapters 1–8

· 107 pages · PDF 6.1 MB

A reading draft of a book in progress. Further releases will extend the journey; this collection reaches the first loop with local tools and prepared responses.

Download the first part ↓

The book and laboratory instructions are in English. Executable identifiers and fixture strings retain their original spelling.

Go to the five Swift laboratories ↓

THE JOURNEY IN THIS RELEASE

Understand, then build and check.

The introduction retains the personal journey and scientific foundations behind the book, connecting them to Velia. The opening chapters clarify what we want to achieve; the following chapters bring separate components, conversation state, streamed responses and controlled tool use into Swift.

  1. 01

    What I wanted from Velia

  2. 02

    A model, a conversation, an agentic system

  3. 03

    Developing Velia with the help of AI

  4. 04

    Preparing a reproducible experiment

  5. 05

    From the project to its components

  6. 06

    Concurrency, the interface and state ownership

  7. 07

    Connecting a model and reading a streamed response

  8. 08

    Velia's first executable loop

The collection also includes figures, exercises, explained solutions and a glossary. Memory, tools and skills — reusable instructions for a task — belong to the wider journey; future releases will develop their mechanisms as Velia evolves.

FROM THE BOOK TO THE TERMINAL

Five experiments to reproduce.

The laboratories for chapters 4–8 isolate one problem at a time. They use small documents and prepared responses so you can observe the same behaviour and change its conditions. You need macOS, Python 3.10 or later, Swift 6 and Swift Package Manager, the tool that builds Swift modules.

No credentials, paid model or Jarvis application are required. These experiments check the mechanisms described; they do not measure model quality or the reliability of the complete Velia system.

Download the five laboratories · ZIP ↓

67 KB · Swift sources, instructions and prepared inputs

CHAPTER 4

Checking sources

Check identities, revisions and quoted passages, and see why an existing quotation does not prove a statement true.

python3 run.py --chapter 4

CHAPTER 5

Separating components

Split contracts, core logic and the program into three modules, then replace in-memory reading with file reading.

python3 run.py --chapter 5

CHAPTER 6

Protecting chat state

Handle late responses and interruptions without delivering the result to the wrong conversation.

python3 run.py --chapter 6

CHAPTER 7

Reading a streamed response

Reconstruct events from small byte chunks and distinguish a draft from a valid completion.

python3 run.py --chapter 7

CHAPTER 8

Closing the first loop

Receive a prepared read request, validate it, read a local source and return the observation to the loop.

python3 run.py --chapter 8

The book grows with the project.

The book builds the technical journey; the journal follows individual stages of Velia’s development. You can follow both, distinguishing the educational experiments from capabilities still being built into the product.

Follow Velia in the Lab →

For the foundations of language models, you can also read Understanding LLMs; for AI-assisted software development, From Prompt to Software.