Guided project
Lost and Found Search
Write the search behind a school lost-and-found board yourself, in real Python, with a real embedding model, and find out why the closest note is often not the one that helps.
About 1.5 h ·
4 stages · 12 steps
What you'll make
In 15 minutes: A real model searching a school lost-and-found board by meaning, for your own words, every score checked against torch.
What you'll find out about AI: The closest note isn't always the one that helps.
Make it yours: Write a board of your own (club notices, homework questions, the canteen menu), log 8 searches on it and see where its sure-match line has to go.
When you share: Search my school's lost and found by meaning. Can you fool it?
Step by step
Stage 1
Search the board (minutes 0-20)
A real model searching a school lost-and-found board by meaning, for your own words.
- Your search on the board — The lab searches the lost-and-found board for something you lost, and shows the closest notes with their scores.
- Read the scores — You saw what scores the right notes get, and what the page's "Sure match" banner says about them.
- Lost is not found — You found a note that scores high and doesn't help, and you can say why.
Stage 2
Write cosine yourself (minutes 20-45)
Your own cosine similarity, in plain Python, scoring the board and matching torch, even with the lengths left in.
- Read the kit's cosine — You can say what each line of `cosine` does, in your own words.
- Write my_cosine — The board is scored by your own cosine, and every note matches torch.
- Leave the lengths in — Your cosine works on vectors of any length, and you know what goes wrong without the division.
Stage 3
Your own pooling, and fool the board (minutes 45-70)
A note's 384 numbers made by your code, tested until a test can catch it; then a search that fools the board.
- Write my_pool — Your `my_pool` turns each note's token vectors into one vector, leaving out the padding, and every note says pooling ✓.
- Break it on purpose — You know whether the checks catch a mistake in your pooling, and you added a check because they didn't.
- Fool the board — You found a search the board gets confidently wrong, and you can say why the score fooled it.
Stage 4
Draw the line, and share (minutes 70-90)
Your own finding, with evidence: whether one sure-match line can tell right from wrong, on two boards.
- The sure-match line — A log of 8 searches on two boards, and your decision: where the sure-match line goes, or whether one line can work at all.
- Don't trust the top note — Your page helps the reader not to trust the top note blindly, and your log shows what it changed.
- Someone else tries it — Someone searched your board without help, and you changed one thing because of what they did.
Guardrails
- Your searches and notes are about school life and in English (the model learned English only). Invented notes only: no real names and no personal details.
- A score says how close two notes point, not whether a note is true or the one you need. Read the notes before you trust the top one.
- You write the search code; the agent explains and reviews. Ask it to write a line only after you tried, and it will say when it did.
- Nothing is downloaded or installed. The model, MiniLM, is already in your workspace.