─ □ ×
aka.ms/europython26
EuroPython 2026 · Kraków, Poland

The Right Way
To Do AI

Marlene Mhangami

@marlenezw

Conference 15–17 July · Kraków, Poland

✦ · ✦ · ✦ · ✦ · ✦
Marlene Mhangami

Marlene Mhangami

@marlenezw

  • Senior Developer Advocate · Microsoft / GitHub
  • Founding Chair · PyCon Africa
  • Previous Board Member · Python Software Foundation
  • Current Co-Chair · ACM
AI IS THE NEW ELECTRICITY!

Andrew Ng (Stanford, Coursera)

Credit: AI@Oxford — Mike Wooldridge

AI IS MORE PROFOUND THAN FIRE AND ELECTRICITY

Sundar Pichai (CEO, Google)

Credit: AI@Oxford — Mike Wooldridge

AI IS God

Anthony Levandowski (church of AI)

Credit: AI@Oxford — Mike Wooldridge

Fastest to 100 million users

Time in months to 100 million users
ChatGPT
2 mo
TikTok
9 mo
Instagram
28 mo
WhatsApp
40 mo
YouTube
49 mo
01020304050

ChatGPT reached 100 million users in just two months.

Most visited websites in the world

RankWebsiteMonthly visits (billions)
1Google101
2YouTube47
3Facebook9.9
4Instagram5.7
5ChatGPT5.24

Source: semrush.com/website/top

Python Developers Survey 2024

Python developers are building with AI

AI tools used or tried for coding
ChatGPT
82%
GitHub Copilot
39%
Google Gemini
23%
020406080100%

Source: JetBrains & Python Software Foundation — 25,000+ respondents

Python Est. 1991 ·
⋯
Python updated their relationship status.
Python & Artificial Intelligence
It’s complicated
You and 2.1M others
184K comments · 96K shares
Like
Comment
Share

LLM progress is built on the Python ecosystem

✦ · ✦ · ✦ · ✦ · ✦

Recipe: pretrained GPT-3 (2020)

click / → to add each ingredient
PyTorch
the internet filter 1 token ≈ 4 characters tokens 96 attention layers next token GPT-3
Python

Recipe card

  • Pour in raw text — the internet
  • Sieve & filter — quality + dedup
  • Grind to tokens — BPE
  • Add architecture — 96-layer Transformer
  • Stir: predict the next token
  • Out: Pretrained GPT-3

Raw ingredient: the internet — ~45 TB of text (Common Crawl, WebText2, Books, Wikipedia).

PythonPython scripts + a scikit-learn-era quality classifier filter & deduplicate: 45 TB → ~570 GB.

PythonByte-pair encoding — GPT-2’s tokenizer, in Python — makes ~300B tokens.

PythonA decoder-only Transformer (“Attention Is All You Need”, 2017): 96 layers, 175B params, 2048 context — a Python class in PyTorch.

PythonOne objective: predict the next token. The loop is Python; the math runs on CUDA.

It completes text — it doesn’t answer you yet. That’s the next recipe.

Brown et al., “Language Models are Few-Shot Learners” (2020) arxiv/2005.14165 · Vaswani et al., “Attention Is All You Need” (2017) arxiv/1706.03762

Nearly half of all new AI repositories on GitHub are Python-based

582,196

new AI projects created in the past year

Source: GitHub Octoverse 2025

What does the community think about AI?

✦ · ✦ · ✦ · ✦ · ✦

A spectrum of views on AI

Where do Python developers stand?

☀ AI Optimist ☔ AI Skeptic
AI Optimist
AI is already a new substrate for a lot of new innovation, ideas and creations and I’m here for it. It has moved beyond being a curious tool.
— Armin Ronacher
lucumr.pocoo.org/2025/6/4/changes
AI Skeptic
Your employer non-consensually turns you into the verification system: the AI does the fun part of performing the work, and then you do the boring part — checking if the robot is right and cleaning up its messes.
— Glyph Lefkowitz
blog.glyph.im/2026/06/adversarial-communication
I keep struggling to find ways to try them the right way, the way that people I know and otherwise respect claim to be using them.

— Glyph Lefkowitz, “I think I’m done thinking about genAI for now” (2025)

What is the right way to do AI?

✦ · ✦ · ✦ · ✦ · ✦
White country church in a wildflower field
Marlene as a young woman gesturing at a table
Dario Amodei · Anthropic
There’s a train going very fast in some direction. You don’t want it to crash. You can’t stop the train — but you can steer it so it doesn’t hit the rocks. We want to do things the right way.

— Dario Amodei, CEO of Anthropic, interviewed by Oprah (2025)

Anil Dash
Those of us who share the valid criticisms of Big AI, but who also believe machine learning could be helpful if made more accountable, have been waiting for tools that are made the right way.

— Anil Dash, “(One) Good AI is here”

Listen & Experiment

✦ · ✦ · ✦ · ✦ · ✦

Space to experiment

You don’t have to accept the tools given to you. You can build your own.

Pi harness by Mario Zechner, part of Armin Ronacher’s company Earendil
github.com/earendil-works/pi

Matei Zaharia tweet: the very simple Pi harness got the same success rate as vendor harnesses with Opus and GPT-5.5, but at 2x less cost
Pi harness vs. native vendor agents · same success, ~2× cheaper

What is Agentic Coding?

✦ · ✦ · ✦ · ✦ · ✦

Code Completion

1
Code Completion
2
Code Generation
3
Agentic Coding

Autocomplete

Code completion autocomplete example

Code Generation

✓
Code Completion
2
Code Generation
3
Agentic Coding

LLM-Powered Code Generation

Code generation with LLM example

Agentic Coding

✓
Code Completion
✓
Code Generation
3
Agentic Coding

Autonomous AI in Your Workspace

Agentic coding autonomous AI example

Coding Agents

IDE

  • Copilot in VS Code
  • Cursor
  • Windsurf

CLI

  • Copilot CLI
  • Claude Code
  • Pi

Web

  • Copilot in GitHub.com
  • Codex
  • Jules

Custom

  • Microsoft Agent Framework
  • PyDantic AI
  • LangChain

What is an AI Agent?

A widely accepted definition today:

An AI Agent is an LLM that calls tools in a loop to achieve a goal.

✦ · ✦ · ✦ · ✦ · ✦

The Agentic Loop

How coding agents think, act, and iterate

Your prompt agentic loop Gather context Take action (tools) Verify results Done You: interrupt, steer, or add context

Source: code.claude.com/docs/en/how-claude-code-works

Your prompt Gather context Take action Verify results Done
Gather Context

Providing Context to an Agent

Attaching Files & Resources

  • Attach files, screenshots, GitHub Issues & PRs to the chat
  • Use example files with best-practice code as a starting point

Instruction Files

  • copilot-instructions.md — GitHub Copilot
  • cursor rules — Cursor
  • claude.md — Claude Code
  • agents.md — OpenAI (becoming a standard)

Context Engineering

Increasing Input Tokens Impacts LLM Performance

Context Rot

trychroma.com/research/context-rot

Your prompt Gather context Take action (tools) Verify results Done
Take Action

Giving Agents Tools

MCP — Model Context Protocol

  • Open protocol for giving agents access to tools
  • In VS Code: search @mcp in extensions for vetted servers
  • You can also create your own MCP servers

Agent Skills

  • A reusable workflow defined in a SKILL.MD file an agent invokes to complete a task
  • Skills can include tools, MCP servers, scripts and more!
Your prompt Gather context Take action Verify results Done
Verification

Pull Requests

Human & Agent Review

  • Be mindful with PRs. Don’t flood maintainers with agent output
  • Have a human review critical code. Agents can miss edge cases
  • Attach visual proof with Playwright screenshots
Playwright functionality test screenshot

Strengthen Human Agency

✦ · ✦ · ✦ · ✦ · ✦

Thank you.

  • GitHub · @marlenezw
  • X · @marlene_zw
  • Bluesky · @marlene.bsky.social
  • LinkedIn · marlenemhangami
  • Website · marlene.ai

Get the slides at aka.ms/europython26

✦ · ✦ · ✦ · ✦ · ✦