๐Ÿค– API Patterns & Practices: APIs for Agents & LLMs
Home Chapters Examples Diagrams Bibliography GitHub โ†—
Home / Build: asynchronous APIs
Part 3 5 chapters

Build: asynchronous APIs

Build the event-driven surface: waking an agent on a Kafka event, coordinating several agents, and gating the ones that need a human.

Chapter 17

Event-Triggered Agent Wakeup

A Kafka event wakes an agent to act on its own schedule, instead of the agent polling an endpoint to find out whether anything changed.

20 minutesRead โ†’
Chapter 18

Multi-Agent Choreography

Several agents coordinate through events on a shared topic, each reacting to what the others produced, instead of one agent orchestrating every step directly.

20 minutesRead โ†’
Chapter 19

Human-in-the-Loop Gate

An explicit gate holds an irreversible action for human approval, with the mechanism chosen to match how long that approval might take.

25 minutesRead โ†’
Chapter 20

Long-Running Agent Workflow

A long-running workflow with compensating steps carries an agent-triggered process safely across minutes or days, not just one request.

25 minutesRead โ†’
Chapter 21

Replayable Agent Memory / Event-Sourced Audit

An event-sourced log gives an agent a replayable memory of what happened, and a human an audit trail of what the agent did.

20 minutesRead โ†’
โ† Previous part Build: MCP packaging Next part โ†’ Consume

API Patterns & Practices: APIs for Agents & LLMs

A pattern catalog for building APIs that AI agents and LLMs consume: REST and GraphQL as MCP tools, event-driven agent wakeups on Kafka, and the identity, traffic and observability guardrails a production agent-facing surface needs. Built on Quarkus, Apache Camel and Kafka; every pattern states a stack-neutral contract that transfers to Python/FastAPI and Strawberry GraphQL.

References

  • Model Context Protocol โ†—
  • Quarkus โ†—
  • Apache Camel โ†—
  • Apache Kafka โ†—
  • Quarkus LangChain4j โ†—

Project

  • View on GitHub โ†—
  • Issues โ†—
  • patterncatalyst โ†—
Open source ยท Apache 2.0 (code), CC BY 4.0 (prose) Last built 2026-11-21