Skip to main content

What is semantic search?

The Harvard Chan AI Glossary

In our classes, we often pause to explain the ideas behind AI and the language used to describe it. These posts grew out of those conversations. They’re for anyone who would like to understand AI better, with no technical background assumed.

Semantic search finds information by looking for a match in meaning, rather than relying only on the same words appearing in a question and a document. “Semantic” simply means relating to meaning. The aim is to find what you are asking about, even when the writer used different language.

For example, searching for “How do I end my membership?” should ideally find a page titled “Canceling your subscription.” The phrases use different words but describe a similar intention. A search system that only counts matching words may struggle with that connection. A system trained to recognize similarities in language can often find it.

One common approach uses an embedding: a list of numbers that represents patterns in a piece of text. An AI model, meaning a computer system that has learned patterns from examples, produces these numbers. The model is trained so that texts with related meanings receive representations that are similar under a mathematical comparison.

The search system converts both the question and the stored documents into these number patterns. It then finds documents whose patterns are similar to the question’s pattern. Think of placing descriptions on a map where related ideas tend to sit near one another. The real calculation uses many more directions than a paper map, but the practical idea is finding nearby matches.

Semantic search does not necessarily write an answer. It may simply return a ranked list of documents. Another AI system can use those documents to compose a response, but that is an additional step. Finding information and explaining it are different jobs, with different opportunities for mistakes.

In a clinical-record search, “shortness of breath” and “dyspnea” may be useful matches even though their wording differs. But “no shortness of breath” must not be treated as evidence that the symptom is present. Patient identity, dates, negation and exact medication codes still matter, which is why production systems usually combine semantic search with exact keyword matching. A retrieved passage is a candidate to inspect, not an established clinical finding.

Sources: Sentence Transformers — Semantic Search; Reimers and Gurevych — Sentence-BERT.

If you would like to find out more about AI and improve your leadership skills, consider the AI in Health Care Certificate of Specialization from the Advanced Learning Academy at Harvard T.H. Chan School of Public Health. You can take an individual course or work toward the full certificate.


AI is a fast-moving field. This explanation reflects our class discussions and related material at the time of writing. Terminology, capabilities and tools may change.

For suggested additions or corrections, please email me at tpanch@hsph.harvard.edu.

Dr. Trishan Panch
Program Director, AI in Health Care
Harvard T.H. Chan School of Public Health — Advanced Learning Academy