Favicon of chromem-go

chromem-go

An open-source vector database that runs inside Go apps, with optional disk storage and embedding support for Ollama, LocalAI and hosted APIs.

chromem-go is a vector database that runs inside your Go application, so developers can add semantic search or retrieval augmented generation (RAG) without maintaining a separate database server. It stores text alongside embeddings and retrieves related documents for use in LLM answers. Its focus is ordinary application workloads rather than collections containing millions of documents.

The library has no third-party dependencies. Its interface takes inspiration from Chroma, with additional methods suited to Go, but chromem-go is an independent database. It's open source under the Mozilla Public License 2.0 (MPL-2.0).

Storage and search run within your app. Embeddings can come from local services such as Ollama, llmman and LocalAI, or you can supply existing vectors and custom embedding functions. OpenAI is the default embedding provider and requires an API key; hosted alternatives include Azure OpenAI, GCP Vertex AI, Cohere and Mistral. Choosing a hosted provider sends embedding requests outside your machine.

Search uses exact cosine similarity and supports filters for matching metadata or text that contains or excludes a given string. Adding and querying documents can use multiple CPU threads. Beyond RAG, the database can support text and code search, recommendations, classification and clustering.

Documents can stay in memory or persist to disk. Whole-database exports and imports support compressed backups and optional AES-GCM encryption, with reader and writer interfaces that can connect backups to S3 or other blob storage.

The project remains in beta and warns that releases before 1.0 may break compatibility.

Similar to chromem-go