Content
# LangChain Appointment Booking Chatbot
A demo project showcasing how to build an appointment booking chatbot using Python, [LangChain](https://python.langchain.com/), [MCP](https://github.com/modelcontextprotocol), the [Google Gemini API](https://aistudio.google.com/welcome), [Gradio](https://gradio.app/), [Pipedream](https://pipedream.com/), and Google Calendar.
## Prerequisites
Before you begin, ensure you have the following:
- Python 3.8 or higher
## Setting Up the Google API Key for Gemini
For detailed instructions on obtaining a Google API key to use Gemini in this demo, please refer to Google's official documentation:
- [Getting Started with Gemini API](https://ai.google.dev/gemini-api/docs/api-key)
## Enabling the Google Calendar API
To use the Google Calendar API, you will need to enable it. For detailed instructions on how to do this, please refer to the [Google Calendar API Quickstart Guide](https://developers.google.com/workspace/calendar/api/quickstart/python#enable_the_api).
## Setting Up Pipedream
For this example, you will need to sign up for a free Pipedream account and connect your Google Calendar to it. Please follow the instructions below to get your Pipedream URL:
1. **Sign up for a Pipedream account**
[Sign up for a free account on Pipedream](https://pipedream.com/auth/signup).
2. **Connect Google Calendar to Pipedream**
Follow the instructions on [Pipedream's Google Calendar MCP page](https://mcp.pipedream.com/app/google_calendar) to connect your Google Calendar to Pipedream.
3. **Get your Pipedream URL**
After connecting your Google Calendar to Pipedream copy the MCP server URL under **Configuration**: [Pipedream's Google Calendar MCP page](https://mcp.pipedream.com/app/google_calendar)
## Running the Demo
1. **Clone the repository**
```bash
git clone <repository-url>
cd langchain-appointment-booking-demo
```
2. **Create and activate a virtual environment** (recommended)
```bash
python -m venv .venv
source .venv/bin/activate
```
3. **Install dependencies**
```bash
pip install -r requirements.txt
```
4. **Set up environment variables**
Copy the `.env.example` file to a `.env` file in the project root and replace the placeholders with your actual Google API key and Pipedream URL.
## Running the Application
1. **Start the chatbot**
```bash
python app.py
```
2. **Access the web interface**
Open your web browser and navigate to the URL shown in the terminal (typically http://localhost:7860)
## How to Use
Sample conversation starters:
- "Hi, I'd like to book a dental appointment"
- "When is my next appointment?"
- "Can you reschedule my upcoming appointment?"
- "Let's cancel my appointment"
## Customization
### Modifying the Prompt
You can customize the chatbot's behavior by editing the `prompt` variable in `app.py`. The current prompt includes instructions for handling appointments, but you can modify it to suit your specific needs.
### Changing the AI Model
To use a different model from Google's Gemini API, modify the model name in the `ChatGoogleGenerativeAI` initialization in `app.py`.
Connection Info
You Might Also Like
awesome-mcp-servers
A collection of MCP servers.
git
A Model Context Protocol server for Git automation and interaction.
cc-switch
All-in-One Assistant for Claude Code, Codex & Gemini CLI across platforms.
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.
Appwrite
Build like a team of hundreds
oh-my-opencode
Background agents · Curated agents like oracle, librarians, frontend...