Learn AI from scratch, the developer's way

Concepts explained simply, with real-world examples — so you actually understand what's happening under the hood.

AI Fundamentals — Core 10
click any term to expand
🗺️
How It All Connects

The flow below shows how raw text travels through an AI system — from tokenisation to embeddings to RAG to grounded output.

INPUT ENCODE RETRIEVE GENERATE Raw Text"Hello world" Tokeniserwords → tokens Context Windowprompt + history+ docs (tokens) KnowledgeCutoffAug 2025 Temperature0 = precise1 = creative Embeddingstext → vectors Vector DBPinecone /pgvector Semantic Searchmeaning ≠ keyword encode RAGRetrieval-Augmented Generationretrieve → inject into context → generate top-k docs Groundingcite sourcesverify facts Fine-Tuningstyle / formatnot new facts LLMTransformer + Attentionpredicts next token inject shape Hallucinationconfident butwrong output Grounded Outputanswer + citation→ user withoutRAG/ground AI AgentTool Use /Function Callplan → act → loop uses LLM RLHF → safe
📖
Complete AI Glossary
The big picture
TermSimple meaning
AIMachines that simulate human intelligence
ML (Machine Learning)AI that learns from data instead of explicit rules
Deep LearningML using neural networks with many layers
GenAIAI that generates content — text, images, code
LLMLarge Language Model — the brain behind ChatGPT, Claude
Foundation ModelA massive pre-trained model others build on top of
How LLMs work
TermSimple meaning
TokenA chunk of text (roughly 1 word ≈ 1.3 tokens)
Context WindowHow much text the model can "see" at once
PromptThe input you give the model
InferenceRunning the model to get an output
TemperatureControls randomness — 0 = predictable, 1 = creative
EmbeddingConverting text into numbers (vectors) for comparison
VectorA list of numbers representing meaning
Semantic SearchRetrieval that understands intent, not just keyword matches
Building with AI
TermSimple meaning
RAGRetrieval-Augmented Generation — give the model your own docs
Fine-tuningRe-training a model on your specific data
Prompt EngineeringCrafting inputs to get better outputs
AgentAn AI that can take actions, use tools, make decisions
Tool Use / Function CallingLetting the LLM call your code or APIs
ChainConnecting multiple AI steps together
HallucinationWhen the model confidently says something wrong
Models & training
TermSimple meaning
ParametersThe "weights" inside a model (GPT-4 ≈ 1 trillion)
TrainingTeaching a model on massive datasets
Pre-trainingInitial training on general internet data
RLHFHuman feedback used to make models more helpful and safe
TransformerThe architecture behind almost all modern LLMs
AttentionHow the model decides what parts of text matter most
💰
Anthropic API Pricing
June 2026
Pay-as-you-go — no monthly subscription. You pay only for tokens used, billed per million. 1M tokens ≈ 750,000 words.
ModelInput / 1M tokensOutput / 1M tokensBest for
Haiku 4.5$1.00$5.00Learning & cheap tasks
Sonnet 4.6$3.00$15.00Best balance — use this for Week 1
Opus 4.8$5.00$25.00Most powerful tasks
⚙️
Cost Optimization
🗂️
Batch Processing
50% cheaper on input + output. Submit thousands of requests asynchronously, processed within 24 hrs.
💾
Prompt Caching
Cache your static context (docs, instructions) and pay 90% less when it's reused across calls.
🐣
Use Haiku While Learning
Haiku 4.5 is $1/1M input — cheapest and still great for all Week 1 practice tasks.
Batch processing — when to use it
Good for batch
  • Processing thousands of documents
  • Bulk summarization
  • Data extraction / classification
  • Nightly jobs
  • Offline evaluations
  • Content generation queues
Not suitable for batch
  • Chatbots
  • Real-time APIs
  • Interactive applications
  • Anything needing a response in seconds
Prompt caching — how it works
Cost breakdown per request
Without cache
full prompt cost
100%
With caching
cached 10%
dynamic 100%
~42%
Static context (large docs, instructions) gets cached — you pay only 10% on reuse.
Dynamic context (user's question) is always charged at full rate.

Claude Code — Project Structure Guide

How the .claude/ config folder works, explained with a real example project.

runbook-bot/ ├── CLAUDE.md ├── CLAUDE.local.md ├── .mcp.json └── .claude/ ├── settings.json ├── settings.local.json ├── rules/ │ └── code-style.md ├── commands/ │ └── fix-issue.md ├── skills/ │ └── deploy/SKILL.md ├── agents/ │ └── security-auditor.md └── hooks/ └── validate-bash.sh
CLAUDE.md Loaded every session
  • The main brief Claude Code reads at the start of every session
  • Defines project overview, tech stack, build/run commands
  • Documents architecture and conventions so Claude doesn't need re-explaining each time
# Runbook Bot AI assistant that answers questions from AWS runbooks using RAG. ## Tech Stack - Python 3.11, LangChain, ChromaDB, Anthropic API - Embeddings: HuggingFace sentence-transformers (local, free) ## Commands - Run bot: `python runbook_bot.py` - Re-index docs: `python ingest.py --docs ./docs` ## Architecture - `ingest.py` — loads PDFs, chunks, embeds, stores in ./chroma_db - `runbook_bot.py` — CLI chat loop with ConversationalRetrievalChain
CLAUDE.local.md Personal, gitignored
  • Same idea as CLAUDE.md, but personal overrides not shared with the team
  • Use it for machine-specific notes — local AWS profile, test file paths, Python version
# Local notes (not shared with team) My AWS profile: `personal-sandbox` Test PDFs are in ~/Downloads/test-runbooks/ Running Python 3.11 via pyenv, not system Python
.mcp.json Shared via git
  • Stores MCP (Model Context Protocol) integration configs
  • Connects Claude Code to GitHub, Jira, Slack, databases
  • Checked into git, so the whole team gets the same integrations automatically
{ "mcpServers": { "github": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"] } } }
.claude/settings.json Permissions & model
  • Controls what Claude Code is allowed to do — like an IAM policy for the agent
  • Defines model selection and hooks
  • settings.local.json works the same way for personal, untracked overrides
{ "permissions": { "allow": ["Bash(pytest:*)", "Bash(python:*)"], "deny": ["Bash(rm -rf:*)"] }, "model": "claude-sonnet-4-6" }
.claude/rules/ Modular conventions
  • Topic-specific markdown files instead of one giant CLAUDE.md
  • Covers style, testing, API design — can target specific files/paths
# code-style.md - Type hints required on all functions - Use dataclasses for config objects, not raw dicts - f-strings only, never .format() or % - Max function length: 40 lines
.claude/commands/ Slash commands
  • Custom reusable workflows, triggered like /project:fix-issue
  • Good for repeatable tasks: bug fixes, releases, audits
# fix-issue.md Given a GitHub issue number, reproduce the bug, write a failing test, fix the code, and confirm the test passes. Show the diff before committing.
.claude/skills/ Auto-triggered
  • Loaded automatically only when the task context matches
  • Keeps everyday context lightweight — deploy instructions don't load unless you're deploying
# skills/deploy/SKILL.md --- name: deploy-runbook-bot description: Use when deploying the runbook bot to AWS Lambda or ECS --- 1. Run `pip freeze > requirements.txt` 2. Build Docker image, push to ECR 3. Update Lambda via `aws lambda update-function-code`
.claude/agents/ Specialized sub-agents
  • A narrow-focus agent with its own isolated context and tool preferences
  • Useful for a dedicated security or code-review pass
# agents/security-auditor.md --- name: security-auditor description: Reviews code for security issues before merging --- Check for: hardcoded credentials, unsafe boto3 IAM scopes, injection risks in user-input-to-prompt paths.
.claude/hooks/ Event-driven safety
  • Scripts that run automatically before/after a tool executes
  • Blocks unsafe operations, automates linting and validation
# hooks/validate-bash.sh #!/bin/bash if [[ "$1" == *"rm -rf"* ]]; then echo "BLOCKED: dangerous command" exit 1 fi
None of this is required to start — Claude Code works fine with zero config. Add these pieces gradually as a project grows, the same way you'd add IAM policies and CI rules over time.
Reference structure based on a Claude Code project layout diagram. Adapted with an AWS RAG-bot example.