AI & Machine Learning

Generative AI

Step-by-step articles on Generative AI, part of our AI & Machine Learning collection.

  • 20 articles
  • 27 min of reading
  • 2 sub-topics
  • 10 Oct, 2026 last updated

Showing 20 articles

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
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
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
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
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