Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu

Run vector similarity search, including storing embeddings, semantic retrieval, and implementing retrieval-augmented generation (RAG) patterns by using metadata filter

A worked example

Multiple answers

A RAG application uses Azure Database for PostgreSQL with the pgvector extension as its retriever. Document chunks and their embeddings are stored in the document_chunks table. The retrieval query is shown in the exhibit.

You run the query against a labelled evaluation dataset. Precision is acceptable, but recall is low, and the LLM often gives incomplete answers because relevant chunks are missing from its context.

You need to improve recall by changing only the retrieval query. The existing chunks must not be re-split or re-ingested.

SELECT c.id, c.content, c.embedding <=> $1 AS distance FROM document_chunks c WHERE c.embedding <=> $1 < 0.3 ORDER BY c.embedding <=> $1 LIMIT 3;

Which two changes should you evaluate together to improve recall? Each correct answer presents part of the solution.

Choose 2 answers.
Why

Recall measures how much of the relevant content retrieval finds. Raising the distance cutoff allows more chunks to qualify, while increasing LIMIT allows more qualifying chunks into the LLM context. These are complementary recall-tuning changes, but their actual benefit must be measured against the labelled evaluation dataset. Tightening the cutoff or reducing LIMIT further restricts retrieval, and re-chunking is ruled out.

Practise this topic until it's automatic.

Ten questions a day, every answer explained, and misses that come back until you beat them.

Start free