Skip to main content

Semantic Search

Implementing Vector Embeddings and Semantic Search in Pure Java

A complete implementation of a semantic search engine in pure Java — no external libraries. Covers TF-IDF vectorisation, cosine similarity, and document ranking by meaning. Explains the mathematics behind vector embeddings, how they power RAG and AI search systems, and provides a working query engine with annotated code and sample output. The same architecture used by Pinecone, Weaviate, and Elasticsearch — built from scratch.