0:0019:49

Building an AI Chatbot: Better Responses and Actionability with LLM and Predefined Logic Trees

Riddhima Sejpal 19:49 2025

Instacart's support chatbot got better by letting the LLM do less

LLMs state wrong answers with total confidence, "like toddlers," and in customer support that quickly erodes trust. Riddhima Sejpal, a Senior Staff Software Engineer with about ten years at Instacart, shows how a purely generative design for Carebot, the company's customer care chatbot, struggled with consistency and with actions such as cancelling an order. So which jobs belong to the LLM, and which to a predefined logic tree?

Learn the routing checks, prompt splitting and evals behind Instacart's hybrid support bot

Watch on YouTube

In short

Riddhima Sejpal, Senior Staff Software Engineer at Instacart, explains how her team built Carebot, a customer care chatbot that uses an LLM to understand intent and predefined logic trees to carry out actions reliably. She argues that this hybrid design, plus small single-responsibility prompts with their own evals, gives more accurate, consistent and actionable responses than a purely generative chatbot.

“So LLM sometimes produces incorrect information with confidence, like, you know, toddlers tell the lie with a lot of confidence.”
“So we were more confident on pushing more actionable things on the predefined path versus more conversation things on the LLM.”

What you will learn

  • Decide which chatbot tasks belong on predefined logic trees and which suit open LLM conversation.
  • Design parallel checks for flow matching, intent clarity, sensitive cases and escalation thresholds.
  • Split one large prompt into single-responsibility prompts, each with the model that fits its job.
  • Write per-prompt LLM evals to debug failures and safely switch to cheaper models.
  • Plan human escalation that passes full conversation context to the agent.

Key takeaways from the speaker

  • Balancing AI and Rule-Based Systems
  • Optimizing Response Quality and User Experience
  • Designing Action-Oriented Chatbots

Details

Level
Intermediate
Format
Talk
Technical depth
Practitioner
For
Mid-career, Senior individual contributor
Length
19:49
Published
June 2025

Questions this talk answers

Why not rely on a purely generative chatbot for customer support?

LLMs can hallucinate confidently and answer inconsistently, which erodes user trust. They also lack actionability, because taking actions requires sharing user context with the model, which raises data privacy concerns.

How does Carebot decide between the LLM and a predefined flow?

Several AI prompts run in parallel to check whether the message matches a predefined flow, whether the intent is clear, whether the case is sensitive and whether to escalate. A final prompt decides which response to prioritize.

When should a support chatbot hand the customer to a human agent?

For sensitive cases such as fraud or payments, and when the intent is still unclear after four or five back-and-forth questions. A fixed threshold avoids frustrating a customer who is already in trouble.

Why break a large prompt into smaller ones?

A prompt with a single responsibility is easier to improve without regressions elsewhere, lets the team pick a model per prompt for cost efficiency, and makes per-prompt evals possible.

What results did the hybrid approach deliver at Instacart?

The speaker reports that customer satisfaction went up and agent handoffs went down, and the same approach was replicated for shopper support.

About this talk

In this talk, we explore how to design an AI chatbot that combines the power of large language models (LLMs) with predefined logic trees to deliver high-quality responses and actionable outcomes. The session covers how LLMs enhance conversational understanding, while the static logic tree structures provide a reliable framework for decision-making and action-taking. Attendees will learn strategies to balance flexibility and control in chatbot design, ensuring consistency, accuracy, and an engaging user experience.

Topics

Related talks

Browse the library

Azure Open AI Use cases

Namrata Sherkhane Senior Cloud Solution Architect, Microsoft

Generative AI can answer employee questions straight from your policy documents

Beginner AI and data 2023