You can follow this course by reading the lessons and exploring the examples, or by working through the hands-on labs.
If you plan to complete the labs, you’ll start with small exercises that explore individual agent capabilities. Later in the course, you’ll bring those concepts together in a research application.
If you plan to complete the labs, follow the setup instructions below. You do not need to install software or obtain an API key just to read the course.
Prerequisites
This course assumes a basic understanding of programming concepts, APIs, and working with files. Python experience is helpful, but prior knowledge of AI agents is not required.
Required Tools
- Python 3.12 or later to run the labs.
- Visual Studio Code or another code editor.
- Terminal to install packages and run Python scripts.
- OpenAI API account and API key for labs that call OpenAI models.
- Git (optional) to track changes and manage code.
Environment Setup
Step 1: Install Python
Download Python from python.org/downloads.
Verify your installation:
python3 --version
Confirm that the version shown is 3.12 or later. On Windows, use python if python3 is unavailable.
Step 2: Create your project folder
Open a terminal and run:
mkdir enterprise-agent-lab
cd enterprise-agent-lab
Use this as a parent folder for the labs you download. Each lab is a separate package: extract it into its own folder here and follow its README to install and run it. You don’t need to merge the labs into one application.
Step 3: Understand Virtual Environments
Some labs require additional Python packages, including the OpenAI Agents SDK. A virtual environment keeps those packages separate from other Python projects.
You don’t need to create one yet. Lesson 1.3 explains how, and each subsequent lab README includes its own setup instructions.
Some exercises use only Python’s standard library and don’t require installing additional packages.
Step 4: Add your OpenAI API key
Create an API key at platform.openai.com/api-keys.
The labs for Modules 1 through 6 read your key from the OPENAI_API_KEY environment variable. They
don’t load a .env file, so set the key in the terminal you’ll run the lab from, replacing
your-api-key with your actual key:
macOS or Linux
export OPENAI_API_KEY="your-api-key"
Windows (PowerShell)
$env:OPENAI_API_KEY="your-api-key"
The key lasts only until you close that terminal, so set it again in each new terminal. The Module 7
lab doesn’t need a key. Modules 8 and 9 have their own .env option; see
Modules 8 and 9: Standalone Lab Downloads.
If you use Git
Git is optional. If you use it, create a plain-text file named .gitignore (with the leading dot)
in your enterprise-agent-lab folder before you add any files that contain credentials. Add these
lines:
.env
.env.*
!.env.example
.venv/
__pycache__/
This keeps key files, your virtual environment, and Python cache files out of Git, while still
allowing placeholder .env.example files. .gitignore doesn’t affect files Git already tracks: if
you’ve already committed a key, ignoring the file now won’t remove it from your history, so revoke
that key and create a new one.
OpenAI API usage is billed separately from ChatGPT subscriptions. You can review your usage and current pricing on the OpenAI Platform.
Modules 8 and 9: Standalone Lab Downloads
The labs for Modules 8 and 9 are self-contained downloads, linked from each module page and its
lessons. Unlike the earlier labs, they include an offline mode and their own .env option. Lab 9
does not require Lab 8.
- Download
lab-08.ziporlab-09.zipand extract it into its own folder. - Open a terminal in the extracted
lab-08/orlab-09/folder. Run every lab command from there. - Offline mode needs only Python 3.12 or later: no virtual environment, packages or API key. The lab commands use
python; on macOS or Linux without an active virtual environment, usepython3instead.
Optional live mode
-
Create and activate a virtual environment in the extracted folder, as described in the lab’s README, then install the lab’s packages:
python -m pip install -r requirements.txt -
Provide your API key in one of two ways:
- Set
OPENAI_API_KEYin the terminal, as shown in Step 4. - Copy
.env.exampleto.envin the extracted folder, and add your key on theOPENAI_API_KEYline.
- Set
These labs read .env only from their own extracted folder.
A key set in the terminal takes precedence over .env. If you store your key in a .env file, keep that file out of Git. The simplest option is to extract the lab outside a Git repository. If you use Git, make sure .env is ignored before adding files.
Your API Key and Live Research
The agent exercises in Modules 1 through 6 call a model, so you’ll need your key from Module 1 onward. Not every exercise makes model calls: some use local operations, prepared data, or synthetic traces instead. The Module 7 lab makes no model calls and doesn’t need an API key. Modules 8 and 9 let you choose:
- Lab 8.1, live mode: the Discovery Agent uses your key to search for current sources.
- Lab 8.2, live mode: the Evidence Agent uses your key to analyze those sources.
- Lab 9, live options: the Research Agent and Publication Review Agent use your key, including billed web searches.
- Offline mode: the Module 8 and 9 exercises use prepared data and make no model API calls, so no key is needed.
What happens in live mode. Live exercises can send prompts and research content to OpenAI for model processing, and some labs retrieve pages directly from public websites. The OpenAI Agents SDK also exports execution traces by default. Use public or synthetic research material and avoid confidential or sensitive personal information. The labs include basic safeguards, but they are educational examples, not production-ready applications.
You choose the mode in the terminal when the lab starts. You don’t need to edit any code. For example, Lab 8.2 shows:
Lab 8.2: Evidence Analysis
1. Offline: Analyze prepared evidence sources (no API calls)
2. Live: Retrieve sources and analyze evidence from an existing live Lab 8.1 run (API required)
Select [1/2, default 1]:
The lab is now waiting for your answer:
- Type
1and press Enter for offline mode. - Type
2and press Enter for live mode. - Press Enter without typing anything to accept the default,
1.
The brackets show the choices and the default; don’t type the brackets themselves.
If you choose live mode, the lab may ask a follow-up question, such as which earlier live run to use. Before it makes any paid API call, it asks for permission:
Proceed? [y/N]:
Type y and press Enter to continue. The capital N means the default is no: pressing
Enter on its own cancels without making any API calls.
Ready to Begin
Proceed to Module 1. In Lesson 1.3, you’ll download your first lab, open it in your code editor, and set up its virtual environment.