Welcome to this beginner-friendly tutorial on building a chatbot using LangChain and LangGraph by Drishya!
This project demonstrates how to create a conversational AI bot using Google Gemini AI.
- Interactive AI chatbot using LangChain + LangGraph
- Uses Google Gemini AI as the language model
- Simple conversation flow:
START → chatbot → END - Step-by-step guide for beginners in Colab or Jupyter Notebook
- A Google account and API key (instructions below)
- Python 3.x (for local setup)
- Go to Google AI Studio
- Sign in with your Google account
- Click Create API Key
- Copy the key and keep it safe
⚠️ Never share your API key publicly or commit it to GitHub.
- Open the notebook
langchain_chatbot_simple.ipynb - Run the
%pip installcell at the top to install all required packages - Set your API key using the provided cell
- Clone the repository:
git clone https://github.com/drishyashrestha/Simple-Langchain-Chatbot.git
cd Simple-Langchain-Chatbot- Install all dependencies:
pip install -r requirements.txt- Set your Google API key in your environment:
export GOOGLE_API_KEY="your_api_key_here" # Linux / macOS
set GOOGLE_API_KEY="your_api_key_here" # WindowsOpen the notebook in Jupyter and run all cells.
Test examples:
send_message("What is LangChain simply?")
send_message("Can you explain Python in simple terms?")
send_message("Write a short poem about robots learning to code")Run the interactive cell and type your messages.
Type "quit" to exit the chat.
This project is open-source and free to use for learning purposes.