Level 7 · Artificial Intelligence and Intelligent Automation · Course 7.2 AI Application Engineering
Module 85: Embeddings and Vector Search
Goal: search by meaning rather than exact words: turn text into embeddings, measure how similar two pieces of text are, store and search embeddings efficiently in PostgreSQL, build semantic search over your company documents, and check that it finds the right things.
You'll need: your PostgreSQL skills (Level 5), your assistant backend (Module 84), a set of your company's approved documents (policies, product information, FAQs) and an embeddings API or a local embeddings model.
Lessons
- 1Embeddings15–25 minutes✓
- 2Similarity15–25 minutes✓
- 3Vector indexes15–25 minutes✓
- 4Semantic search15–25 minutes✓
- 5Search quality15–25 minutes✓
🛠️Module practice: Semantic search over approved knowledge
- Embeddings for your approved documents, with one model used consistently.
- A pgvector table with an HNSW index and metadata (document, department, visibility).
- An indexing function that keeps chunks in step with document updates and withdrawals.
- A hybrid search endpoint (semantic plus keyword) filtered by the user's permissions.
- A retrieval test set with hit rate and MRR for each search method, and one measured improvement.
✅Module check
Explain in a few sentences, in your own words:
How does semantic search work, and how do you know it works well?
Show a good answer
A good answer mentions: embeddings turn text into vectors where similar meanings are close, produced by one consistent embedding model (with data rules respected); similarity is measured by cosine (or dot product) and means relatedness, not correctness; vectors are stored with an ANN index such as HNSW, conveniently in PostgreSQL with pgvector so metadata and permissions filter in SQL; semantic search embeds the question and finds nearest chunks, combined with keyword search for exact terms, over only approved, up-to-date material; and quality is measured on a retrieval test set with hit rate and MRR, improved one change at a time, in the languages users actually write.
📝Module quiz
10 questions · 10 marks each · 100 marks in all · pass mark 70% · retry as often as you like ·
