All field notes

AI field guide2 min read

Embeddings: build semantic search without losing exact meaning

Learn what vectors can represent, where similarity helps, and why permissions, identifiers, and evaluation still need ordinary engineering.

An X-ray image of an Arduino chip showing its fine bonding wires.
Photo by Mathew Schwartz on Unsplash · LicenseEditorial photograph, not a technical diagram.
01

Represent meaning as a searchable signal

An embedding is a numerical representation produced by a model. Sentence-BERT demonstrated sentence representations that can be compared using cosine similarity. Such representations make it practical to search for related language without requiring exactly the same words.

Similarity is not equivalence, truth, or permission. Two passages may discuss the same topic while making opposite claims. A document can be relevant and outdated. The vector score is one signal in a retrieval system, not a complete answer to whether a source should be used.

Technical foundation: Reimers and Gurevych: Sentence-BERT

02

Choose the unit that a person would need

Embedding an entire manual into one vector can hide the specific passage that answers a question. Splitting every sentence independently can remove necessary context. Start with meaningful units such as a heading and its explanatory paragraphs, then evaluate whether those units answer real user questions.

Store useful metadata with each unit: document identifier, section title, revision, language, and access policy. Keep the original text available for inspection. If someone asks why a result appeared, the interface should show the passage, not just an unexplained score.

03

Do not replace exact matching everywhere

A customer searching for an order code or a component name often needs exact matching. A customer describing a visual style may benefit from semantic matching. A combined search can use both, but the combination needs evaluation rather than an arbitrary assumption that vectors always improve results.

Imagine a catalogue with a theme called Signal. A semantic query for communication tools might surface it, but the title alone does not prove it includes messaging features. Product metadata should distinguish marketing language from actual capabilities. Results should explain those capabilities accurately.

04

Plan for model and index changes

Document and query representations must follow the compatible model configuration. Changing an embedding model may require rebuilding the index; mixing incompatible vector spaces can produce meaningless rankings. Track the model identifier and preprocessing revision with the indexed content.

Updates and deletions matter too. A removed private document should not remain retrievable because its vector survived in an old index. Test the full lifecycle: create a source, update its facts, change its permissions, and delete it. Check which results each user can retrieve after every step.

05

A semantic-search launch checklist

  • Evaluate real queries, including exact identifiers and ambiguous wording.
  • Preserve source text, revision, and section metadata.
  • Apply authorization before returning content to the model or user.
  • Version embeddings and rebuild incompatible indexes deliberately.
  • Test updates, revocations, and deletion propagation.