AI Fundamentals — How Modern AI Works›Giving AI your knowledge · Cheat sheet & self-check
Learning Hub / AI Fundamentals & AI-Assisted Engineering / AI Fundamentals — How Modern AI Works

Giving AI your knowledge · wrap-up

Cheat sheet & self-check

Every command from this section on one page.

05 · Embeddings: meaning as numbers

Terms

VectorAn ordered list of numbers, e.g. [0.12, -0.53, 0.88, …]
EmbeddingA vector that represents the meaning of a text (or image, or audio)
DimensionsHow many numbers in the vector; commonly a few hundred to a few thousand
Embedding modelA model whose job is to turn text into embeddings (not to chat)
Cosine similarityA score for how closely two vectors point the same way; near 1 = similar meaning
Semantic searchFinding text by meaning instead of by matching words

06 · Vector databases

Terms

Vector databaseStores vectors with their text and metadata, and finds the nearest ones to a query vector
Nearest-neighbour searchFind the stored vectors closest to the query vector
ANN (approximate nearest neighbour)Very fast search that returns almost-always the true nearest results
Index (e.g. HNSW)The structure that makes ANN fast, like a map of shortcuts between points
Top-kHow many nearest results to return, e.g. the best 5
Metadata filterRestrict results by fields such as product, date, language, or who may see them
Hybrid searchSemantic (vector) search combined with keyword search

Common options

pgvectorExtension that adds vector search to PostgreSQL
OpenSearch / ElasticsearchSearch engines with vector search alongside keyword search
Qdrant, Weaviate, Milvus, ChromaPurpose-built vector databases, self-hosted or managed
Pinecone and cloud servicesFully managed vector search

07 · RAG: retrieval-augmented generation

The pipeline

IngestCollect documents, clean them, split into chunks
Embed and storeTurn each chunk into a vector; store with text and metadata
RetrieveEmbed the question; find the nearest chunks (with permission filters)
AugmentPut the chunks into the prompt with instructions
GenerateThe LLM answers from the chunks and cites them

Quality levers

Chunk size and overlapSmall enough to be specific, large enough to keep context
Hybrid searchAdd keyword search for codes, names and exact terms
Re-rankingA second model re-orders retrieved chunks by relevance
'Answer only from the sources'Instruction that reduces made-up answers
Evaluation setReal questions with known answers, run after every change