Customer Service Assistant
Multi-agent travel booking assistant with flight and hotel search
The travel-booking template is a single conversational agent that searches real flights and hotels via SerpAPI’s Google Flights/Hotels data, then assembles a day-by-day itinerary. It’s a multi-turn chat agent. In Python, passing context=ctx into agent.run(...) is enough - the SDK loads and saves conversation history on the workflow context automatically, with no separate entity or database. In TypeScript, agent.run(message, ctx) does not persist history by itself; you must load and pass the prior turns explicitly via the history argument if you want the agent to remember earlier turns.
What you’ll build
- A
travel_booking_agentwith three tools:search_flights,search_hotels, andcreate_itinerary - Automatic multi-step tool orchestration - when a user asks to “plan my trip,” the agent chains flight search, hotel search, and itinerary creation in one turn
- Durable multi-turn conversation state, so the agent never re-asks for details already given
- Airport-code inference so users can say “New York to London” instead of “JFK to LHR”
Requirements
- Python 3.12+ or Node.js 22+
OPENAI_API_KEYSERPAPI_KEYfrom serpapi.com (free tier available)- The AGNT5 CLI
Install
curl -LsSf https://agnt5.com/cli.sh | bashSetup
Scaffold the project
agnt5 create —template python/travel_booking_customer_service my-travel-agent
cd my-travel-agentagnt5 create —template typescript/travel_booking_customer_service my-travel-agent
cd my-travel-agentSet environment variables
cat > .env << EOF
OPENAI_API_KEY=your_openai_api_key_here
SERPAPI_KEY=your_serpapi_key_here
EOFInstall dependencies
uv syncpip install -e .npm installStart the AGNT5 dev server
agnt5 devHow it works
The workflow runs the travel-booking agent with the incoming message - that’s the entire workflow body. All of the orchestration logic lives in the agent’s instructions and its three tools. The flight-search and hotel-search tools both call SerpAPI’s Google Flights/Hotels engines and return the top three options; the itinerary tool builds a day-by-day plan framework once destination and dates are known. When a user asks to “plan my trip,” the agent’s instructions direct it to call all three tools in sequence within a single turn, rather than asking the user to confirm between each step.
In Python, because the workflow’s context is passed into the agent’s run call, the conversation history is loaded from and saved back to the workflow’s own durable context on every call - there’s no separate entity to manage, and a crash between turns resumes with full context intact. In TypeScript, the workflow only forwards ctx for tool/HITL access and event emission; to get the same durable multi-turn behavior you need to load prior messages yourself (for example from ctx storage) and pass them as the history argument to agent.run(...).
The agent’s instructions do the heavy lifting here: airport-code inference, when to ask for missing details, and when to auto-chain all three tools are all prompt-level decisions, not code branches.
Key files
app.py - Worker entry point
src/travel_booking/workflows.py - travel_booking_workflow: runs the agent with context=ctx
src/travel_booking/agents.py - the travel_booking_agent and its instructions
src/travel_booking/tools.py - search_flights, search_hotels, create_itinerary (SerpAPI-backed)app.ts - Worker entry point
src/workflows.ts - travelBookingWorkflow: runs the agent with ctx
src/agents.ts - createTravelBookingAgent(): builds the agent with its instructions
src/tools.ts - searchFlights, searchHotels, createItinerary (SerpAPI-backed)Customize
Swap the search provider. tools.py/tools.ts is the only place SerpAPI is referenced - replace it with another flight/hotel API and keep the same tool signatures.
Add a booking-confirmation tool. Give the agent a confirm_booking tool once you’re ready to move from search results to an actual reservation flow.
Tune the conversation style. The agent’s tone, required fields, and orchestration rules are all in the instructions string in agents.py/agents.ts - edit it directly to change behavior.
Next steps
- Read /docs/build/agents for agent tool use and durable conversation context
- See /docs/build/workflows for
context=ctxsemantics - Compare with tutor_agent for the handoff pattern instead of a single tool-using agent