Tuesday, July 16, 2024

Langchain - Customer Chatbot Sample Part 1 - Intro

The tutorial basically builds a customer support bot for an airline to help users research and make travel arrangements. 

LangGraph's interrupts and checkpointers and more complex state to organize  assistant's tools and manage a user's flight bookings, hotel reservations, car rentals, and excursions. 

Pre-requisites 

- Claude is used as LLM in this case 

- most of the tools will connect to a local sqlite database (and require no additional dependencies), 

- It also provide a general web search to the agent using Tavily.

The tutorial is split up into below sections 

1. Tools 

2. Part 1 : Zero shot agent 

3. Adding confirmation 

4. Conditional Interruption 

5. Specialized workflows 

For the tools, the tools that are made are:

1. Lookup of company policies 

2. Flight  

3. Car Rentals

4. Hotels 

5. Excursions 

6. Utilities 

Second part is about Zero shot agent (Zero-Shot Agent is a type of agent that can handle new tasks or prompts without requiring explicit programming for those specific scenarios.) In this case, to a single agent given all tools to make the whole thing quite simple at least to look at it.

The second part is around adding confirmation: In this process, any steps taken by the LLM need to be confirmed by the user to make sure the steps taken are not adversely affecting the user. 

interrupt_before is used to pause the graph and return control to the user before executing any of the tools . Next part is the conditional interrupt. In this part the tools are separated into safe and unsafe tools. 

The Specialized workflow section focuses on the primary assistant fields the user's initial queries, and the graph routes to the appropriate "expert" based on the query content.


No comments:

Post a Comment