Members-Only
Recent Talks & Demos are for members only
You must be an AI Tinkerers active member to view these talks and demos.
September 13, 2023
·
Denver
LangChain: Conversational Concierge Chatbot
Learn how to build a brand-aligned, safe conversational recommender system using LangChain and OpenAI, featuring niche recommendations, message classification, and retrieval augmented generation.
Overview
I’ll explain how we built a virtual concierge for one of the largest hotel chains in the world. We set out to create a chatbot with three main goals:
- Style: Use brand voice.
- Content: Recommend highly curated niche “finds” to explore in the area.
- Safety: Prevent the chatbot from talking about sensitive topics.
Tools and Techniques
- Chaining prompts: There are ~20 different prompts and ~15 unique paths through the system.
- Message classification: At the beginning of the chain messages are classified to route them appropriately.
- Self evaluation: Evaluation prompts are run in the chain to evaluate if a reply is good. If it isn’t, we branch to a hallucination prevention prompt.
- Tracing and debugging: LangSmith and Chainlit offer visibility into each chain run’s details, allowing us to identify problem areas and experiment with prompt improvements.
- Example selector via embeddings: The most relevant examples (few shot) from a corpus are selected using embeddings and similarity to the incoming message.
- Pinecone hybrid search: Pinecone hybrid search is used to find the most relevant places/activities to recommend.
- Chat history summarization: Current and previous messages are passed through a prompt to summarize intent that may have been expressed over multiple messages.
- Retrieval augmented generation: A markdown document full of hotel details enables the chatbot to answer specific questions about the property.
Links
Tech stack