- EmbeddingA token or a text turned into a vector.
- Inside the model, each token ID is looked up in an embedding table and becomes a vector of numbers that encodes meaning. Embedding APIs expose the same idea for whole texts: similar meanings land close together, which is what powers semantic search and RAG.
- Vector / similarity searchFinding by meaning rather than keyword.
- Store embeddings, then compare a query's vector against them (usually by cosine similarity) to retrieve the closest texts.
- RAG (Retrieval-Augmented Generation)Fetch first, then answer.
- Retrieve relevant passages, paste them into the prompt, and let the model answer from them. It trades tokens for accuracy — which is exactly why token counting matters.
- Prompt engineeringDesigning the input so the output is reliable.
- Being specific, showing examples, stating the output format, and putting constraints where the model will actually honour them. It is an editing discipline: every instruction costs tokens on every single request.
- System promptThe standing instructions.
- Sent ahead of the conversation to set role, tone and rules. It is re-sent on every turn, so its length is a fixed tax on the whole app.
- Few-shot examplesTeaching by demonstration.
- Two or three worked examples in the prompt usually beat a paragraph of description — and cost fewer tokens than people expect if you keep them short.
- TemperatureHow adventurous the sampling is.
- 0 is near-deterministic and best for extraction and classification; higher values add variety and are better for drafting and ideation.
- StreamingTokens arriving one at a time.
- The model generates left to right, so the response can be rendered as it forms. That is why partial words sometimes flash in the UI.
- HallucinationFluent and wrong.
- The model predicts plausible next tokens; plausibility is not truth. Grounding the prompt in retrieved facts is the main mitigation.