AI search for freeCodeCamp lessons

Exact words help with some searches. Similar meaning helps with others. I combined both in a RAG application over public freeCodeCamp lessons.

How it works

  • BM25 ranks exact terms. Sentence embeddings find related wording.
  • Reciprocal rank fusion combines the two rankings without comparing their different score scales.
  • The app keeps one best chunk per lesson, passes those excerpts to an LLM and prints the lesson links beside the answer.
View the flow
Chunk lessons, rank with BM25 and embeddings, fuse results, choose one chunk per lesson and generate an answer with source links.
Application flow

Limits

One chunk may miss another useful passage in the lesson. The model is asked to cite its sources, but the code does not verify those citations.

Python, NumPy, sentence-transformers, OpenAI Responses API