Leanpub Header

Skip to main content

From Reactive Agents to Proactive AI

Why Heartbeat Architectures Matter

From Reactive Agents to Proactive AI

Build AI agents that wake up, detect problems, and take action without waiting for a prompt. Through illustrated architectures, six practical use cases, and a runnable Python project, learn how heartbeat systems turn autonomous behavior into reliable automation and how to build a business around it.

Minimum price

$27.90

$29.80

You pay

Author earns

$

Also available for 2 book credits with a Reader Membership

PDF
EPUB
WEB
APP
About

About

About the Book

What if your AI agent could recognize that work needs doing before anyone asks?

From Reactive Agents to Proactive AI: Why Heartbeat Architectures Matter is a practical, illustrated guide for software engineers who want to build autonomous agents that automate recurring work and create measurable business value.

At the center is the heartbeat: a recurring opportunity for an agent to observe its environment, evaluate what has changed, act within defined permissions, and verify the result. You’ll learn how to combine this pattern with event-driven systems, durable workflows, memory, and human oversight.

Through a fictional commerce platform and concrete engineering examples, the book explores six applications: incident response, software maintenance, cloud cost optimization, security operations, data quality, and business performance monitoring.

Inside, you’ll learn how to:

  • Design the control plane that coordinates scheduling, context, decisions, tools, and verification.
  • Handle retries, duplicate actions, stale evidence, and uncertain outcomes.
  • Enforce permissions, approval requirements, tenant boundaries, and spending limits.
  • Build a working heartbeat agent with a runnable Python lab and behavioral tests.
  • Evaluate automation opportunities, measure operating costs, and shape a paid product around customer value.

With architecture diagrams, illustrated scenarios, and practical worksheets, this book connects implementation choices to the economics of running an autonomous service.

Written for engineers who understand APIs and backend systems, it offers a path from an agent prototype to a dependable service customers have a reason to pay for.

Author

About the Author

Geison Goes

Geison Felipe Góes Flores is a technical author focused on the principles behind correct, auditable, and resilient financial systems. He wrote Fundamentals of Software Engineering for Fintechs to help professionals understand what happens beneath balances, transfers, payment confirmations, and financial APIs.

His work connects software architecture, distributed systems, accounting concepts, payment operations, reconciliation, security, observability, and invariant-driven testing. Rather than prescribing a single technology stack, Geison presents practical models for identifying where money or financial facts could be duplicated, lost, delayed, corrupted, or accepted without sufficient evidence.

Throughout the book, he transforms complex financial rules into mechanisms engineering teams can implement and verify: balanced ledger entries, explicit state machines, idempotency contracts, immutable histories, reconciliation procedures, audit trails, risk-oriented metrics, and controlled recovery paths.

Geison’s central belief is that trust is not merely a feature presented through an interface—it is a technical property earned through every modeling, architecture, implementation, and operational decision.

“A trustworthy financial system must be able to explain not only what happened, but why it happened and how its correctness can be demonstrated.”

With practical examples, pseudocode, SQL, checklists, exercises, and architecture review frameworks, Geison helps engineers, architects, technical leaders, and fintech teams turn financial complexity into systems they can understand, operate, and trust.

Contents

Table of Contents

From Reactive Agents to Proactive AI

  1. Why Heartbeat Architectures Matter
  2. The promise of this book
  3. Preface: the question nobody asked
  4. How to read and build
  5. A note on attractive systems

1. Bounded Autonomy

  1. Four capabilities, one operating contract
  2. Proactivity is not exclusive to a timer
  3. The value of doing nothing
  4. Where a model earns its place
  5. A first autonomy ladder
  6. Build decision: define the envelope first

2. The AI Control Plane

  1. The component map
  2. Architecture A: the scheduled investigator
  3. Architecture B: events plus reconciliation
  4. Architecture C: durable workflow with human decisions
  5. Architecture D: specialist workers
  6. State is part of the interface
  7. Build decision: choose the smallest architecture that preserves state

3. Time, Context, and Memory

  1. Choose cadence from the problem
  2. Scheduling is not exclusive ownership
  3. An evidence envelope
  4. Context is a retrieval problem
  5. Memory has several jobs
  6. Forgetting and quiet operation
  7. Build decision: make time testable

4. Planning Under Authority

  1. Investigate with competing hypotheses
  2. Turn prose into a proposal
  3. Risk tiers as a conversation with the owner
  4. Enforce budgets outside the prompt
  5. Idempotency is about effects
  6. Verification and compensation
  7. The trust boundary around a model
  8. Build decision: review one action end to end

5. The Incident That Nobody Prompted

  1. Observe symptoms before explanations
  2. A sequence that narrows uncertainty
  3. Decide what the agent may do
  4. Verify recovery without declaring causality too soon
  5. Four neighboring incidents
  6. Product opportunity and measurement
  7. Build exercise: replay the night shift

6. The Repository That Maintains Itself

  1. Begin with the maintenance inbox
  2. Walk one vulnerability to a reviewable change
  3. Code execution is a trust boundary
  4. Tests are evidence with limits
  5. The review packet is the product
  6. Product opportunity and economics
  7. Build exercise: construct a safe repair lane

7. Cloud Capacity With a Business Case

  1. Look for waste systematically
  2. Build a capacity envelope
  3. Separate estimated and realized savings
  4. Apply changes in stages
  5. Portfolio management for recommendations
  6. Product opportunity and trust
  7. Build exercise: challenge the cheapest plan

8. Security Without Unbounded Power

  1. Build the security picture
  2. Design containment before an incident
  3. Rotation is a workflow
  4. Protect the operator from the evidence
  5. Fail closed without becoming blind
  6. Product opportunity and evaluation
  7. Build exercise: the suspicious login that was legitimate

9. Data That Arrives Correctly

  1. Monitor the contract, not only the job
  2. Trace the failure upstream
  3. Retrying safely means understanding side effects
  4. Publication is an action
  5. Schema evolution and semantic drift
  6. Privacy and query boundaries
  7. Product opportunity and measurement
  8. Build exercise: recover a missing partition

10. Investigating Business Drift

  1. Define the denominator
  2. Segment before proposing a cause
  3. Correlation guides investigation
  4. Choose interventions that match authority
  5. The other business signals
  6. Estimate value without inventing revenue
  7. Product opportunity and build exercise

11. Build a Heartbeat Agent

  1. Run the first cycle
  2. Read the modules as boundaries
  3. Understand two identities
  4. Exercise approval
  5. Reproduce the dangerous timeout
  6. Read failure as a first-class result
  7. Move toward production in explicit steps
  8. Build exercise: replace one boundary

12. From Reliable Operator to Paid Product

  1. Choose a narrow first market
  2. Compare the six opportunities
  3. Run a pilot with a stopping rule
  4. Evaluate the whole loop
  5. Observe the observer
  6. Calculate the cost of always being awake
  7. Unit economics without wishful arithmetic
  8. Price the outcome and constrain the workload
  9. A practical 90-day path
  10. Build decision: sell one result you can defend

Conclusion: The Quiet Operator

Appendix A. The Operator Design Workbook

  1. Worksheet 1: the operating envelope
  2. Worksheet 2: the action contract
  3. Worksheet 3: the evidence ledger
  4. Worksheet 4: evaluation cases
  5. Worksheet 5: customer value and delivery cost
  6. Worksheet 6: the launch decision

Appendix B. A Working Vocabulary

Appendix C. Sources and Further Reading

  1. Publishing references
  2. About this edition

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub