AI & Python · Some Python
Build a search engine for your notes
Turn a folder of ideas into something you can actually find. Learn how meaning becomes a vector, then put it to work.
What you will make
A local semantic search prototype, tested with five questions of your own.
Before you start
Python functions, lists, and a computer where you can install Python packages.
Estimated time: 150 minutes. Free reading and open-source tools. Model downloads require internet and disk space; no paid API is required.
1. Give your notes a structure
Estimated time: 30 minutes.
Search needs a collection to search over. A list of small, meaningful passages is a useful starting point; keep a title or identifier so every result leads back to its source.
Python: data structures — Lists and dictionaries are enough to represent your first searchable collection.
Your challenge
Create a list of ten short notes. Give each note a unique ID, a title, and its text. Use invented or non-sensitive notes for this exercise.
Check your understanding
Can you retrieve a note by its ID without confusing it with another note?
A little hint
Start with two dictionaries in a list. Print each title and text before adding the other eight notes.
2. Find meaning beyond matching words
Estimated time: 60 minutes.
An embedding represents text as numbers. Similarity compares those representations. Similar wording and similar meaning overlap, but they are not the same thing—and a high score is not proof that an answer is correct.
Sentence Transformers: quickstart — The official examples connect text, embeddings, and similarity in one small workflow.
Your challenge
Follow the Sentence Transformer text example, then substitute your notes. Encode a question and sort the notes by similarity. Record the top three results.
Check your understanding
Does a paraphrased question find the right note even when it uses different words?
A little hint
First reproduce the three-sentence example. Inspect the embedding shape and similarity scores before changing the inputs.
3. Try to break your search
Estimated time: 60 minutes.
A useful search tool needs evidence about when it works. A tiny evaluation set makes failures visible and gives you a baseline for future changes.
Sentence Transformers: similarity examples — Use the documented scoring workflow as the baseline for your own experiments.
Your challenge
Write five questions and the expected note IDs before running search. Include one question your notes cannot answer. Record the actual results, three successes or failures, and one improvement you would try.
Check your understanding
Can you explain one failure without claiming the similarity score measures factual truth?
A little hint
Use a table with question, expected ID, top result, and your judgment. Keep the unanswered question even if its highest score looks convincing.
Enable JavaScript to use the private notebook and track self-reported completion. The lessons and source links above are available without JavaScript.