# search

A Go library for embedded vector search and semantic embeddings, with an exact cosine-similarity index and optional local (llama.cpp) or cloud (OpenAI-compatible) embedding providers.

search is a Go library providing an exact cosine-similarity vector index for small and medium datasets, along with optional embedding providers. The core search package handles vector indexing, search and persistence and has no dependency on any embedding backend.

A separate llama module adds local GGUF embeddings through llama.cpp using purego, and a separate openai module adds text embeddings through any OpenAI-compatible API, including OpenRouter, using only the Go standard library at runtime. Each module has its own go.mod and go.sum, so importing the core search package pulls in neither embedding dependency.

The library requires Go 1.27 or newer, normalizes vectors when they are added or searched, and returns results ordered by descending cosine similarity. Changing embedding models requires re-embedding the whole dataset, even when the vector dimensions still match.

Website: https://github.com/kelindar/search
