Welcome to the LangChain 101 repository! This project serves as an accessible entry point for beginners eager to explore the world of agentic AI, focusing on the crucial concept of tools. LangChain is a powerful framework for building applications with large language models (LLMs), and this tutorial will guide you through your first steps in creating AI-powered tools. You can run all of this in VSCode, or your favorite IDE if it supports Jupyter notebooks and Python. The notebooks also optionally run on Google Colab (lessons 001 and 002), however the rest are built as Python scripts.
This tutorial is Part One of a broader series on agentic AI. We'll focus on tools as a fundamental component of agentic systems. You'll learn how to create, implement, and use AI tools, setting the foundation for more advanced agentic AI applications in future tutorials.
Get ready to embark on your journey into the world of agentic AI development!
001-tutorial: Introduction to LangChain basics -
002-tutorial: Working with prompt templates and RunnableSequence -
003-tutorial: Creating custom tools and agents
004-tutorial: Using DuckDuckGo Search Tool
005-tutorial-streamlit: Integrating Streamlit (With Error Handling)
(Part 2 / More tutorials will be added as they are developed)
Before you begin, ensure you have the following installed:
Clone this repository:
git clone https://github.com/Agentic-Insights/langchain-labs
cd langchain-labs
Create a conda environment (optional but recommended):
conda create -n langchain-labs python=3.10
conda activate langchain-labs
Install the required packages:
pip install -r requirements.txt
labs/
: Contains individual tutorial scripts and related filesREADME.md
: This file, providing an overview of the repositoryFor Jupyter notebooks, we recommend using VSCode or the Colab support.
Each tutorial in the labs/
directory is a self-contained script. To run a tutorial:
Navigate to the labs/
directory:
cd labs
Run the desired tutorial script. For .py file tutorials:
python 003-tutorial.py
For the 005-tutorial which uses Streamlit:
streamlit run 005-tutorial-streamlit.py
Follow the prompts or instructions provided by the tutorial script.
For tutorials that require API keys or other sensitive information, make sure to set up your .env
file with the necessary credentials.
Some tutorials may require additional setup or resources. Always check the comments at the beginning of each script for any specific instructions.
To explore the code and understand how it works, open the tutorial scripts in your preferred code editor.
Feel free to modify the scripts and experiment with different parameters or inputs to deepen your understanding of LangChain concepts.
Remember to activate your virtual environment before running the tutorials if you're using one.