preface

preface

 

When we started building agents, the frameworks were a blessing. LangGraph, CrewAI, AutoGen, and many others made it possible to stand up a working agent in a handful of lines. But every time we tried to go deeper, either to understand why an agent behaved the way it did or to fix a failure that surfaced in production, we ended up reading through the framework’s source code. When we were inside, we kept noticing the same thing. Beneath every framework lies the same small set of ideas: message loops, tool calls, execution contexts, memory, planning, and collaboration. The names and defaults differ, but the patterns are shared.

That realization became the seed of this book. Rather than teach any single framework, we wanted to surface the patterns that sit underneath all of them so that readers could build their own agents from scratch and then, armed with that understanding, read any framework’s code as though it were their own.

Writing about a field this young has unique difficulties. The landscape kept shifting while we wrote. As the concepts and tooling matured and people’s attention widened, new terms emerged, and two ideas in particular reshaped the book as it came together. The first was context engineering. It grew from the realizations that an agent is really a loop of repeated LLM calls and that now that models are capable enough, an agent’s quality turns on how well you manage the input that flows through that loop.