A recent experience with a cleaning company sparked an idea: their 15-minute booking process—requiring back-and-forth messages about couch size, material, photos, and address-dependent pricing—was ripe for automation. After a second round of queries about apartment cleaning, I realized this was a perfect use case for an AI agent.
In this article, I’ll walk through building such an agent using Python, LangGraph, and LangChain. We’ll create a demo that handles the full booking flow and integrates Langfuse for observability. The result isn’t just faster—it’s a 24/7 digital employee ready for production.
This isn’t a simple chatbot. It’s a stateful agent that combines conversational intelligence with deterministic business rules to manage a multi-step process end-to-end.
The complete source code is available on GitHub at customer-service-agent. Feel free to clone it and test it yourself. By 2026, such agents are becoming standard for service businesses, and this example shows why.
What Does This Agent Do?
The agent replicates everything a human customer-service representative does:
- Responds to customer queries and understands needs
- Calculates service prices and communicates them clearly
- Manages customer acceptance or rejection of quotes
- Proposes optimized appointment time slots
- Confirms and records bookings
Why an AI Agent Instead of a Form?
A traditional quotation tool could ask a fixed set of questions and auto-schedule once approved. That works, but it forces every customer through the same rigid path—frustrating for those who want to provide details upfront.
An AI agent offers a natural, flexible alternative. For example, a customer might write:
"Hey! I need a cleaning service for my 2-bedroom apartment at this address. I also want you to clean inside my refrigerator. I’m available Tuesday and Wednesday."
That single message contains all necessary information—size, address, extra service, and availability. The agent recognizes this and skips straight to calculating and presenting a quote, no redundant forms needed.
The agent also orchestrates subsequent steps: price computation, handling the customer's decision, searching for optimal appointment times, and confirming the booking. It can even be extended to notify cleaners of new jobs or find nearby staff for urgent requests.
Structure of the Agent
The diagram below illustrates the agent's architecture.
The process starts with a customer-agent conversation. The agent gathers all required service information through chat, then converts the extracted details into a structured format for downstream systems.
The initial structured output, BookingDetails, looks like this:
class BookingDetails(BaseModel):
"""Information extracted from the conversation.
``size_info`` is square footage for a house and seat count for a couch.
"""
# Full model definition in the GitHub repo
This structured approach ensures the price calculator and booking engine receive consistent, machine-readable data.
Key Technical Components
- LangGraph: Manages the agent's stateful workflow, allowing conditional transitions between conversation, pricing, and booking states.
- LangChain: Provides the LLM integration and tool-calling capabilities.
- Langfuse: Adds observability, so you can trace every agent decision and API call—critical for debugging and improving performance in production.
Real-World Impact
In 2026, customers expect instant responses. A 15-minute manual conversation feels slow. This agent reduces that to under a minute, works around the clock, and scales across multiple services—all while maintaining a human-like interaction quality.
Try it yourself: clone the repository, run the demo, and see how LangGraph powers a genuinely useful AI agent for service businesses.
