Book + Workbook

Roll Your Own AI Assistant: Book + Workbook

Build a self-hosted personal assistant: notes, calendar, todos, memory with semantic search, and news and weather feeds, with a tool-calling assistant loop over all of them. The code is free and MIT licensed. This is the book that explains why it is built that way.

Backed by a 30-day money-back guarantee, though you can evaluate the whole system before paying anything: clone the repository, run make test, and 61 tests pass offline with no API key and no model.

Be the first to review this

Cover of Roll Your Own AI Assistant: a constellation-brain above a snowy
                  mountain under an aurora, with the subtitle Book plus Workbook and the
                  author name Roger Jenkins.

What it is

A personal information manager you run yourself

Notes, calendar, todos, documents and feeds normally live in separate apps that cannot see each other. This builds them as one system, on your machine, with an assistant that can read and act across all of them.

Data is stored in plain SQLite files. The AI is reached through one small interface, so the provider is a configuration choice.

All of that code is free, MIT licensed, and public at github.com/rogjenkins/ryoaa. Clone it and run the tests before you decide anything. The book is the part that explains the design chapter by chapter: why the backend is a protocol rather than a conditional, why the assistant loop avoids vendor tool schemas, and what breaks when you change either.

Backends

Three options, selected by one environment variable

All three implement the same two interfaces, so no module knows which is in use. A health check endpoint probes the configured backend and reports whether it is reachable and whether the model is present.

ollama

Runs on your own hardware. No API key, no per-token cost, and no request leaves the machine.

ollama-cloud

Large open models hosted by Ollama, billed by usage. Needs an API key; needs no local GPU.

anthropic

Hosted Claude models, billed per token. Needs an API key; needs no local hardware.

Contents

What is in the download

Part 1: the book

12 chapters and 3 appendices, in PDF and EPUB.

  • The architecture of a personal information platform.
  • The core chapter: a pluggable LLM backend, from first principles.
  • Storage and retrieval-augmented generation with nothing but SQLite.
  • A module per capability: memory, notes, calendar, todos, feeds.
  • A tool-calling assistant loop that works on any backend.
  • Prompt recipes, troubleshooting, and a glossary.

Part 2: the customization workbook

Guided exercises, not in the public repository.

  • From a config tweak to a whole new module of your own.
  • Each module wired into the assistant loop and covered by its own tests.
  • The reasoning behind each exercise, not just the steps.
  • A versioned snapshot of the code, so the exact build the book describes stays with you as the repository moves on.

The code itself is not part of the purchase. It is free and MIT licensed at github.com/rogjenkins/ryoaa: every module, the assistant loop, and 61 tests that pass offline. Nothing is held back from it.

  • 58 pages
  • 12 chapters, 3 appendices
  • PDF and EPUB
  • Python 3.12+
  • 61 offline tests
  • Code is MIT and free

Design decisions

How it is built, and why

SQLite is the source of truth

Every durable record is a row in a local SQLite file. Backup is copying a directory; embeddings are derived data and can be rebuilt.

The AI sits behind two interfaces

Modules call get_llm() and get_embedder(). No module imports a vendor SDK, so changing provider changes no application code.

Adapted from a production system

The architecture is a single-machine version of an inference platform in daily use, with the GPU cluster and multi-node parts removed.

One file per capability

Each module is a single readable file with its own database. Deleting one breaks nothing else. Four of the twelve chapters cover extending the system.

Audience

Who this is for

Developers comfortable in a terminal: cloning a repo, creating a virtualenv, editing a config file, running make. No AI or machine-learning background is assumed.

Not suitable if you want a finished application to install rather than code to read and modify.

Questions

Common questions

The code is free. Why would I pay for this?

Because the code is the easy half. Anyone can read 2,900 lines of Python; far fewer can say why it is shaped that way, what the alternatives cost, and which parts are safe to tear out. The book is twelve chapters of that reasoning, plus a workbook of exercises that is not in the repository. If you clone the repo and never buy anything, that is a fine outcome and the code stays MIT forever.

Do I need an API key?

Only for the hosted paths: Claude, or Ollama Cloud. The local path needs no key at all, and a built-in demo mode runs with no key, no Ollama and no network, so you can try the whole system before choosing anything.

Do I need a GPU?

No. The hosted paths need no hardware at all, and Ollama Cloud exists so you can run a large open model without owning one. Running locally, a capable CPU handles small models and a GPU helps with larger ones.

What language is the code?

Python 3.12 or newer, with minimal dependencies (httpx, FastAPI, uvicorn, pydantic), all MIT, BSD or Apache licensed.

Is it really self-hosted?

Yes. On the local backend nothing leaves your machine except keyless news and weather requests.

Will it stay updated?

The design is provider-agnostic on purpose. Swapping in a new model is a config change, so it does not go stale when models change. The book also shows you where to look up current model names, because those expire.

The book and the workbook

PDF and EPUB, the customization workbook, and a versioned snapshot of the code. Free updates for buyers. The code itself stays free for everyone.

30-day money-back guarantee.