This repository contains the hands-on material for the 'Exploratory data analysis with AI' session at the 2026 summer school ‘AI for Life Sciences and Agri-Food Research’. The workshop uses bulk RNA-seq as a practical case study for exploring LLMs, RAG, and AI agents.
- Start Here
- Workshop Goals
- Workshop Roadmap
- Dataset and Biological Context
- How to Follow the Hands-On
- Tips and Tricks for Jupyter
The workshop is designed to run inside the provided Codespaces environment.
By the end of the hands-on session, you will be able to:
- Explore and control LLM behaviour by experimenting with model selection, prompts, context, output formats and reliability strategies.
- Build and evaluate a retrieval-augmented generation (RAG) workflow using embeddings, document chunking, vector stores and retrieval techniques.
- Design and compare AI agent architectures to query and interpret bulk RNA-seq data.
| Step | Notebook | Main focus |
|---|---|---|
| 1 | 01_LLM_exploration | LLM capabilities for RNA-seq interpretation: comparing models, prompts, context and output methods |
| 2 | 02_RAG | Grounding LLMs with project-specific knowledge: RAG, embeddings, semantic search, vector databases |
| 3 | 03_agent_architectures | Building an AI agent to interact with omics data: architectures, tool use, memory and orchestration |
This workshop uses data derived from the Bioconductor airway package, a widely used bulk RNA-seq example. The experiment profiled four primary human airway smooth muscle cell lines under two conditions: untreated and treated with dexamethasone, giving eight samples in a paired design.
Airway smooth muscle cells are specialised lung cells located in the walls of the airways, where they help regulate airway narrowing and relaxation. Dexamethasone, a synthetic glucocorticoid with anti-inflammatory activity, was used to investigate how corticosteroid exposure changes gene expression in these cells.
The data originate from Himes et al. (2014), RNA-Seq Transcriptome Profiling Identifies CRISPLD2 as a Glucocorticoid Responsive Gene that Modulates Cytokine Function in Airway Smooth Muscle Cells, PLOS ONE, 9(6), e99625.
In the first notebook, you will:
- Compare how model choice, temperature, prompts, and context affect LLM responses.
- Generate and validate outputs in free-text, JSON, Pydantic, and structured formats.
- Test reliability techniques such as retries, fallback models, streaming, and citations.
2. RAG
In the second notebook, you will:
- Prepare bulk RNA-seq literature for retrieval using document splitting and embeddings.
- Build and compare vector stores and retrieval methods.
- Evaluate how chunking, metadata filtering, and top-k selection affect retrieved context.
In the third notebook, you will:
- Create tools for querying and analysing bulk RNA-seq data and results.
- Build and compare tool-calling agents, routers, and sequential chains.
- Explore how memory and tool configuration affect agents’ responses to biological questions.
- Check that the selected kernel is the tutorial Python environment before starting.
- Run notebook cells sequentially unless the instructor tells you to skip ahead.
- Use
Shift+Enterto run the current cell and move to the next one. - Use
Escto enter command mode, thenBto add a cell below orAto add a cell above. - In command mode, use
C,X, andVto copy, cut, and paste cells. - If a plot or computation takes time, wait for the cell to finish before running it again.
See here for details
To test notebook updates, fixes, or integrations locally in an environment close to the GitHub Codespaces VM, run:
scripts/local_test.shThe script starts the same tutorial container image used by the devcontainer, mounts this repository into /workspaces/nfdata-omics-ai-agents-tutorial, and exposes Jupyter Lab on port 8888.
You can work in one of two ways:
- Open Jupyter Lab directly from the URL printed in the terminal after the container starts.
- Attach VS Code to the running container with the Dev Containers extension. In VS Code, run
Dev Containers: Attach to Running Container..., select theai-agents-tutorialcontainer, and open/workspaces/nfdata-omics-ai-agents-tutorial.
Open the repository on GitHub, select Code > Codespaces, and create or resume a Codespace for this repository. After setup completes, open the notebooks from the notebooks/ directory and run them with the configured tutorial Python environment.
Before making changes, configure Git inside the environment if needed:
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"Install the repository hooks once per environment:
prek installThe hooks are configured in .pre-commit-config.yaml and currently check YAML files, devcontainer schema validity, Dockerfiles, trailing whitespace, end-of-file newlines, large files, and notebook output cleanup through nbstripout.
Before opening a pull request, run all checks on the full repository:
prek run --all-filesThe Python environment used by GitHub Codespaces is defined by the container image referenced in .devcontainer/devcontainer.json. Python dependencies are declared in requirements.in, locked in requirements.txt, and installed during the image build from .devcontainer/Dockerfile.
To add, remove, or update Python packages:
-
Edit
requirements.in.Keep this file focused on the direct dependencies needed by the tutorial. Pin versions only when the tutorial needs a specific version, compatibility range, or package build.
-
Recompile the locked dependency file.
Run this from the repository root, preferably inside the Codespace or the local tutorial container:
pip-compile requirements.in
This updates
requirements.txt, which records the fully resolved package versions used by the container build. -
Commit and push the dependency changes.
git add requirements.in requirements.txt git commit -m "Update Python environment" git pushThe GitHub Actions workflow in
.github/workflows/build-devcontainer-image.ymlbuilds and pushes a new image when changes torequirements.inorrequirements.txtreachmainormaster. The image is published toghcr.io/nfdata-omics/ai-agents-tutorialwith two tags: the build date inYYYY-MM-DDformat andlatest. -
Update the devcontainer image tag.
After the image build has completed successfully, update
.devcontainer/devcontainer.jsonso thatimagepoints to the new dated tag:"image": "ghcr.io/nfdata-omics/ai-agents-tutorial:YYYY-MM-DD"
Use the date tag produced by the successful GitHub Actions run, then commit and push this change:
git add .devcontainer/devcontainer.json git commit -m "Update devcontainer image tag" git push
New Codespaces will use the updated image tag. Existing Codespaces may need to be rebuilt from the Codespaces command palette or recreated to pick up the new image.