Principles of Building AI Agents book [pdf]
Hi, I’m Sam, the cofounder/CEO of Mastra, the Typescript agent framework. I wrote a book on building agents and wanted to share it with HN. The book is called Principles of Building AI Agents. Right now it has 34 chapters and 148 pages covering LLMs, prompting, agents, workflows, RAG, evals, multi-agent, tracing, deployment, MCP, tool use, and a few other topics. The backstory here is that last October when we started working on Mastra we knew very little about AI engineering, and had to learn as we were building. In January, we started going to local AI meetups. We met a lot of people…
What it does
In the maker’s words, at launch
Hi, I’m Sam, the cofounder/CEO of Mastra, the Typescript agent framework. I wrote a book on building agents and wanted to share it with HN. The book is called Principles of Building AI Agents. Right now it has 34 chapters and 148 pages covering LLMs, prompting, agents, workflows, RAG, evals, multi-agent, tracing, deployment, MCP, tool use, and a few other topics. The backstory here is that last October when we started working on Mastra we knew very little about AI engineering, and had to learn as we were building. In January, we started going to local AI meetups. We met a lot of people who were where we’d been. Somehow, we turned from students to teachers. Whenever an explanation seemed to stick we’d go home and put it in our docs or blog. One day my cofounder Shane turned to me and was like, what if you wrote a book on this stuff? I was initially skeptical, but I tried writing an outline and it was pretty natural. So I spent the next couple weekends trying to hammer our posts into book form, and fill in the gaps. Surprisingly it worked. The initial version was 92 pages, in 27 very short chapters. We were going to call it Principles of AI Engineering but a founder author friend convinced me to use the word Agents instead, so Principles of Building AI Agents it was. The first reaction we got was surprise. We handed it out at the same meetups we’d gone to earlier. We started seeing people post book reviews on social media. A couple founder friends told us the book changed their agent architecture or their interface design. An engineer turned videographer came to our office and shot a mini-documentary. People asked us a lot how we’d keep the book up to date. We didn’t really know. Then MCP and Studio Ghibli happened, and we knew we needed to update it. I sat down in May to write for another weekend. I ended up with another 50 pages. In addition to MCP and image gen, there was a lot of stuff to write about web browsing, workflow streaming, code gen, agentic RAG. We republished the book as the 2nd edition. The single thing that people comment on the most is a page where I give a partial excerpt from the leaked Bolt.new system prompt. It’s the first time many people have read a production-grade prompt. The book has become pretty popular recently. We've given out thousands of copies at AI meetups and conferences, and it's even gone viral on LinkedIn (of all places). In terms of actual mechanics, I wrote the book in Notion, then pasted it into a desktop app called Vellum, which spits out ePubs and PDFs. Amazon’s KDP lets you upload those and publish your book (they’ll print it for you). Having a nice CI/CD helped, as did having docs and blog posts as sort of intermediate artifacts in a content pipeline. It meant that when I was writing I could pull from a warm cache. The process felt O(n) rather than O(n log n). Enjoy reading, and please let me know what you think! (You probably just want to download the book and read it in your favorite reader, rather than use Github's PDF reader) I’ll be starting on a third edition soon, and I want to know what topics feel like they’re missing, if anything feels outdated, and so on.
Does the same job
all alternatives →- NONous – Open-Source Agent Framework with Autonomous, SWE Agents, WebUI2024 · github.com · ▲155
Hello HN! The day has finally come to stop adding features and start sharing what I've been building the last 5-6 months. It's a bit of CrewAI, OpenDevon, LangFuse/Cloud all in one, providing devs who prefer TypeScript an integrated framework thats provides a lot out of the box to start experimenting and building agents with. It started after peeking at the LangChain docs a few times and never liking the example code. I began experimenting with automating a simple Jira request from the engineering team to add an index to one of our Google Spanner databases (for context I'm the…


- GAGeniusrise, an open source framework and ecosystem for AI agents2023 · github.com · ▲9
Hello! Introducing geniusrise, an agent framework and component ecosystem for building AI agent networks that are as flexible as your team. landing page: https://geniusrise.ai (fancy but useless) docs: https://docs.geniusrise.ai (please check this out) github: https://github.com/geniusrise (for dear devs) ## Thought process Since the ChatGPT disruption, I've been pondering on what the tooling layer is going to look like for building LLM-interfacing agents. Saw a plethora of tools coming out as we witness here every week. I'd broadly categorize them into the…
- RARemy, an AI agent that compiles annotated Markdown into full-stack appsApr 2026 · remy.msagent.ai · ▲5
Hi HN! Sean from MindStudio here. I wanted to share something we've been working on that I think introduces some new ideas into the "AI coding agent" space. Remy is an AI agent that builds full-stack TypeScript apps from a spec written in a new flavor of annotated markdown. The spec has two layers: prose describing what the app does, and annotations that carry the technical precision (data types, edge cases, validation rules, code snippets). The agent then "compiles" this into code: backend methods, typed schemas, frontends, test scenarios, and everything else are derived artifacts of the…
- IPI published 100 AI generated books on Amazon2020 · ▲20
To be specific, the content is generated by a GPT-2 based model. https://amzn.to/2TCc0v2 Let me know if you have any questions :-)
More ai this month
the category →
I trained a 125M-parameter transformer to autocomplete piano performances in real time (~108 notes/sec on an iPhone 15). The idea is basically GitHub Copilot or Tabnine, except instead of prompting it with code, you prompt it by playing a few notes on a MIDI piano. The model then continues what you played, entirely on-device. The app is free if anyone wants to try it. Happy to answer questions about the model, training, Core ML, or the many things that didn't work.
AI · 17d ago · simedw.com
Astute▲585Automate your B2B brand going viral, with new media creators
AI · 18d ago · company-app.joinastute.com


Hey HN, Henry from Cactus here! We previously released Cactus Needle, a 14MB agentic LLM for tool call, device use, and structured extraction for phones, wearables, smart homes, small robots and microcontrollers. We got really great feedback here, and have now incorporated the suggestions to release Needle 2. The whole model is a single 14MB binary that runs a full session in 28MB of RAM; 45m parameters at 2bit compression. Needle hits 500 tokens/sec decode speed on a Raspberry Pi 5, sits between 400-1,500 tokens/sec on VR devices like Meta Quest 3S and Apple Vision Pro, and ranges…
AI · 27d ago · cactuscompute.com


Launched alongside, August 2025
the whole month →
- IS
I built the world's most impractical 1000-pixel display and anyone in the world can draw on it. It draws a single pixel at a time and takes 30-60 minutes to complete a single image. Anyone can participate in the project by voting for the next image to be drawn, and submitting images. https://kilopx.com/
Work · 2025 · benholmen.com

- KT
Kitten TTS is an open-source series of tiny and expressive text-to-speech models for on-device applications. We are excited to launch a preview of our smallest model, which is less than 25 MB. This model has 15M parameters. This release supports English text-to-speech applications in eight voices: four male and four female. The model is quantized to int8 + fp16, and it uses onnx for runtime. The model is designed to run literally anywhere eg. raspberry pi, low-end smartphones, wearables, browsers etc. No GPU required! We're releasing this to give early users a sense of the latency and voices…
Dev tools · 2025 · github.com
- IW
I was wondering how I can arrange objects along a spherical helix path, and read some articles on it. I ended up learning about parametric equations again, and make this visualization to document what I learned: https://visualrambling.space/moving-objects-in-3d/ feel free to visit and let me know what you think!
Life & fun · 2025 · visualrambling.space
- TC
For HTML Day 2025 [1], I made a web service that displays the current sky at your approximate location as a CSS gradient. Colours are simulated on-demand using atmospheric absorption and scattering coefficients. Updates every minute, without the use of client-side JavaScript. Source code and additional information is available on GitHub: https://github.com/dnlzro/horizon [1] https://html.energy/html-day/2025/index.html
Dev tools · 2025 · sky.dlazaro.ca