Skip to content
WebPortal
AI explained

How does a computer know that “notice period” and “contract termination” are related? The answer is embeddings, the technology behind every serious AI search.

· 1 min read

Embeddings and vector databases, explained without the maths

Classic search looks for words. If the contract says “termination” and you search for “cancellation”, you get nothing. Semantic search works differently.

A map of meaning

Imagine a huge map where every sentence is a point, and sentences with similar meanings sit close together regardless of wording. An embedding is a text’s coordinates on that map, expressed as a list of numbers.

What a vector database does

It stores those coordinates and quickly answers: “which points are closest to this one?” Your question becomes a point; the database returns the nearest document chunks. RAG is built on this. For many companies, PostgreSQL with pgvector is enough.

Why it’s useful

  • Synonyms and paraphrases.
  • Multiple languages: a Serbian and a German sentence with the same meaning land close together.
  • Similar items: “find quotes similar to this one”.

Limitations

Semantic search is poor at exact values such as invoice numbers, SKUs and tax IDs. Combining it with keyword search and filters (hybrid search) gives the best results.

More on this in What RAG is, and why it matters more than a “smarter” model and How to prepare company documents for AI search.