Tokens, embeddings, and vector databases are three related but different concepts used in modern AI applications. A token is a unit processed by a language model; an embedding is a numerical representation of content; and a vector database stores and searches those representations to retrieve semantically related information.

What is a token?

Language models do not process text exactly as humans see words on a page. A tokenizer splits input into tokens, which may represent whole words, parts of words, punctuation, or other text units. Token counts affect context-window usage, request limits, latency, and cost. One word is not always one token, and tokenization differs across models.

What is an embedding?

An embedding model converts content such as a sentence, paragraph, or image into a vector: a list of numerical values. The vector represents aspects of the content in a space where similar items can be compared mathematically. Texts with related meaning may have vectors that are close under a chosen similarity measure, even when they do not share the same keywords.

What does a vector database do?

A vector database stores embeddings and supports similarity search. An application converts a user’s query into an embedding, searches for nearby vectors, and retrieves the associated content or metadata. The vector store is not the language model and does not itself generate the final natural-language answer.

How these pieces fit into RAG

  1. Ingest source documents from a data source.
  2. Split documents into manageable chunks.
  3. Convert each chunk into an embedding using an embedding model.
  4. Store the vectors and their source references in a vector index.
  5. At query time, embed the user’s question and search for similar chunks.
  6. Pass retrieved context to a foundation model to generate a grounded response.

Amazon Bedrock Knowledge Bases can manage much of this ingestion and retrieval workflow. Chunking strategy matters: small chunks can improve precision, while larger or hierarchical chunks can preserve broader context. The right choice depends on document structure and the question types users ask.

Semantic search vs. keyword search

Search type How it matches Example
Keyword search Matches terms and indexed text Search for the exact phrase “refund policy”
Vector similarity search Compares embeddings for semantic similarity Search “Can I get my money back?” and retrieve a refund-policy passage
Hybrid search Combines keyword and vector signals Use both exact product codes and semantic intent

Exam traps

Test yourself

Question 1

An application must represent document chunks as numerical vectors so it can retrieve semantically similar passages. Which component creates those representations?

  1. Tokenizer only
  2. Embedding model
  3. Load balancer
  4. Speech synthesizer
Reveal answer

Correct answer: B. An embedding model converts content into numerical vectors.

Question 2

At query time, which component is responsible for storing vectors and finding similar vectors for a query embedding?

  1. Vector database or vector index
  2. Tokenizer
  3. Foundation model alone
  4. IAM policy
Reveal answer

Correct answer: A. The vector store indexes embeddings and performs similarity retrieval.

Key takeaway

Keep the sequence clear: tokenize text for model processing; create embeddings to represent meaning numerically; store and search those vectors in a vector index; then use retrieved context in RAG to support generation.

Related AWS topics

Amazon Bedrock Knowledge Bases · RAG vs. Fine-Tuning · Amazon OpenSearch Service

✦ CloudExamPro Premium

Ready for the AWS Certified AI Practitioner (AIF-C01)?

Move beyond memorizing terms. Practice with realistic, scenario-based questions and detailed explanations that help you understand the AWS AI services and concepts behind each answer.

6 Full-Length Exams390 practice questions
Detailed ExplanationsLearn why answers are right or wrong
Scenario-Based PracticeOriginal questions, not dumps
6 Months of AccessReview at your own pace
Get the AIF-C01 Practice Exams →Try the free AIF-C01 exam first ↗

Original practice questions. No dumps. No shortcuts.