HeadlinesBriefing favicon HeadlinesBriefing.com

Replacing a 15-Minute Booking Process with a LangGraph AI Agent

Towards Data Science •
×

A customer booking a couch cleaning quote through a cleaning company took 15 minutes, involving back-and-forth about size, material, address, and scheduling. This motivated building a stateful AI agent using Python, LangGraph, and LangChain to automate the process. The agent handles everything a customer-service rep does: understanding needs, calculating prices, managing acceptance or rejection, proposing time slots, and confirming appointments.

Unlike a rigid quotation tool, the agent processes natural queries like "I need cleaning for my 2 bedroom apartment" and extracts all details in one go, proceeding directly to quoting when information is complete. The agent's structure uses a Booking Details schema with optional fields for service type, size, depth, add-ons, and address, plus a conditional routing system that decides whether to gather more info or proceed to pricing. LangGraph manages shared state across multiple customer messages, with nodes for information gathering, price calculation, and booking confirmation connected by conditional edges.

For observability, Langfuse is integrated to trace, monitor, and debug the agent, providing full visibility into every step of the workflow. The source code is available on GitHub.