Idea · Aug 29, 2026

Build-Your-Own Vector Search Engine

Students implement a complete vector similarity search engine from flat brute-force cosine search to HNSW approximate nearest-neighbor search, wrapped in a Flask API, learning the algorithms and tradeoffs underlying every modern RAG and semantic search system.

What it would do

As retrieval-augmented generation becomes central to AI applications, CS students need to understand how vector search actually works rather than just calling an SDK. This four-milestone assignment builds understanding from the ground up: implement cosine similarity and a flat in-memory embedding store; add a simple inverted-file index for metadata filtering; implement the Hierarchical Navigable Small World (HNSW) graph for approximate nearest-neighbor search with tunable recall-speed tradeoffs; and wrap the engine in a Flask HTTP API with file-based persistence, then benchmark it against ChromaDB or Qdrant on a 100K-snippet Wikipedia embedding dataset. Students submit benchmark plots (Recall@K vs. query latency) as part of their deliverable, forcing them to reason about the tradeoffs their design choices create. A C++ variant using the CSS 342/343 toolchain adds an optional systems-programming dimension.

Key features

  • Four scaffolded milestones: flat cosine search, inverted-file index, HNSW graph, and REST API with persistence
  • Pre-embedded benchmark dataset (Wikipedia 100K snippets, 384-dimensional sentence-transformer embeddings) ready to download
  • Benchmarking harness computing Recall@1/5/10 and median query latency against a reference database
  • Optional C++ variant using Eigen for vector math and Google Test for unit testing, compatible with the CSS 342/343 toolchain

More in Algorithms & Data Structures

Two-Language Concept Mirror

Show the same CS concept implemented side-by-side in three languages; Claude explains conceptual equivalences and differences, not just syntax differences.

Algorithms & Data StructuresTeaching toolMediumSep 14, 2026

State Machine Story Engine

Students implement a finite state machine engine from scratch in TypeScript, then use it to build and publish an original interactive narrative game - earning deep FSM intuition through a creative deliverable peers can play.

Algorithms & Data StructuresClass assignmentLargeSep 12, 2026

Notional Machine Animator

A step-through code execution visualizer where students see memory boxes, the call stack, and heap arrows update expression by expression, then compare their predicted model to what actually happened.

Algorithms & Data StructuresTeaching toolMediumSep 7, 2026

Observable Algorithm Visualizer

A browser environment where students implement standard algorithms in JavaScript and a code instrumentation layer automatically generates step-by-step animated visualizations driven by the student's actual code execution, not hardcoded animations.

Algorithms & Data StructuresClass assignmentLargeAug 12, 2026

All 27 ideas in Algorithms & Data Structures →