Build a WhatsApp Chatbot with Orders

Connect a LangChain agent to WhatsApp to answer questions and take repair orders.

Introduction

30 Second Summary

Businesses everywhere are adding chatbots to handle customer questions and take orders around the clock. On freelance platforms like Fiverr, AI chatbot developers are in massive demand because every small business wants this automation but can't build it themselves.

In this project, you will build a production-ready WhatsApp chatbot for a laptop repair shop that answers customer questions and takes structured repair orders through natural conversation. You'll deploy it live and walk away with a real demo to showcase on your freelance profile.

What You'll Build

A LangChain-powered chatbot connected to WhatsApp Cloud API that uses RAG for business Q&A and tool calling for structured order taking, deployed on Render's free tier.

By the end of this project, you'll have:

  • A LangChain agent with RAG-powered Q&A and tool calling that extracts structured repair orders from natural conversation.
  • A FastAPI webhook server that connects your chatbot to WhatsApp Cloud API and handles message verification.
  • A live WhatsApp chatbot deployed on Render that customers can message 24/7 for service questions and order placement.
  • Secret Mission: Add a web chat widget as a second channel hitting the same backend for multi-channel architecture.

Are there any prerequisites?

You'll need an OpenAI API account with credits (around $4 covers thousands of test messages), a GitHub account, and a Facebook account for Meta Developer setup. All other accounts you'll create during the project are free.

Set Up Your Development Environment

Before you can build a chatbot that takes orders on WhatsApp, you need a solid project foundation.

In this step, you will create a Python project with all the packages your bot needs. You will also confirm that your OpenAI connection works before writing any chatbot logic.

In this step, get ready to:
  • Create a project folder and Python virtual environment.
  • Install all project dependencies.
  • Verify your OpenAI API connection with a test script.
Create your project folder and virtual environment

A virtual environment gives your project its own isolated set of Python packages. This prevents conflicts with other projects on your machine.

  • In VS Code, open the integrated terminal by pressing Cmd+` (macOS) or Ctrl+` (Windows).
  • Move to your Desktop by running this command:
cd ~/Desktop
  • Create your project folder and move into it by running these commands:
mkdir techfix-bot
cd techfix-bot
  • Confirm the folder was created by running:
ls

The output should be empty because the folder is brand new.

  • Create a Python virtual environment by running this command:

macOS

python3 -m venv venv

Windows

python -m venv venv

Now you need to open this project folder in VS Code so the editor recognizes it as your workspace.

  • In VS Code, click File in the top menu bar.
  • Click Open Folder.
  • Navigate to your Desktop, select the techfix-bot folder, then click Open.
  • Open a new integrated terminal by pressing Cmd+` (macOS) or Ctrl+` (Windows).
  • Activate your virtual environment by running:

macOS

source venv/bin/activate

Windows

venv\Scripts\activate

You should see (venv) appear at the beginning of your terminal prompt. This confirms the virtual environment is active.

Don't see (venv) in your prompt?

Make sure you ran the activate command from inside the techfix-bot folder. The venv folder must exist in your current directory.

On Windows, if you see an execution policy error, run Set-ExecutionPolicy -Scope CurrentUser RemoteSigned first, then try activating again.

Help me activate my Python virtual environment.

Install your project dependencies

Your chatbot relies on several packages. You will list them in a requirements.txt file so they can be installed in one command.

  • In VS Code's Explorer sidebar, click the new file icon at the top of the file tree.
  • Name the file requirements.txt and press Enter.
  • Paste the following contents into the file:
fastapi==0.136.3
uvicorn==0.34.0
langchain==1.3.4
langchain-openai
python-dotenv==1.0.1
httpx==0.28.1

What are these packages?

  • fastapi is the web framework that receives incoming WhatsApp messages.
  • uvicorn is the server that runs your FastAPI app.
  • langchain and langchain-openai provide the AI agent framework with tool calling support.
  • python-dotenv loads your API keys from a .env file so they stay out of your code.
  • httpx handles sending reply messages back to WhatsApp.
  • Save requirements.txt.
  • Install all the packages by running this command in your terminal:
pip install -r requirements.txt

You should see a stream of download and install messages. It finishes with a line that says Successfully installed followed by the package names.

Seeing install errors?

Make sure you see (venv) in your terminal prompt before running pip install. If it is missing, reactivate your virtual environment first.

If you see a permissions error on macOS, do not use sudo. Reactivate your venv and try again.

Help me fix my pip install error.

✔️ Awesome, I've got everything!

Great. Make sure you have saved requirements.txt.

ⓧ I'd like to double check the full code

fastapi==0.136.3
uvicorn==0.34.0
langchain==1.3.4
langchain-openai
python-dotenv==1.0.1
httpx==0.28.1
Create your environment file and verify the connection

Your bot needs an API key to talk to OpenAI. A .env file keeps secrets out of your code so you never accidentally commit them to GitHub.

  • Create a new file in VS Code and name it .env.
  • Paste the following contents into the file:
OPENAI_API_KEY=your-openai-api-key-here
WHATSAPP_ACCESS_TOKEN=your-whatsapp-access-token-here
WHATSAPP_PHONE_NUMBER_ID=your-phone-number-id-here
VERIFY_TOKEN=your-custom-verify-token-here
  • Replace your-openai-api-key-here with your actual OpenAI API key from your OpenAI account.
  • Leave the other three values as placeholders for now. You will fill them in during later steps.
  • Save .env.

What are these environment variables?

  • OPENAI_API_KEY authenticates your bot with OpenAI so it can generate responses.
  • WHATSAPP_ACCESS_TOKEN lets your bot send messages back through the WhatsApp Cloud API.
  • WHATSAPP_PHONE_NUMBER_ID identifies which phone number your bot sends from.
  • VERIFY_TOKEN is a secret string you choose that WhatsApp uses to verify your webhook is real.

Now confirm that your OpenAI key works by running a quick test script.

  • Create a new file in VS Code and name it test_connection.py.
  • Paste the following code into the file:
from dotenv import load_dotenv
from langchain_openai import ChatOpenAI

# Load the OPENAI_API_KEY from your .env file
load_dotenv()

# Create a ChatOpenAI instance using gpt-4o-mini
llm = ChatOpenAI(model="gpt-4o-mini", temperature=0.3)

# Send a test message to verify the connection works
response = llm.invoke("Say hello in one sentence.")
print(response.content)

What does this script do?

This script loads your API key from .env, creates a connection to OpenAI's gpt-4o-mini model through LangChain, and sends a simple message. If you get a response, everything is wired up correctly.

  • Save test_connection.py.
  • Run the test script in your terminal:
python test_connection.py

You should see a friendly one-sentence greeting printed in your terminal. This confirms your OpenAI key is valid and LangChain can communicate with the API.

Seeing an authentication error?

Double-check that you replaced your-openai-api-key-here in your .env file with your actual API key. The key should start with sk-.

Make sure your OpenAI account has available credits. A free trial with no remaining credits will return an error.

Help me fix my OpenAI connection error.

  • Once you see a response, delete test_connection.py. It was only needed to verify your setup.

✔️ Awesome, I've got everything!

Great. Make sure you have saved your .env file and deleted test_connection.py.

ⓧ I'd like to double check the full code

OPENAI_API_KEY=your-openai-api-key-here
WHATSAPP_ACCESS_TOKEN=your-whatsapp-access-token-here
WHATSAPP_PHONE_NUMBER_ID=your-phone-number-id-here
VERIFY_TOKEN=your-custom-verify-token-here

Your environment is locked and loaded. Next up, you will build the chatbot brain with LangChain tool calling so your bot can answer questions and take repair orders.

Build the Chatbot Brain with Tool Calling

Your development environment is ready. Now it's time to build the core intelligence of your chatbot.

A chatbot that only answers questions is useful, but Fiverr clients pay a premium for bots that can also take action. In this step, you'll build a LangChain agent that does both: answer customer questions from a knowledge base AND create structured repair orders by extracting information from natural conversation.

In this step, get ready to:
  • Create a knowledge base file with TechFix shop information.
  • Build a LangChain agent with two tools: one for Q&A lookup and one for order creation.
  • Test your bot locally to confirm it answers questions and writes orders to a CSV file.
Create the knowledge base file

Your chatbot needs a source of truth about the business. This is the knowledge base that the agent will reference when customers ask about services, pricing, or policies.

  • Create a new file called knowledge_base.txt in your project folder by pasting the following content:
TechFix Laptop Repair Shop - Service Guide

SERVICES AND PRICING:
- Screen Replacement: $89-149 depending on laptop model. Takes 1-2 business days.
- Battery Replacement: $49-79. Same-day service available.
- Keyboard Replacement: $59-99. Takes 1-2 business days.
- SSD/RAM Upgrade: $39 labor + cost of parts. Same-day service.
- Virus Removal & OS Reinstall: $59. Takes 1 business day.
- Water Damage Repair: $99-199 diagnostic fee. Repair time varies (3-5 days).
- Hinge Repair: $69-119. Takes 2-3 business days.

GENERAL INFO:
- Location: 123 Tech Street, Downtown
- Hours: Monday-Friday 9am-6pm, Saturday 10am-4pm
- We service all major brands: Dell, HP, Lenovo, Apple MacBook, ASUS, Acer
- Free diagnostic on all repairs
- 90-day warranty on all repairs
- Walk-ins welcome, appointments preferred for same-day service

POLICIES:
- We provide a quote before starting any repair
- Payment accepted: cash, card, bank transfer
- Pick-up notification sent via WhatsApp when repair is complete

What is this file for?

This plain text file acts as your chatbot's "brain" for answering customer questions. When someone asks about pricing or hours, the agent reads this file and uses the information to respond.

In production, you might replace this with a database or a vector store. For a Fiverr demo, a text file keeps things simple and easy to customize for different clients.

  • Save knowledge_base.txt.
  • Confirm the file exists by running:
ls knowledge_base.txt

You should see knowledge_base.txt listed in the output.

Build the LangChain agent with tools

Now you'll create the agent that powers your chatbot. It uses two tools: one to look up business information and one to create repair orders by writing structured data to a CSV file.

Why tool calling instead of plain RAG?

Plain RAG (Retrieval-Augmented Generation) can answer questions, but it cannot take actions. Tool calling lets the LLM decide when to call a function.

The model handles the messy conversation (extracting a customer's name, device, and issue from natural language), while the tool handles the structured action (writing a clean row to a CSV). This is the exact architecture Fiverr clients pay for.

  • Create a new file called agent.py in your project folder.
  • Add the imports, configuration, and the knowledge base loader by pasting this code:
import csv
import os
from datetime import datetime
from pathlib import Path

from dotenv import load_dotenv
from langchain.tools import tool
from langchain_openai import ChatOpenAI
from langchain.agents import AgentExecutor, create_tool_calling_agent
from langchain.prompts import ChatPromptTemplate, MessagesPlaceholder

# Load environment variables from .env
load_dotenv()

# Paths to the knowledge base and orders CSV
KNOWLEDGE_BASE_PATH = Path(__file__).parent / "knowledge_base.txt"
ORDERS_CSV_PATH = Path(__file__).parent / "orders.csv"


def load_knowledge_base() -> str:
    # Read the entire knowledge base file into a string
    return KNOWLEDGE_BASE_PATH.read_text(encoding="utf-8")

What does this code do?

  • The imports bring in LangChain's tool decorator, the OpenAI chat model, and the agent framework.
  • KNOWLEDGE_BASE_PATH and ORDERS_CSV_PATH define where the agent reads business info and writes orders.
  • load_knowledge_base() is a helper that reads the entire text file into memory so the agent can search it.
  • Below your existing code in agent.py, add the first tool that handles customer Q&A:
@tool
def lookup_services(query: str) -> str:
    """Look up information about TechFix repair services, pricing, hours, policies, and general business info. Use this tool when the customer asks about services, pricing, turnaround times, location, hours, or policies."""
    # Return the full knowledge base for the LLM to extract relevant info
    knowledge = load_knowledge_base()
    return knowledge

What does this tool do?

The @tool decorator turns a regular Python function into something the LLM can call. The docstring is critical. It tells the model WHEN to use this tool.

When a customer asks about pricing or hours, the agent reads this description and decides to call lookup_services.

  • Save agent.py.
  • You won't see a change yet. The next chunk adds the order-creation tool.
  • Below lookup_services in agent.py, add the tool that creates repair orders:
@tool
def create_repair_order(customer_name: str, device: str, issue_description: str, contact_number: str) -> str:
    """Create a new repair order. Use this tool ONLY when you have collected ALL four pieces of information from the customer: their name, device model, issue description, and contact phone number."""
    # Generate a unique order ID using the current timestamp
    order_id = f"ORD-{datetime.now().strftime('%Y%m%d%H%M%S')}"

    # Append the order to the CSV file, creating headers if the file is new
    file_exists = ORDERS_CSV_PATH.exists()
    with open(ORDERS_CSV_PATH, "a", newline="", encoding="utf-8") as f:
        writer = csv.writer(f)
        if not file_exists:
            writer.writerow(["order_id", "customer_name", "device", "issue_description", "contact_number", "created_at", "status"])
        writer.writerow([order_id, customer_name, device, issue_description, contact_number, datetime.now().isoformat(), "pending"])

    return f"Order created successfully! Order ID: {order_id}. We will contact {customer_name} at {contact_number} with a quote shortly."

What does this tool do?

This is the "action" tool. When the LLM has gathered all four pieces of customer information through conversation, it calls this function. The function generates a unique order ID, writes a row to orders.csv, and returns a confirmation message.

The docstring explicitly says "ONLY when you have collected ALL four pieces." This prevents the agent from creating incomplete orders.

  • Save agent.py.
  • You won't see a change yet. The next chunk wires the tools into a working agent.
  • Below create_repair_order in agent.py, add the system prompt and agent builder:
SYSTEM_PROMPT = """You are the friendly customer support assistant for TechFix Laptop Repair Shop.

Your job is to:
1. Answer customer questions about services, pricing, turnaround times, location, and policies using the lookup_services tool.
2. Help customers place repair orders by collecting their information through natural conversation.

When a customer wants to book a repair:
- Ask for their name (if not provided)
- Ask for their device model (e.g., "Dell XPS 15", "MacBook Pro 2021")
- Ask for a description of the issue
- Ask for their contact phone number
- Only call create_repair_order when you have ALL four pieces of info

Keep responses concise and friendly. Use emojis sparingly. Always be helpful."""


def build_agent() -> AgentExecutor:
    # Initialize the LLM with gpt-4o-mini for cost-effective tool calling
    llm = ChatOpenAI(model="gpt-4o-mini", temperature=0.3)
    tools = [lookup_services, create_repair_order]

    # Build the prompt template with system instructions and placeholders
    prompt = ChatPromptTemplate.from_messages([
        ("system", SYSTEM_PROMPT),
        MessagesPlaceholder(variable_name="chat_history", optional=True),
        ("human", "{input}"),
        MessagesPlaceholder(variable_name="agent_scratchpad"),
    ])

    # Create the agent and wrap it in an executor
    agent = create_tool_calling_agent(llm, tools, prompt)
    return AgentExecutor(agent=agent, tools=tools, verbose=False)


# Build the agent once at module level so it persists across calls
agent_executor = build_agent()


def get_bot_response(user_message: str) -> str:
    # Invoke the agent with the user's message and return the output
    result = agent_executor.invoke({"input": user_message})
    return result["output"]

What does this code do?

  • SYSTEM_PROMPT tells the agent how to behave: answer questions using the lookup tool, and collect all four data points before creating an order.
  • build_agent() initializes gpt-4o-mini (at $0.15/1M input tokens, this is very cost-effective), creates the prompt template, and wires everything into an AgentExecutor.
  • agent_executor is built once at module level. This means the agent stays in memory and responds instantly to each message.
  • get_bot_response() is the single entry point other parts of your app will use to talk to the bot.
  • Save agent.py.

Seeing an import error?

If VS Code shows red underlines on the import lines, make sure your virtual environment is activated and all dependencies from requirements.txt are installed. Return to your terminal and run:

pip install -r requirements.txt

Help me debug my import errors

✔️ Awesome, I've got everything!

Great. Double check you've saved agent.py before moving on to testing.

ⓧ I'd like to double check the full code

Here is the complete agent.py file. Make sure yours matches exactly:

import csv
import os
from datetime import datetime
from pathlib import Path

from dotenv import load_dotenv
from langchain.tools import tool
from langchain_openai import ChatOpenAI
from langchain.agents import AgentExecutor, create_tool_calling_agent
from langchain.prompts import ChatPromptTemplate, MessagesPlaceholder

load_dotenv()

KNOWLEDGE_BASE_PATH = Path(__file__).parent / "knowledge_base.txt"
ORDERS_CSV_PATH = Path(__file__).parent / "orders.csv"


def load_knowledge_base() -> str:
    return KNOWLEDGE_BASE_PATH.read_text(encoding="utf-8")


@tool
def lookup_services(query: str) -> str:
    """Look up information about TechFix repair services, pricing, hours, policies, and general business info. Use this tool when the customer asks about services, pricing, turnaround times, location, hours, or policies."""
    knowledge = load_knowledge_base()
    return knowledge


@tool
def create_repair_order(customer_name: str, device: str, issue_description: str, contact_number: str) -> str:
    """Create a new repair order. Use this tool ONLY when you have collected ALL four pieces of information from the customer: their name, device model, issue description, and contact phone number."""
    order_id = f"ORD-{datetime.now().strftime('%Y%m%d%H%M%S')}"

    file_exists = ORDERS_CSV_PATH.exists()
    with open(ORDERS_CSV_PATH, "a", newline="", encoding="utf-8") as f:
        writer = csv.writer(f)
        if not file_exists:
            writer.writerow(["order_id", "customer_name", "device", "issue_description", "contact_number", "created_at", "status"])
        writer.writerow([order_id, customer_name, device, issue_description, contact_number, datetime.now().isoformat(), "pending"])

    return f"Order created successfully! Order ID: {order_id}. We will contact {customer_name} at {contact_number} with a quote shortly."


SYSTEM_PROMPT = """You are the friendly customer support assistant for TechFix Laptop Repair Shop.

Your job is to:
1. Answer customer questions about services, pricing, turnaround times, location, and policies using the lookup_services tool.
2. Help customers place repair orders by collecting their information through natural conversation.

When a customer wants to book a repair:
- Ask for their name (if not provided)
- Ask for their device model (e.g., "Dell XPS 15", "MacBook Pro 2021")
- Ask for a description of the issue
- Ask for their contact phone number
- Only call create_repair_order when you have ALL four pieces of info

Keep responses concise and friendly. Use emojis sparingly. Always be helpful."""


def build_agent() -> AgentExecutor:
    llm = ChatOpenAI(model="gpt-4o-mini", temperature=0.3)
    tools = [lookup_services, create_repair_order]

    prompt = ChatPromptTemplate.from_messages([
        ("system", SYSTEM_PROMPT),
        MessagesPlaceholder(variable_name="chat_history", optional=True),
        ("human", "{input}"),
        MessagesPlaceholder(variable_name="agent_scratchpad"),
    ])

    agent = create_tool_calling_agent(llm, tools, prompt)
    return AgentExecutor(agent=agent, tools=tools, verbose=False)


agent_executor = build_agent()


def get_bot_response(user_message: str) -> str:
    result = agent_executor.invoke({"input": user_message})
    return result["output"]
Test your bot in the terminal

Time to see your agent in action. You'll send it two types of messages: a question about services (to test the Q&A tool) and a repair request with all customer details (to test order creation).

  • Test the Q&A flow by running this command in your terminal:
python -c "from agent import get_bot_response; print(get_bot_response('What are your prices for screen replacement?'))"

You should see a friendly response mentioning screen replacement costs ($89-149) and turnaround time (1-2 business days). The first call may take a few seconds while the agent initializes.

Command hanging or timing out?

The first call loads the LLM model and makes an API request. Give it up to 15 seconds. If it still hangs, check your internet connection and verify your OPENAI_API_KEY in .env is valid.

Help me debug why my agent command is hanging

  • Test the order creation flow by running:
python -c "from agent import get_bot_response; print(get_bot_response('I need a repair. My name is Alex, my Dell XPS 15 has a cracked screen, and my number is 555-0123.'))"

You should see a confirmation message with an order ID like ORD-20260605143022.

  • Verify the order was written to the CSV by running:
cat orders.csv

You should see a header row and one data row containing the customer name, device, issue, and contact number.

Not seeing a response or getting an error?

  • If you see an authentication error, check that your .env file has a valid OPENAI_API_KEY with available credits.
  • If you see a module not found error, make sure your virtual environment is activated before running the command.
  • If the order confirmation appears but orders.csv is empty, check that your terminal is in the same directory as agent.py.

Help me debug my LangChain agent

Your chatbot brain is working. It can answer questions from the knowledge base and create structured orders in a CSV file. Next up, you'll wrap this agent in a FastAPI server so it can receive messages from the outside world.

Wrap the Bot in a FastAPI Webhook

Your chatbot brain is working locally, but WhatsApp needs to talk to it over the internet. That means your bot needs a web server that listens for incoming messages and sends replies back.

In this step, you will wrap your LangChain agent in a FastAPI server with webhook endpoints that WhatsApp can call.

In this step, get ready to:
  • Create a FastAPI server with a POST webhook endpoint that forwards WhatsApp messages to your chatbot agent.
  • Add a GET endpoint for WhatsApp webhook verification.
  • Add a health check endpoint and test everything locally with uvicorn.
Create the FastAPI app with the POST webhook endpoint

A webhook is a URL that another service calls when something happens. WhatsApp will send an HTTP POST request to your server every time a customer sends a message.

  • Create a new file called main.py in your project folder.
  • Add the imports, app setup, and POST webhook endpoint by copying this code into main.py:
import os
import json

import httpx
from dotenv import load_dotenv
from fastapi import FastAPI, Request, Response
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles
from pydantic import BaseModel

from agent import get_bot_response

load_dotenv()

# Create the FastAPI app instance
app = FastAPI(title="TechFix WhatsApp Bot")

# Load WhatsApp credentials from environment variables
WHATSAPP_ACCESS_TOKEN = os.getenv("WHATSAPP_ACCESS_TOKEN")
WHATSAPP_PHONE_NUMBER_ID = os.getenv("WHATSAPP_PHONE_NUMBER_ID")
VERIFY_TOKEN = os.getenv("VERIFY_TOKEN")

What does this code do?

This sets up the foundation of your web server. FastAPI creates the app instance that will handle HTTP requests.

The three environment variables (WHATSAPP_ACCESS_TOKEN, WHATSAPP_PHONE_NUMBER_ID, VERIFY_TOKEN) are loaded from your .env file. You already added these values in the previous step.

  • Below the setup code, add the POST /webhook endpoint and the send_whatsapp_message helper function:

@app.post("/webhook")
async def receive_webhook(request: Request):
    body = await request.json()

    # Ignore anything that isn't from a WhatsApp Business Account
    if body.get("object") != "whatsapp_business_account":
        return {"status": "ignored"}

    # Parse nested WhatsApp message structure
    entries = body.get("entry", [])
    for entry in entries:
        changes = entry.get("changes", [])
        for change in changes:
            value = change.get("value", {})
            messages = value.get("messages", [])
            for message in messages:
                if message.get("type") == "text":
                    sender = message["from"]
                    text = message["text"]["body"]
                    # Pass the message to our LangChain agent
                    reply = get_bot_response(text)
                    await send_whatsapp_message(sender, reply)

    return {"status": "ok"}


async def send_whatsapp_message(to: str, text: str):
    # WhatsApp Cloud API endpoint for sending messages
    url = f"https://graph.facebook.com/v21.0/{WHATSAPP_PHONE_NUMBER_ID}/messages"
    headers = {
        "Authorization": f"Bearer {WHATSAPP_ACCESS_TOKEN}",
        "Content-Type": "application/json",
    }
    payload = {
        "messaging_product": "whatsapp",
        "recipient_type": "individual",
        "to": to,
        "type": "text",
        "text": {"body": text},
    }
    # Use httpx for async HTTP requests
    async with httpx.AsyncClient() as client:
        await client.post(url, headers=headers, json=payload)

What does this code do?

  • receive_webhook receives every incoming WhatsApp message. It digs through the nested JSON structure to extract the sender's phone number and message text.
  • It passes the text to get_bot_response() (your LangChain agent from agent.py) and gets a reply.
  • send_whatsapp_message sends the reply back to the customer via the WhatsApp Cloud API.
  • Below send_whatsapp_message, add a /chat endpoint for web-based access to the same bot:

class ChatRequest(BaseModel):
    message: str


class ChatResponse(BaseModel):
    reply: str


@app.post("/chat", response_model=ChatResponse)
def web_chat(req: ChatRequest):
    # Same agent handles both WhatsApp and web chat
    reply = get_bot_response(req.message)
    return ChatResponse(reply=reply)

What does this code do?

This creates a second way to reach your bot. The /chat endpoint accepts a JSON body with a message field and returns a reply field.

Pydantic models (ChatRequest and ChatResponse) enforce the request/response shape. This is useful for the Secret Mission later and for API documentation.

  • Save main.py.

Seeing a red underline on the import?

If VS Code shows a warning on from agent import get_bot_response, make sure your virtual environment is selected as the Python interpreter. Press Cmd+Shift+P (macOS) or Ctrl+Shift+P (Windows) and select Python: Select Interpreter, then choose the one in your .venv folder.

help me fix the import error in main.py

Add the GET webhook verification endpoint

Before WhatsApp sends messages to your server, it first verifies that you own the webhook URL. It does this by sending a GET request with a challenge token that your server must echo back.

  • In main.py, find this line:
@app.post("/webhook")
  • Add the following GET endpoint directly above it:

@app.get("/webhook")
def verify_webhook(request: Request):
    # WhatsApp sends these query params for verification
    mode = request.query_params.get("hub.mode")
    token = request.query_params.get("hub.verify_token")
    challenge = request.query_params.get("hub.challenge")

    # Only respond if the token matches our secret
    if mode == "subscribe" and token == VERIFY_TOKEN:
        return Response(content=challenge, media_type="text/plain")
    return Response(content="Forbidden", status_code=403)

What does this code do?

When you register your webhook URL in the Meta dashboard, WhatsApp sends a GET request with three query parameters: hub.mode, hub.verify_token, and hub.challenge.

Your server checks that the hub.verify_token matches the secret you set in your .env file. If it matches, you echo back the hub.challenge value. This proves to WhatsApp that you control this server.

  • Save main.py.
Add the health check endpoint and test locally

A health check endpoint is a simple route that returns a quick status response. Hosting platforms like Render use it to confirm your server is alive and responding.

  • In main.py, find this line:
@app.get("/webhook")
  • Add the health check endpoint directly above it:

@app.get("/health")
def health():
    return {"status": "ok"}

Why a health check?

Render (the hosting platform you will use) pings this endpoint to know your app is running. If it stops responding, Render restarts your service automatically.

  • Save main.py.
  • Create a new file called render.yaml in your project folder and add this deployment configuration:
services:
  - type: web
    name: techfix-whatsapp-bot
    runtime: python
    buildCommand: pip install -r requirements.txt
    startCommand: uvicorn main:app --host 0.0.0.0 --port $PORT
    healthCheckPath: /health
    plan: free
    envVars:
      - key: OPENAI_API_KEY
        sync: false
      - key: WHATSAPP_ACCESS_TOKEN
        sync: false
      - key: WHATSAPP_PHONE_NUMBER_ID
        sync: false
      - key: VERIFY_TOKEN
        sync: false

What does render.yaml do?

This file tells Render how to build and run your app. It specifies the build command (pip install -r requirements.txt), the start command (uvicorn main:app --host 0.0.0.0 --port $PORT), and which environment variables your app needs.

Setting sync: false means you will enter the values manually in Render's dashboard rather than storing secrets in version control.

  • Save render.yaml.
  • Start the local development server by running this command:
uvicorn main:app --reload

You should see output that includes a line like:

INFO:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
  • Open your browser and go to http://127.0.0.1:8000/health.

You should see {"status":"ok"} displayed in the browser. Your server is working.

Auto-generated API docs

FastAPI automatically generates interactive documentation. Visit http://127.0.0.1:8000/docs to see all your endpoints and even test the /chat endpoint directly from the browser.

  • Press Ctrl+C in your terminal to stop the server when you are done testing.

Server won't start?

  • Make sure your virtual environment is activated. You should see (.venv) at the start of your terminal prompt.
  • Check that agent.py and main.py are in the same folder. The from agent import get_bot_response line needs both files side by side.
  • If you see a port-already-in-use error, another process is using port 8000. Close other terminal windows or wait a moment and try again.

help me debug why my FastAPI server won't start

✔️ Awesome, I've got everything!

Great. Make sure you have saved both main.py and render.yaml.

ⓧ I'd like to double check the full code

Here is the complete main.py file:

import os
import json

import httpx
from dotenv import load_dotenv
from fastapi import FastAPI, Request, Response
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles
from pydantic import BaseModel

from agent import get_bot_response

load_dotenv()

app = FastAPI(title="TechFix WhatsApp Bot")

WHATSAPP_ACCESS_TOKEN = os.getenv("WHATSAPP_ACCESS_TOKEN")
WHATSAPP_PHONE_NUMBER_ID = os.getenv("WHATSAPP_PHONE_NUMBER_ID")
VERIFY_TOKEN = os.getenv("VERIFY_TOKEN")


@app.get("/health")
def health():
    return {"status": "ok"}


@app.get("/webhook")
def verify_webhook(request: Request):
    mode = request.query_params.get("hub.mode")
    token = request.query_params.get("hub.verify_token")
    challenge = request.query_params.get("hub.challenge")

    if mode == "subscribe" and token == VERIFY_TOKEN:
        return Response(content=challenge, media_type="text/plain")
    return Response(content="Forbidden", status_code=403)


@app.post("/webhook")
async def receive_webhook(request: Request):
    body = await request.json()

    if body.get("object") != "whatsapp_business_account":
        return {"status": "ignored"}

    entries = body.get("entry", [])
    for entry in entries:
        changes = entry.get("changes", [])
        for change in changes:
            value = change.get("value", {})
            messages = value.get("messages", [])
            for message in messages:
                if message.get("type") == "text":
                    sender = message["from"]
                    text = message["text"]["body"]
                    reply = get_bot_response(text)
                    await send_whatsapp_message(sender, reply)

    return {"status": "ok"}


async def send_whatsapp_message(to: str, text: str):
    url = f"https://graph.facebook.com/v21.0/{WHATSAPP_PHONE_NUMBER_ID}/messages"
    headers = {
        "Authorization": f"Bearer {WHATSAPP_ACCESS_TOKEN}",
        "Content-Type": "application/json",
    }
    payload = {
        "messaging_product": "whatsapp",
        "recipient_type": "individual",
        "to": to,
        "type": "text",
        "text": {"body": text},
    }
    async with httpx.AsyncClient() as client:
        await client.post(url, headers=headers, json=payload)


class ChatRequest(BaseModel):
    message: str


class ChatResponse(BaseModel):
    reply: str


@app.post("/chat", response_model=ChatResponse)
def web_chat(req: ChatRequest):
    reply = get_bot_response(req.message)
    return ChatResponse(reply=reply)

And here is the complete render.yaml file:

services:
  - type: web
    name: techfix-whatsapp-bot
    runtime: python
    buildCommand: pip install -r requirements.txt
    startCommand: uvicorn main:app --host 0.0.0.0 --port $PORT
    healthCheckPath: /health
    plan: free
    envVars:
      - key: OPENAI_API_KEY
        sync: false
      - key: WHATSAPP_ACCESS_TOKEN
        sync: false
      - key: WHATSAPP_PHONE_NUMBER_ID
        sync: false
      - key: VERIFY_TOKEN
        sync: false

Your webhook server is ready. Next up, you will create a Meta Developer app and connect your WhatsApp test number to this server.

Set Up WhatsApp Cloud API

Your FastAPI server is built and tested locally. Now it needs a real WhatsApp number to receive messages from.

The WhatsApp Cloud API is Meta's official interface for sending and receiving WhatsApp messages programmatically. You'll set up a free test number that lets you develop without any messaging costs.

In this step, get ready to:
  • Create a Meta app with the WhatsApp use case.
  • Generate a permanent access token for your bot.
  • Update your .env file with real credentials.
Create a Meta app with the WhatsApp use case

A Meta app is the container that gives your code permission to use WhatsApp's messaging infrastructure. You'll create one and connect it to a WhatsApp Business Account with a free test phone number.

  • Return to the Meta for Developers portal at developers.facebook.com and sign in with your Facebook account.
  • Open the App Dashboard and click Create App.
  • Enter a display name for your app (e.g. TechFix WhatsApp Bot) and your email address.
  • Select the Connect with customers through WhatsApp use case and click Next.
  • Select an existing business portfolio or create a new one, then click Next.
  • Review the publishing requirements listed. You may not have any at this point. Click Next.
  • Confirm your details, use case, and business portfolio. Click Create app to finish.

You are redirected to the WhatsApp Quickstart page in your app's dashboard.

What is a business portfolio?

A business portfolio (formerly called a Meta Business Account) is the container that holds your business assets like WhatsApp accounts, ad accounts, and pages. If you don't have one, Meta creates a test portfolio for you during app setup.

  • In the left sidebar, click API Setup under the WhatsApp section.
  • Connect your app to a WhatsApp Business Account. If a new business portfolio was created during app setup, a WhatsApp Business Account is automatically created for you. Verify the connection is displayed in the API Setup panel.
  • Note the Phone number ID displayed on this page. You will need it shortly.

What about the test phone number?

When you complete the Get Started steps, Meta generates and registers a test business phone number for you automatically. This number lets you send and receive messages at no cost during development.

All non-template messages within an open customer service window (when the customer messages first) are completely free.

Send a test message to confirm the setup

On the API Setup page, you can add your personal WhatsApp number as a recipient and click Send message to send a test template message. This confirms that your app and phone number are working correctly before you generate a permanent token.

Generate a permanent access token

The temporary token on the API Setup page expires in less than 24 hours. For your bot to keep working, you need a permanent token tied to a System User.

  • Open Business Settings for the business portfolio associated with your app. You can find this by clicking the gear icon in Meta Business Suite at business.facebook.com.
  • In the left sidebar under Users, click System Users.
  • Click Add.
  • Enter a name for the system user (e.g. whatsapp-bot).
  • Set the role to Admin and click Create System User.
  • Select the system user you just created and click Assign Assets.
  • Select your app and toggle Manage app under Full control.
  • Select your WhatsApp account and toggle Manage WhatsApp Business Accounts under Full control.
  • Click the Assign assets button to confirm.
  • Click Generate token.
  • Select your app from the dropdown.
  • Add the whatsapp_business_messaging permission.
  • Click Generate token.
  • Copy and save your token immediately. You will not be able to see it again after closing this dialog.

Why a System User instead of your personal token?

A System User token does not expire and is not tied to your personal Facebook session. This means your bot keeps working even when you log out of Facebook or change your password.

Personal tokens expire in less than 24 hours, which would break your bot every day.

Don't see the System Users option?

Make sure you are in Business Settings (the gear icon in Meta Business Suite), not the App Dashboard. The System Users section lives under Users in the left sidebar of Business Settings.

If it still doesn't appear, your business portfolio may need verification. Follow the prompts Meta provides to verify your business.

help me find the System Users section in Meta Business Settings

Update your .env file with real credentials

Your bot needs the permanent access token and phone number ID to send replies on WhatsApp. You also need to set a custom verify token that Meta will use when connecting the webhook later.

  • Switch back to VS Code and open your .env file.
  • Find the line that says WHATSAPP_ACCESS_TOKEN=your-whatsapp-access-token-here.
  • Replace your-whatsapp-access-token-here with the permanent token you just generated.
  • Find the line that says WHATSAPP_PHONE_NUMBER_ID=your-phone-number-id-here.
  • Replace your-phone-number-id-here with the Phone number ID from the API Setup page.
  • Find the line that says VERIFY_TOKEN=your-custom-verify-token-here.
  • Replace your-custom-verify-token-here with any custom string you choose (e.g. techfix-bot-2024). This is a shared secret between your server and Meta for webhook verification.
  • Save the .env file.

What is the VERIFY_TOKEN?

The VERIFY_TOKEN is a custom secret string you invent. When Meta connects to your webhook, it sends this token in the request. Your server checks that the token matches what you expect, proving the request is genuinely from Meta and not an impersonator.

You will enter this same string in the Meta App Dashboard when configuring the webhook in the next step.

Worried about pasting your token correctly?

Access tokens are long strings of random characters. Make sure you copy the entire token without any trailing spaces. If you accidentally added a line break or extra character, your bot will get authentication errors when it tries to send messages.

help me verify my WhatsApp access token is pasted correctly in my .env file

Your WhatsApp credentials are locked and loaded. Next up, you'll push everything to Render and wire the live webhook so Meta can actually deliver messages to your bot.

Deploy to Render and Connect WhatsApp

Your chatbot works locally, but WhatsApp needs a publicly accessible URL to send messages to. That means your FastAPI server needs to live on the internet, not just on your laptop.

In this step, you will push your code to GitHub, deploy it on Render's free tier, and wire up the WhatsApp webhook so Meta knows where to deliver incoming messages.

In this step, get ready to:
  • Push your project to GitHub.
  • Deploy your FastAPI bot on Render's free tier.
  • Configure the WhatsApp webhook to point at your live server.
Push your project to GitHub

Render pulls your code directly from a GitHub repository. You already have a repo created, so you need to initialize Git locally, commit your files, and push them up.

  • Create a .gitignore file so your secrets and generated files stay out of version control by running this command:
echo ".env\norders.csv\n__pycache__/\n*.pyc" > .gitignore

Why a .gitignore?

Your .env file contains your API keys and tokens. Pushing it to GitHub would expose those secrets to anyone who can view the repo.

The .gitignore file tells Git to skip these files entirely.

  • Initialize a Git repository, add your files, and make your first commit by running these commands:
git init
git add .
git commit -m "Initial commit: TechFix WhatsApp bot"
  • Connect your local repo to GitHub and push by running these commands:
git remote add origin [[YOUR_REPO_URL="https://github.com/your-username/your-repo.git"]]
git branch -M main
git push -u origin main
  • Open your GitHub repository in a browser and refresh the page.
  • You should see all your project files listed: main.py, agent.py, requirements.txt, knowledge_base.txt, and render.yaml.

Push failed or permission denied?

Make sure you are authenticated with GitHub. If you see a permission error, try using a personal access token or set up SSH keys for your account.

Help me fix my GitHub push error

Create a Render web service and add environment variables

Render connects directly to your GitHub repository and redeploys automatically every time you push. You will create a free web service, configure the build and start commands, and add your secret environment variables.

  • Open your browser and go to the Render dashboard at https://dashboard.render.com.
  • Click New in the top navigation, then select Web Service.
  • Connect your GitHub account if prompted, then select the repository you just pushed to.
  • Configure the following settings:
  • Set Name to techfix-whatsapp-bot.
  • Set Runtime to Python.
  • Set Build Command to pip install -r requirements.txt.
  • Set Start Command to uvicorn main:app --host 0.0.0.0 --port $PORT.
  • Set Plan to Free.
  • Before clicking deploy, scroll to the Environment Variables section and add the following four variables:
  • OPENAI_API_KEY set to your OpenAI API key.
  • WHATSAPP_ACCESS_TOKEN set to the permanent access token you generated from your System User.
  • WHATSAPP_PHONE_NUMBER_ID set to the phone number ID from your WhatsApp test number.
  • VERIFY_TOKEN set to the custom verify token you chose earlier (the same value in your local .env file).
  • Click Create Web Service to start the deployment.

Render will clone your repo, run the build command, and start your server. This takes 2-3 minutes.

What is happening during the build?

Render clones your GitHub repo, runs pip install -r requirements.txt to install your Python dependencies, then starts your FastAPI app with uvicorn.

Once the health check at /health responds, the service is marked as live.

  • Wait for the deploy to complete. You will see a green Live badge once the service is running.
  • Copy your service URL from the top of the Render dashboard page. It looks like https://techfix-whatsapp-bot.onrender.com.
  • Verify the deployment by pasting your health check URL into a new browser tab:
[[RENDER_URL="https://techfix-whatsapp-bot.onrender.com"]]/health

You should see a JSON response: {"status":"ok"}.

Free tier cold starts

Render's free tier spins down your service after 15 minutes of inactivity. The first request after a spin-down takes about a minute while Render wakes the service back up. This is normal for a demo project.

Deploy failed or health check timing out?

Check the build logs in the Render dashboard. Common issues include a missing dependency in requirements.txt or a typo in an environment variable name.

Make sure your OPENAI_API_KEY is valid. The agent imports run at startup, so an invalid key can cause a crash.

Help me debug my Render deployment

Configure the WhatsApp webhook

Your bot is live on the internet. Now you need to tell Meta where to send incoming WhatsApp messages by registering your Render URL as the webhook callback.

  • Open the Meta App Dashboard at https://developers.facebook.com and select your WhatsApp app.
  • In the left sidebar, click WhatsApp, then click Configuration.
  • Find the Webhook section and click Edit.
  • In the Callback URL field, paste your Render service URL followed by /webhook:
[[RENDER_URL="https://techfix-whatsapp-bot.onrender.com"]]/webhook
  • In the Verify token field, enter the exact same value you set as VERIFY_TOKEN in your Render environment variables.
  • Click Verify and Save.

What happens when you click Verify and Save?

Meta sends a GET request to your /webhook endpoint with hub.mode, hub.verify_token, and hub.challenge parameters.

Your verify_webhook function in main.py checks that the token matches and returns the challenge string. If Meta gets the correct challenge back, verification succeeds.

  • After successful verification, you will see a list of webhook fields you can subscribe to.
  • Find the messages field and click Subscribe.

Your webhook is now active. Every time someone sends a message to your WhatsApp test number, Meta will forward it to your Render server.

Verification failed?

If Meta cannot verify your webhook, check these common causes:

  • Make sure your Render service is live (green badge). If it spun down, the first verification request may time out before Render wakes up. Visit your /health endpoint first to wake the service, then retry verification.
  • Confirm the VERIFY_TOKEN value in your Render environment variables matches exactly what you typed in the Meta dashboard. Even a trailing space will cause a mismatch.
  • Ensure your callback URL ends with /webhook (not /webhook/ with a trailing slash).

Help me fix my WhatsApp webhook verification

Your bot is now fully deployed and connected. In the next step, you will test the complete flow by sending real WhatsApp messages to your bot and watching it respond.

Test Your Live WhatsApp Bot

Your bot is deployed on Render and connected to WhatsApp through the webhook you configured in the Meta App Dashboard.

Now it's time to prove it all works end-to-end. You'll send real messages on WhatsApp and watch your chatbot answer questions and take orders in real time.

In this step, get ready to:
  • Test the Q&A flow by asking about services, pricing, and turnaround times.
  • Place a repair order through natural conversation and verify it gets logged.
  • Capture a screenshot or screen-recording for your Fiverr portfolio.
Send your first message and test Q&A

Your personal phone number was added as a test recipient in the Meta App Dashboard during the previous step. You'll message the test business number from your personal WhatsApp to trigger the webhook.

  • Open WhatsApp on your phone.
  • Find the test business phone number in your Meta App Dashboard under WhatsApp > API Setup.
  • In WhatsApp, start a new chat with that test business number.
  • Send the message Hi and wait for a reply.

Why is the first reply slow?

Render's free tier spins down your service after 15 minutes of no inbound traffic. Your first message wakes up the server, which takes about 30-60 seconds to cold start. Subsequent messages will respond much faster.

You should see a friendly greeting from the TechFix assistant in your WhatsApp chat within a minute.

  • Now test the knowledge base by sending: What services do you offer?
  • The bot should reply with information about screen replacement, battery replacement, keyboard replacement, and other services from your knowledge_base.txt file.
  • Send another question: How much does a battery replacement cost?
  • The bot should respond with the $49-79 price range and mention same-day service availability.
  • Try one more: What are your hours?
  • The bot should reply with Monday-Friday 9am-6pm and Saturday 10am-4pm.

What's happening behind the scenes?

Each message you send triggers Meta's servers to POST a webhook payload to your Render endpoint at /webhook. Your FastAPI server extracts the message text, passes it to the LangChain agent, and the agent calls the lookup_services tool to find the answer in your knowledge base.

The reply then gets sent back to your WhatsApp via the Graph API's send message endpoint.

Not getting a reply?

Check that your Render service is running by visiting the /health endpoint in your browser. You should see {"status":"ok"}.

If the health check works but messages don't come through, confirm your app is set to Live mode in the Meta App Dashboard under App Settings > Basic. Some webhooks only fire in Live mode.

Also confirm the messages webhook field is still subscribed under WhatsApp > Configuration.

help me debug why my WhatsApp bot isn't responding to messages

Test the order flow

The real power of your chatbot is structured data extraction. The bot should collect a customer's name, device, issue, and contact number through natural conversation, then write a structured order to your CSV file.

  • In your WhatsApp chat with the bot, send: I need to get my laptop repaired
  • The bot should ask for your name. Reply with a name (e.g. Alex Chen).
  • The bot should ask for your device model. Reply with something like MacBook Pro 2021.
  • The bot should ask for a description of the issue. Reply with The screen has a crack in the top left corner.
  • The bot should ask for your contact number. Reply with 555-0123.
  • Once you've provided all four pieces of information, the bot should confirm the order was created and give you an order ID (like ORD-20260605143022).

What is the bot doing with your information?

Behind the scenes, once the agent has all four fields (name, device, issue, contact), it calls the create_repair_order tool. This tool writes a new row to orders.csv on Render's filesystem with the structured data plus a timestamp and order ID.

This is exactly what Fiverr clients pay for. The bot converts messy human conversation into clean, structured records.

What about the CSV file on Render?

Render's free tier uses an ephemeral filesystem. Your orders.csv will be lost if your service redeploys or spins down. This is fine for a demo. In a production client project, you would swap the CSV for a database.

Bot not creating the order?

If the bot keeps asking for information you already provided, try being more explicit. For example, say "My name is Alex Chen" instead of just "Alex".

If the bot confirms the order but you want to verify it exists, check your Render service logs in the Render dashboard. You should see the agent invoking the create_repair_order tool in the request logs.

help me figure out why my LangChain agent isn't calling the create_repair_order tool

Capture your Fiverr portfolio demo

A live WhatsApp conversation with your bot is the most convincing proof for potential Fiverr clients. They can see the bot answering real questions and taking a real order.

  • Scroll up in your WhatsApp chat to see the full conversation (Q&A questions and the order flow).
  • Take a screenshot or screen-recording of the conversation showing both your messages and the bot's replies.
  • Make sure the screenshot captures at least one Q&A answer (pricing or services) and the order confirmation with the order ID.

Record a video for maximum impact

A short screen-recording (30-60 seconds) showing you typing a question and getting an instant reply is more compelling than a static screenshot. Most phones have built-in screen recording. Use it to capture the full flow from opening the chat to receiving the order confirmation.

What makes this Fiverr-ready?

Your demo proves three things clients care about. First, the bot answers business-specific questions accurately. Second, it collects structured data through conversation. Third, it runs on a real messaging channel (WhatsApp), not just a terminal.

Your WhatsApp chatbot is live and proven. Next up, you'll extend it with a web chat widget so the same bot brain can serve customers on multiple channels.

Secret mission

Add a Web Chat Widget

Your bot only speaks WhatsApp right now. What if you could offer clients a second channel with zero extra AI work? In this mission, you'll build a web chat widget that hits the same LangChain agent. Multi-channel chatbots command higher prices on Fiverr.

Clean Up Your Resources

Clean Up Your Resources

Decide whether to keep your resources running, pause them to come back later, or delete them entirely.

This project costs essentially nothing to keep running. Render's free tier is $0/month, WhatsApp test messages are free, and OpenAI API usage is fractions of a cent per conversation.

Resources you used:

  • Render web service (techfix-whatsapp-bot).
  • Meta Developer App with WhatsApp test number.
  • GitHub repository.
  • Local project folder on your Desktop.

Keep everything running

No action needed. Choose this if you want to keep your chatbot live for Fiverr demo recordings or continued testing.

  • Your Render service automatically spins down after 15 minutes of no traffic. It restarts on the next incoming request at no cost.
  • Your Meta app stays in Development mode with the free test number available.
  • Your OpenAI API key remains active. Each bot conversation costs fractions of a cent with gpt-4o-mini.
  • Your local project folder and GitHub repo remain unchanged.

Pause - I'll come back to this later

Shut down running processes to free up memory. Your files stay intact for when you return.

  • Render automatically pauses your service when it receives no traffic for 15 minutes. No manual action needed.
  • If you have uvicorn still running locally, press Ctrl+C in that terminal to stop it.
  • Your Meta app, GitHub repo, and local files all stay as they are.

Delete - I don't want to use this again

Remove all project resources and start fresh. Follow each group of steps below.

Delete your Render web service
  • Open the Render Dashboard and click on your techfix-whatsapp-bot service.
  • Click Settings in the left sidebar.
  • Scroll to the bottom of the Settings page and click the delete option.
  • Type the service name to confirm deletion.
Remove your Meta Developer App
  • Go to the Meta for Developers Apps panel at developers.facebook.com.
  • Find your WhatsApp chatbot app and click the ••• icon next to it.
  • Select Remove App. This permanently deactivates webhooks and invalidates all access tokens associated with the app.
Delete your GitHub repository
  • Navigate to your repository on GitHub.
  • Click Settings.
  • Scroll to the Danger Zone section and click Delete this repository.
  • Click I want to delete this repository, then click I have read and understand these effects.
  • Type the repository name to confirm and click Delete this repository.
Delete your local project folder

On macOS or Linux, run this command in your terminal:

cd ~/Desktop
rm -rf techfix-whatsapp-bot

On Windows, run this command in Command Prompt:

cd %USERPROFILE%\Desktop
rmdir /s /q techfix-whatsapp-bot

That's a Wrap!

That's a Wrap!

Nice work! You just built what Fiverr clients pay $300-1000 for: a production-ready WhatsApp chatbot that answers customer questions and takes structured repair orders.

You've learned how to:

  • Built a LangChain agent with RAG for business Q&A and tool calling for structured order extraction to a CSV file.
  • Wrapped the agent in a FastAPI webhook and connected it to the WhatsApp Cloud API with proper webhook verification.
  • Deployed the entire chatbot to Render for free 24/7 hosting, ready for live Fiverr demo recordings.
  • Secret Mission: Added a web chat widget as a second channel hitting the same agent, proving multi-channel architecture skills.

Ready to quiz yourself?