Topic

AI & Machine Learning

Hand-picked tutorials, guides and examples on AI & Machine Learning — explained simply.

  • 40 articles
  • 49 min of reading
  • 2 sub-topics
  • 10 Oct, 2026 last updated

Showing 40 articles

Tool Use & Agent LoopsNew 2 min read

What Is an AI Agent? The Agent Loop Explained

"Agent" is used for many things, but the core idea is simple: an AI agent is an LLM that decides which tools to call, sees the results, and keeps going until the task is done . Your code runs the tools; the model chooses what to do next. The loop Send the user...

09 Oct, 2026 Author 1.34K 75
Read article
Model Context ProtocolNew 1 min read

Build Your First MCP Server in TypeScript

In this tutorial you'll build an MCP server that exposes a get_github_repo tool, and run it over stdio so desktop AI apps can launch it. 1. Set up the project mkdir github-mcp && cd github-mcp npm init -y npm install @modelcontextprotocol/sdk zod npm install -...

20 Sep, 2026 Author 746 109
Read article
Model Context Protocol 1 min read

Build an MCP Server in Python with FastMCP

The official Python SDK includes FastMCP , a high-level API where type hints and docstrings become the tool schema. A working server takes only a few lines. 1. Create the project uv init notes-mcp && cd notes-mcp uv add "mcp[cli]" 2. Write the server # server....

02 Sep, 2026 Author 184 138
Read article
RAG & Vector Search 1 min read

Vector Search in PostgreSQL with pgvector

You don't always need a separate vector database. The pgvector extension adds a vector type, distance operators and approximate indexes to PostgreSQL, so embeddings live next to the rest of your data. Set up the table CREATE EXTENSION IF NOT EXISTS vector; CRE...

16 Aug, 2026 Author 1.41K 56
Read article
Model Context Protocol 1 min read

MCP Resources and Prompts: Beyond Tools

Most MCP tutorials stop at tools, but the protocol has three server primitives, each controlled by a different party: Tools - the model decides when to call them. Resources - the application (or user) decides what data to attach. Prompts - the user explicitly...

15 Aug, 2026 Author 908 74
Read article
LLM APIs & Prompting 1 min read

Counting Tokens and Estimating LLM API Costs

LLM APIs bill by the token , a chunk of text that is often a word or part of a word. Input and output tokens are priced separately, and output tokens cost several times more than input tokens. Count tokens before you send Token counts depend on the model's tok...

11 Jul, 2026 Author 1.31K 43
Read article
Model Context Protocol 1 min read

Remote MCP Servers with Streamable HTTP

Stdio servers run on the user's machine. A remote MCP server runs on your infrastructure and is reached over HTTP, which is how SaaS products expose their tools to AI apps. The current HTTP transport is Streamable HTTP : one endpoint that accepts JSON-RPC over...

10 Jul, 2026 Author 228 96
Read article
RAG & Vector Search 1 min read

Adding Citations to RAG Answers

Users trust an answer more when they can click through to the source. Citations also make hallucinations easy to spot: an unsupported claim has nothing to point at. Option 1: Ask for chunk IDs Answer the question using only the sources below. After each senten...

23 Jun, 2026 Author 1.13K 65
Read article
Model Context Protocol 1 min read

Writing an MCP Client in TypeScript

Host apps like Claude Desktop include an MCP client, but you can embed one in your own app too. That lets your product use any MCP server as a tool provider. Connect and list tools import { Client } from '@modelcontextprotocol/sdk/client/index.js'; import { St...

21 Jun, 2026 Author 292 67
Read article
LLM APIs & Prompting 1 min read

Few-Shot Prompting: Teaching an LLM by Example

Few-shot prompting means showing the model a handful of input/output examples before the real input. It is the fastest way to teach a specific style or labelling scheme without fine-tuning. A classification example Label each commit message as feat, fix, docs...

05 Jun, 2026 Author 1.42K 124
Read article
RAG & Vector Search 1 min read

How to Evaluate a RAG Pipeline

Without evaluation, every change to chunking, embeddings or prompts is a guess. A small labelled dataset turns RAG tuning into engineering. 1. Build an evaluation set Collect 50-200 real questions from logs, support tickets or users. For each, record the ID(s)...

05 Jun, 2026 Author 541 68
Read article
Tool Use & Agent Loops 1 min read

Managing Context in Long-Running AI Agents

Every turn of an agent adds to the conversation: tool calls, large tool results, the model's replies. Long tasks can grow past the context window, and even before that, a bloated context makes the model slower, more expensive and less focused. 1. Keep tool res...

04 Jun, 2026 Author 790 122
Read article
LLM APIs & Prompting 1 min read

Sending Images and PDFs to an LLM API

Modern LLMs read images and PDFs as well as text. That makes it easy to build features like "extract the line items from this invoice" or "explain this error screenshot". Image from a URL const response = await client.messages.create({ model: 'claude-opus-5-5'...

30 Apr, 2026 Author 1.25K 44
Read article
Tool Use & Agent Loops 1 min read

Testing and Debugging AI Agents

Agents are non-deterministic, so traditional "input X gives exactly output Y" tests only go so far. A solid testing strategy combines normal tests for your code with task-level evaluations of the agent's behaviour. 1. Unit-test the tools Tools are ordinary fun...

29 Apr, 2026 Author 458 43
Read article