AITeky Learn

AiTeky Original Interactive Learning & Practice Intermediate

Vector databases: similarity search, indexes, filters and memory

Find the nearest vectors by brute force, speed the search up with clusters and see exactly how much recall you trade, find out why a strict filter can break results, and size the memory for millions of vectors.

A vector database stores lists of numbers (vectors) that stand for the meaning of a text, an image or a product, and finds the stored vectors closest to a query vector. It is the lookup behind "similar products", semantic search and the retrieval step of chatbots that answer from your own documents.

The hard part is not the maths of "closest". It is doing it fast over millions of vectors, which forces trade-offs between speed, memory and accuracy. In this course you measure those trade-offs on a small data set you generate, with plain NumPy. The sizes for the big case in the last lesson are calculations, not benchmarks of any product.

  • Learn lessons explain one idea at a time and let you run it.
  • Industry ready lessons decide and justify, and end with interview questions.

You need basic Python and NumPy. The course on vector search and knowledge graphs in AI & Data Science shows how the embeddings themselves are made; here we look after them.

Locked. Sign up free

Learn

Understand each idea with everyday examples. No coding background needed.

  1. 01 30 min Free sample 🔒 AiTeky Pass Nearest neighbours by brute force Turn items into vectors, measure closeness with cosine similarity, find the top matches by comparing the query with every vector, and see that the work grows in step with the number of vectors, which is what a vector database exists to avoid.
  2. 02 40 min 🔒 AiTeky Pass Approximate search: look in a few clusters, not everywhere Group 8,000 vectors into clusters, search only the few clusters nearest to the query, and measure on real runs how much work you save and how many of the true nearest neighbours you still find, so that "approximate" becomes a number you can choose.
  3. 03 35 min 🔒 AiTeky Pass Filters and metadata: why "similar AND in stock" is harder than it sounds Combine similarity with a filter such as category or price, see how filtering after the search returns too few results when the filter is strict, and compare it with filtering before the search and with searching inside the filtered set.

Industry ready

Real problems from real jobs, and the questions interviewers ask about them.

  1. 04 40 min 🔒 AiTeky Pass On the job: sizing a vector index for five million products A marketplace wants "similar products" for 5 million items with 768-number embeddings and 8 GB of memory per server. Calculate the memory of each storage choice, measure what compressing the vectors costs in recall on a sample, pick a design, and write the plan for the platform team.

We use essential cookies to run the site. With your permission we also set one anonymous ID to count unique visitors, and analytics cookies to see which pages help learners. Cookie notice

Join AiTeky Learn. It's free.

Create a free account to track your progress, save items for later and get study suggestions.

Sign up free Log in