Programming Languages & Foundations

Programming foundations for AI agents — Python, async, TypeScript, prompts, structured output, and REST integrations. Each topic is a structured learning unit with build projects and an AI agent lens.

AI Agent Developer Roadmap → Programming Languages

Machine-readable version: ihatereading.in/roadmap/ai-agent-development/programming-languages.json

🤖 How agents use programming foundations

  • Python runs most agent orchestration, RAG pipelines, evals, and backend workers.
  • JavaScript/TypeScript powers agent UIs, streaming chat, browser agents, and Vercel AI SDK apps.
  • Async execution enables parallel tool calls, multi-agent runs, and concurrent research.
  • Structured output and prompts are the control plane every framework assumes you understand.

Topics & questions

Python Fundamentals

essentialbeginnerprogramming foundation

🤖 How agents use Python

  • LLM orchestration and agent loops
  • Data processing before/after tool calls
  • Agent framework SDKs and RAG pipelines
  • Offline evaluation and batch jobs

Learn

  • Python syntax and data structures
  • Virtual environments and dependency management
  • Functions, modules, and packages
  • Reading API docs and SDK examples

Why it matters

  • Most agent frameworks are Python-first (OpenAI Agents SDK, Pydantic-AI, smolagents, LangGraph).
  • RAG scripts, eval harnesses, and data prep are overwhelmingly written in Python.
  • Largest ecosystem of agent tutorials and production examples.

Used in

  • agent-frameworks
  • rag-pipelines
  • tool-calling
  • evaluation
  • observability

What to learn next

  • async-python
  • structured-output

Projects

Beginner

CLI script that loads an API key from env and prints a structured JSON object from a hard-coded user question.

Skip if: You already ship production Python services daily.

Async Python

essentialintermediateprogramming foundation

🤖 How agents use async

  • Parallel tool calls in one agent turn
  • Multi-agent execution without serial waiting
  • Concurrent web research and API fan-out

Learn

  • async/await
  • asyncio
  • concurrency vs parallelism
  • Tasks and gather
  • Queues and backpressure basics

Why it matters

  • Agent frameworks perform concurrent tool calls.
  • LLM and HTTP API calls are mostly I/O bound.
  • Multiple tools may need to run simultaneously without blocking the event loop.

Prerequisites

  • python-fundamentals

Used in

  • tool-calling
  • agent-orchestration
  • parallel-research
  • browser-agents

What to learn next

  • rest-apis
  • tool-calling

Projects

Beginner

Research agent that searches 5 sources simultaneously with asyncio.gather and merges results.

Skip if: You already build production async Python services.

JavaScript / TypeScript

corebeginnerprogramming foundation

🤖 How agents use JavaScript

  • Agent UIs and embedded copilots
  • Browser agents and computer-use frontends
  • Server-side agents on Node/Edge
  • Streaming and web integrations

Learn

  • Modern ES modules
  • TypeScript types for API responses
  • Fetch and streaming responses
  • Next.js or Vite app structure

Why it matters

  • Vercel AI SDK and OpenAI Node SDK are TypeScript-first.
  • Most customer-facing agent products need a web UI.
  • Browser automation and in-app agents often live in the JS stack.

Used in

  • agent-ui
  • browser-agents
  • streaming-chat
  • vercel-ai-sdk

What to learn next

  • rest-apis
  • structured-output

Projects

Beginner

Streaming chat widget that renders tokens as they arrive from the Vercel AI SDK.

Skip if: You only build backend Python agents with no web UI.

Prompt Engineering Fundamentals

essentialbeginneragent control

🤖 How agents use prompts

  • Defining agent role and tool-use policy
  • Few-shot examples for structured tasks
  • Recovery prompts after tool errors

Learn

  • Zero-shot vs few-shot prompting
  • Chain-of-thought when appropriate
  • System vs user messages
  • Guardrails and refusal handling

Why it matters

  • Every agent framework assumes you can steer model behavior with prompts.
  • Tool selection and planning quality depend on clear instructions.
  • Bad prompts cause silent failures more often than bad code.

Prerequisites

  • python-fundamentals

Used in

  • tool-calling
  • planning
  • evaluation
  • multi-agent-handoffs

What to learn next

  • structured-output
  • tool-calling

Projects

Beginner

Prompt template library with 3 variants (strict, creative, tool-first) tested on the same user task.

Skip if: You already run production prompt evals with golden datasets.

Structured Output

essentialintermediateagent control

🤖 How agents use structured output

  • Tool argument generation
  • Planner → executor handoffs
  • Extracting entities for RAG metadata

Learn

  • JSON schema constraints
  • Pydantic models in Python
  • Zod schemas in TypeScript
  • Native structured-output modes on providers

Why it matters

  • Tool calls require parseable arguments.
  • Downstream code cannot trust free-form prose.
  • Evals and logging need consistent fields.

Prerequisites

  • python-fundamentals
  • prompt-engineering

Used in

  • tool-calling
  • data-enrichment
  • agent-memory
  • evaluation

What to learn next

  • rest-apis
  • tool-calling

Projects

Beginner

Agent that converts messy research notes into a JSON content brief (title, audience, outline, CTAs).

Skip if: You already enforce schemas on every model response in production.

REST APIs & Webhooks

essentialintermediateintegration

🤖 How agents use REST

  • Tool implementations (CRM, calendar, search)
  • Webhook-driven agent continuations
  • Human-in-the-loop approvals via your backend

Learn

  • HTTP methods and status codes
  • Auth headers and API keys
  • Webhooks and idempotency
  • Error handling and retries

Why it matters

  • Most agent tools are thin wrappers around REST APIs.
  • Agents live or die by real-system integration.
  • Webhooks connect long-running agent jobs to your product.

Prerequisites

  • python-fundamentals
  • async-python

Used in

  • tool-calling
  • crm-integration
  • payments
  • scheduling

What to learn next

  • llm-providers
  • tool-calling

Projects

Beginner

Small agent: user question → LLM selects API → HTTP request → tool result → LLM → final answer.

Skip if: You already design and operate production API integrations.

AI agent development is applied software engineering, not machine learning research. You need strong programming fundamentals and the specific skill of getting reliable, structured output from a model — not a PhD in mathematics.

Core concepts

  1. Python fundamentals: The default language for agent frameworks — OpenAI Agents SDK, Pydantic-AI, smolagents, Strands, and LangChain/LangGraph are all Python-first. Python Docs
  2. Async Python: Agent loops make repeated model and tool calls; asyncio, async/await, and concurrent tool execution are used constantly in every framework's real-world examples. Real Python: Async IO
  3. TypeScript/JavaScript: The second language worth knowing — Vercel AI SDK, the OpenAI Node SDK, and most web-facing agent products (chat widgets, voice agents) are TS-first. Vercel AI SDK Docs
  4. Prompt engineering fundamentals: Zero-shot vs few-shot prompting, chain-of-thought, and structured-output prompting are the base skill every framework assumes you already have. Anthropic: Prompt Engineering
  5. Working with structured output: Getting a model to reliably return JSON matching a schema — via Pydantic models, Zod schemas, or native structured-output modes — underpins every tool call you'll ever write. OpenAI: Structured Outputs
  6. REST APIs & webhooks: Agents live or die by how well they integrate with real systems — most tools you give an agent are thin wrappers around a REST API.

What Is It?

This chapter lists software foundations for agent developers: languages, async, APIs, structured outputs, and testing habits.

Each linked unit is a mini learning path with projects framed through an agent lens.

You are learning to build systems that call models, not to train foundation models from scratch.

Why Should I Care?

Tool loops are just HTTP, retries, parsing, and state — boring code that must be correct.

Hiring managers still filter on Python/TS fluency even when the title says 'AI'.

Real World Analogy

Calling an LLM without coding fundamentals is like driving a Tesla without knowing where the brakes are — smooth until something unexpected appears.

Visual Mental Model

text
Python/TS basics
     -> HTTP/JSON
     -> async I/O
     -> structured outputs

Beginner Explanation

Solid Python (or TypeScript), async HTTP, JSON, and typing/validation libraries underpin every agent SDK. Prompting sits on top of this, not instead of it.

Smallest Possible Example

python
import httpx

async def ping(url: str) -> int:
    r = await httpx.AsyncClient().get(url)
    return r.status_code

Common Mistakes

❌ Copy-pasting agent SDK samples without reading async errors.

Hidden blocking calls stall your whole loop under load.

❌ Trusting model JSON without validation.

Use Pydantic or schema checks before acting on tool args.

❌ Ignoring git because 'it's just prompts'.

Prompts and tool manifests are production config — version them.

Real Project Example

FastAPI services wrap agent runners at many startups.

TypeScript agent SDKs from OpenAI target full-stack teams shipping on Node.

Build This Mini Project

Write an async function that fetches JSON from an API, validates one field with Pydantic, and logs structured output.

Interview Question

Why Python for agents?

Most agent SDKs, notebook tooling, and ML-adjacent libraries are Python-first; async HTTP and validation ecosystems are mature; teams iterate quickly — TS is the common second language for web-facing agents.

Key Takeaways

  • Agents are applied software engineering.
  • Async HTTP + validation are daily tools.
  • Learn prompting after code basics.
  • Use chapter units as spaced practice.

Resources

YouTube learning

Core concepts from video walkthroughs:

The 60-second story

You are hiring a small office. The work is not “be clever in a chat box.” The work is: read a request, call a system, check the reply, try again. Python is the office most agent kits already moved into. The OpenAI Agents SDK, Pydantic-AI, smolagents, Strands, LangGraph — the lights are already on in that language. Learning Python here is not a detour. It is showing up to the building where the tools hang.

Async is the difference between a clerk who stares at the hold music and a clerk who files something else until the model or the API speaks. Agent loops are mostly waiting: model, tool, model, tool. If each wait freezes the process, one user owns the office.

TypeScript is the second desk, closer to the website. Chat widgets, Vercel’s AI SDK, a lot of product UI — that desk speaks JavaScript with labels. You do not need to betray Python. You need to recognize the same loop wearing a different badge.

Prompting is how you brief the new hire on day one. Zero-shot is “you know this job.” Few-shot is “here are three good tickets.” Structured output is “do not write me an essay; fill this form.” Every tool call you will ever trust starts as a form, whether the form is a Pydantic model, a Zod schema, or the provider’s structured mode.

REST and webhooks are the loading dock. Most “tools” are a thin coat around an HTTP call. If the dock is sloppy, the brilliant hire just sends the wrong crate faster.

Map the office.

  • Python is the main floor.
  • async/await is not staring at hold music.
  • TypeScript is the desk that faces the product.
  • A prompt is the brief.
  • Structured output is a form, not a paragraph.
  • A tool is often a REST call in a jacket.
  • A webhook is the loading dock calling you back.
python
async def handle(user_text: str) -> dict:
    return {"reply": user_text.strip(), "ok": True}

Tiny, and it already shows the two habits: the function can pause later, and the result has a shape. When you swap the body for a model call, the shape should stay.

These skills sit under every framework because the frameworks assume them. A kit cannot teach you what a form is and also be the thing that retries the form. People skip this page, install a framework, and then debug a string they wish was JSON.

Mental model: an office where the brief is a form and the phone calls are allowed to wait. Python runs the floor. Types keep the form honest. Async keeps one call from closing the office.

If you can say “the model fills a form, the tool hits an API, and the loop should not freeze while it waits,” you have the foundation the rest of the roadmap stands on.

Threads in the same domain as this chapter — go deeper on iHateReading without leaving the roadmap.

Smallest AI Agent cover

Smallest AI Agent

Minimal file-reading agent to learn LLM tool loops without framework magic.

Python AI agent SDKs in 2026: OpenAI vs Pydantic-AI vs smolagents vs Strands cover

Python AI agent SDKs in 2026: OpenAI vs Pydantic-AI vs smolagents vs Strands

Same three-tool agent in four frameworks — pick by execution model and testing needs.

AI Agent cover

AI Agent

What agents are and how they differ from a single chat completion.

Jev, explained like you're five (then like you're building with it) cover

Jev, explained like you're five (then like you're building with it)

System One decision models for fast, typed judgments inside software.