Skip to content

Using models well · Part 2 — The AI Dictionary

✕
0 XP

Structured output

Getting answers in a strict, machine-readable format like JSON or a fixed table.

When AI output feeds a spreadsheet, database or another program, prose won't do. You ask for (or, via APIs, enforce) a schema: exact field names, types and allowed values. Many APIs offer a structured-output mode that guarantees valid JSON matching your schema.

📝 Read the full lesson notes

Structured output

Getting answers in a strict, machine-readable format like JSON or a fixed table.

When AI output feeds a spreadsheet, database or another program, prose won't do. You ask for (or, via APIs, enforce) a schema: exact field names, types and allowed values. Many APIs offer a structured-output mode that guarantees valid JSON matching your schema.

Embeddings

Lists of numbers that represent meaning — texts about similar things end up close together.

An embedding model turns a sentence, document or image into a vector (a long list of numbers). Similar meanings land near each other in that space: "How do I reset my password?" sits right next to "I forgot my login."

Think of it like: A map where every idea has coordinates, and related ideas are neighbors.

Vector database

A database built to store embeddings and quickly find the most similar ones.

When you have thousands of documents chopped into chunks and embedded, you need to find the handful most relevant to a question in milliseconds. Vector databases (Pinecone, Weaviate, pgvector in Postgres, and others) do exactly that: "give me the 5 nearest neighbors to this question's embedding."

RAG (Retrieval-Augmented Generation)

Looking up relevant documents first, then having the model answer using them — grounded, current, citable.

RAG gives a model an open-book exam. When a question arrives, the system searches your documents (often with embeddings), pulls the most relevant passages into the prompt, and asks the model to answer from those passages, ideally with citations.

Think of it like: An open-book test: the model doesn't need to have memorized your company handbook — it just needs to find the right page.

Grounding

Tying a model's answer to real, provided sources — search results, documents, data — instead of memory.

A grounded answer is based on material the model was given in context and can point to. Web search in assistants, uploaded files, connected apps and RAG are all grounding techniques. It's the #1 defense against hallucination.

Part of 📖 The AI Dictionary in the free AI Bootcamp.