What is AI?

A plain-English introduction to artificial intelligence for developers.

Artificial Intelligence (AI) is software that performs tasks we normally associate with human thinking: understanding language, recognising images, making predictions, and generating new content.

This guide is about a specific kind of AI

Modern AI apps are mostly built on Large Language Models (LLMs) — systems that read and write text. As a developer you rarely train these models yourself. Instead you call them over an API, send instructions, and use their output in your app.

What you will learn

  • How LLMs work at a practical level.
  • How to call an LLM API and shape its output with prompts.
  • Embeddings, semantic search, and Retrieval-Augmented Generation (RAG).
  • Tool use and building AI agents.
  • How to ship AI features safely and cheaply.

Example

Example · bash
# The whole guide in one idea: send text to a model, get text back.
curl https://api.example-llm.com/v1/chat \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "llm-medium",
    "messages": [{"role": "user", "content": "Explain AI in one sentence."}]
  }'

When to use it

  • A startup uses AI to automatically classify incoming support tickets so the right team handles each one instantly.
  • An e-commerce site uses AI-powered recommendations to surface products each visitor is likely to buy.
  • A hospital uses AI to flag abnormal lab results in patient records, alerting doctors before they even open the file.

More examples

AI classifies text input

Sends a single message to a chat model and gets a one-word classification back.

Example · shell
curl https://api.openai.com/v1/chat/completions \
  -H 'Authorization: Bearer $OPENAI_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [{"role":"user","content":"Is this a complaint or a question? One word.\nI never received my order."}]
  }'

AI summarises a document

Uses a system prompt to constrain the task, then passes the document as the user message.

Example · shell
curl https://api.openai.com/v1/chat/completions \
  -H 'Authorization: Bearer $OPENAI_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [
      {"role":"system","content":"Summarise the text in one sentence."},
      {"role":"user","content":"Artificial intelligence is the simulation of human intelligence..."}
    ]
  }'

Python SDK minimal AI request

Shows the minimal Python SDK call pattern: import, create client, send message, read reply.

Example · python
from openai import OpenAI

client = OpenAI()  # reads OPENAI_API_KEY from env
response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Name three uses of AI in healthcare."}]
)
print(response.choices[0].message.content)

Discussion

  • Be the first to comment on this lesson.