AIP-C01 practice question 15 of 15

A financial services company is creating a Retrieval Augmented Generation (RAG) application that uses Amazon Bedrock to generate summaries of market…

Full set: 127 questions
A financial services company is creating a Retrieval Augmented Generation (RAG) application that uses Amazon Bedrock to generate summaries of market activities. The application relies on a vector database that stores a small proprietary dataset with a low index count. The application must perform similarity searches. The Amazon Bedrock model’s responses must maximize accuracy and maintain high performance. The company needs to configure the vector database and integrate it with the application. Which solution will meet these requirements?
Answer options
A: Launch an Amazon MemoryDB cluster and configure the index by using the Flat algorithm. Configure a horizontal scaling policy based on performance metrics.
B: Launch an Amazon MemoryDB cluster and configure the index by using the Hierarchical Navigable Small World (HNSW) algorithm. Configure a vertical scaling policy based on performance metrics. Correct answer
C: Launch an Amazon Aurora PostgreSQL cluster and configure the index by using the Inverted File with Flat Compression (IVFFlat) algorithm. Configure the instance class to scale to a larger size when the load increases.
D: Launch an Amazon DocumentDB cluster that has an IVFFlat index and a high probe value. Configure connections to the cluster as a replica set. Distribute reads to replica instances.
Correct Answer:
B. Launch an Amazon MemoryDB cluster and configure the index by using the Hierarchical Navigable Small World (HNSW) algorithm. Configure a vertical scaling policy based on performance metrics.
Explanation

For a RAG application with a small dataset requiring high accuracy and performance, Amazon MemoryDB with the Hierarchical Navigable Small World (HNSW) algorithm is the optimal choice. MemoryDB is an in-memory database, providing the ultra-low latency needed for high-performance similarity searches. The HNSW algorithm offers an excellent balance between search speed and accuracy (recall), making it superior to exhaustive search methods like 'Flat' for performance-sensitive applications. Vertical scaling is a straightforward way to manage performance for a small but growing index.

Why Incorrect

A. The 'Flat' algorithm performs an exhaustive search, which provides perfect accuracy but has very poor performance (high latency) and does not scale well, violating the high-performance requirement.
C. While Amazon Aurora with pgvector is a valid option, an in-memory database like MemoryDB is purpose-built for lower latency, which is critical for maintaining high performance in a RAG application's retrieval step.
D. Amazon DocumentDB is a document-oriented database. For a pure vector similarity search workload as described, a specialized in-memory vector store like MemoryDB is a more direct and performant solution.

References

- AWS Database Blog

"Build AI-powered search in Amazon MemoryDB for Redis with vector search"

Nov 2023. This article highlights that HNSW indexes are "fast and memory-efficient" and provide a "good balance between search speed and search recall."

- Amazon MemoryDB for Redis Developer Guide

"Vector search in MemoryDB". The documentation describes the supported index types

noting that HNSW is an approximate nearest neighbor (ANN) algorithm suitable for low-latency

high-throughput use cases.

Scroll to Top