In production systems, hardcoding a fixed set of few-shot examples can waste tokens and fail to represent the specific context of the user's input.
Dynamic Few-Shot Selection solves this by matching the user's input against an indexed vector database of examples at runtime.
By running a similarity search (e.g. cosine similarity over embeddings) on the query, the application retrieves the top-k most similar pairs of inputs and outputs, and injects them dynamically into the prompt before calling the LLM.