LangGraph Agent Tutorial GitHub Build Your First Autonomous Workflow

Logan Jul 13, 2026

Embarking on your journey to explore the LangGraph Agent? You're in the right place! This tutorial will walk you step-by-step through setting up, customizing, and running your agent on GitHub. Let's dive right in!

Agent Streaming with LangGraph.js
Agent Streaming with LangGraph.js

LangGraph Agent is an open-source project designed to help you manage and manipulate natural language data. By the end of this tutorial, you'll have a fully functional agent ready to process and generate text, all thanks to the power of Python and GitHub.

LangSmith Studio: The first agent IDE
LangSmith Studio: The first agent IDE

Setting Up Your Environment

The first step is to ensure you have the right tools. You'll need Python (3.8 or later) and Git installed on your local machine.

GitHub - jerosoler/Drawflow: Simple flow library 🖥️🖱️
GitHub - jerosoler/Drawflow: Simple flow library 🖥️🖱️

Once you have the basics covered, clone the LangGraph Agent repository from GitHub:

git clone https://github.com/yourusername/langgraph-agent.git

Installing Dependencies

the github chat sheet is displayed in this screenshote screen graber
the github chat sheet is displayed in this screenshote screen graber

Navigate into your cloned repository and create a virtual environment to manage dependencies:

cd langgraph-agent
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

Now, install the required packages using pip:

pip install -r requirements.txt

Configuring Your GitHub Token

Build Smarter AI Agents for Free Using LangGraph & Ollama
Build Smarter AI Agents for Free Using LangGraph & Ollama

To interact with GitHub, the agent needs a personal access token. Generate one with the `repo` scope, then set it as an environment variable in your project root:

export GITHUB_TOKEN=your_token_here

Customizing Your Agent

LangGraph Agent comes with pre-configured commands, but you can add more using the `commands` directory.

GIT Commands: Your Essential Skills Guide 🚀
GIT Commands: Your Essential Skills Guide 🚀

To create a new command, copy one of the existing command files, rename it, and modify its contents. Each command file is a Python script that takes inputs as arguments and returns output text.

Creating a New Command

Check out this Github hack to view your repo faster! 💡
Check out this Github hack to view your repo faster! 💡
the web page for gau tool, which is designed to look like a computer screen
the web page for gau tool, which is designed to look like a computer screen
an info sheet with instructions on how to use the internet
an info sheet with instructions on how to use the internet
Anton (@therceman) on X
Anton (@therceman) on X
GitHub - arismelachroinos/lscript: The LAZY script will make your life easier, and of course faster.
GitHub - arismelachroinos/lscript: The LAZY script will make your life easier, and of course faster.
the github chat sheet is displayed in pink and black
the github chat sheet is displayed in pink and black
https://gitexplorer.com/
https://gitexplorer.com/
Raymond - H/T Asif Razzaq   Step-by-Step Guide to Build a Customizable Multi-Tool AI Agent with LangGraph and Claude for Dynamic Agent Creation (MarkTechPost, May 2025)  \
Raymond - H/T Asif Razzaq Step-by-Step Guide to Build a Customizable Multi-Tool AI Agent with LangGraph and Claude for Dynamic Agent Creation (MarkTechPost, May 2025) \
the 12 git commands for windows
the 12 git commands for windows
an image of a computer screen with the words learn for free written in red on it
an image of a computer screen with the words learn for free written in red on it
Brij kishore Pandey on LinkedIn: Getting Started with Git- 𝗴𝗶𝘁 𝗶𝗻𝗶𝘁 : This is the very first… | 177 comments
Brij kishore Pandey on LinkedIn: Getting Started with Git- 𝗴𝗶𝘁 𝗶𝗻𝗶𝘁 : This is the very first… | 177 comments
an image of a computer screen with the text hackr login form
an image of a computer screen with the text hackr login form
a circular diagram with different types of technology
a circular diagram with different types of technology
How AI Agents Use a Filesystem (Stop Them Going Blind)
How AI Agents Use a Filesystem (Stop Them Going Blind)
the text what cloud is written in white on a black background
the text what cloud is written in white on a black background
Make your github profile standout
Make your github profile standout
If you want to learn Agentic AI, you don’t need expensive courses - you need the right learning path. This guide brings together high-quality, free resources that help you understand how AI agents… | Rathnakumar Udayakumar | 28 comments
If you want to learn Agentic AI, you don’t need expensive courses - you need the right learning path. This guide brings together high-quality, free resources that help you understand how AI agents… | Rathnakumar Udayakumar | 28 comments
a man in a black hoodie with his arms crossed and the words google new free code
a man in a black hoodie with his arms crossed and the words google new free code
AI Coding : How GitHub’s New Copilot Agent Mode is Helping Developers
AI Coding : How GitHub’s New Copilot Agent Mode is Helping Developers
How to create your own language (conlang)!
How to create your own language (conlang)!

Let's create a simple "hello" command. Create a new file `commands/hello.py` and add the following content:

def hello(name="World"):
    return f"Hello, {name}!"

Testing Your Command

Start the agent with the `--reload` flag to automatically restart when you modify commands:

python -m langgraph.agent --reload

Now, send a message to your agent in the format `command:argument` to test your new "hello" command:

hello:John

Running and Interacting with Your Agent

With everything set up, it's time to run your agent and start interacting with it!

Start the agent with your chosen model and listening address:

python -m langgraph.agent --model="your_model" --listen=0.0.0.0:8000

Sending Messages to Your Agent

Using `curl` (or your preferred HTTP client), send messages to your agent:

curl -X POST -d "message=hello:John" http://localhost:8000/send

Integrating with GitHub

The agent can fetch and process issues, pull requests, and comments directly from your GitHub repository. See the GitHub Integration section in the project README for more details.

That's it! You've successfully set up, customized, and started interacting with your LangGraph Agent. Happy coding, and remember to star the project on GitHub if you found this tutorial helpful!