chromem-go

An embedded vector database for Go that supports local embeddings through Ollama and LocalAI, with optional disk persistence.

chromem-go is a vector database for Go developers adding semantic search or retrieval augmented generation (RAG) to an application. It runs inside the app, so it doesn't need a separate database server.

  • Search and retrieval: Find related text using exact cosine similarity, with filters for metadata matches and text that contains or excludes a string.
  • Embedding choices: Use Ollama, llmman or LocalAI for local embeddings, supply existing vectors, or connect a custom embedding function.
  • Storage and backups: Keep documents in memory or persist them to disk, and export or import the database with optional compression and AES-GCM encryption.
  • Other uses: Build text and code search, recommendations, classification or clustering around stored embeddings.

The library is open source under MPL-2.0 and has no third-party library dependencies. Its interface takes inspiration from Chroma, but it's an independent database. Adding and querying documents can use multiple CPU threads; its focus is common application workloads rather than collections of millions of documents.

Storage and search run within your application. OpenAI is the default embedding provider; hosted alternatives include Azure OpenAI, GCP Vertex AI, Cohere and Mistral. Those providers receive embedding requests, while local embedding services let you keep that processing on your own hardware. Backup reader and writer interfaces also support S3 and other blob storage.

Similar to chromem-go