Step-by-step setup for each embedding provider supported by hatch.
Set embed_provider in ~/.hatch/config.yaml or override with HATCH_EMBED_PROVIDER.
~ refers to your home directory (e.g. /Users/yourname) — not the project
repo. See CONFIGURATION.md for full details.
Embeddings are numerical representations of text — each piece of content is converted into a vector (a list of numbers) that captures its meaning. Similar content produces similar vectors, which makes it possible to search by meaning rather than exact keywords.
In hatch, the embedder converts your ingested source material into vectors stored in SQLite. When a junior searches the knowledge base or hatch retrieves context for a quiz question, it compares vectors to find the most relevant chunks — this is called semantic search.
hatch treats the embedder as a swappable dependency. You can run it locally via Ollama or use a cloud API, without changing any application code.
Runs entirely on-device. No API key or account required.
| Property | Value |
|---|---|
| Provider key | ollama |
| Default | yes |
| Required env | none |
| Default host | http://localhost:11434 |
| Recommended | nomic-embed-text |
| Vector dim | 768 (nomic-embed-text) |
-
Install Ollama — download from ollama.com or via Homebrew:
brew install ollama
-
Start the Ollama server (leave running in the background):
ollama serve
Ollama listens on
http://localhost:11434by default. -
Pull the embedding model:
ollama pull nomic-embed-text
-
Set the provider in
~/.hatch/config.yaml:embed_provider: ollama
Or via environment variable:
export HATCH_EMBED_PROVIDER=ollama -
Verify the model is available:
ollama list
nomic-embed-textshould appear in the output. hatch connects to Ollama automatically when ingesting or searching.
Uses the OpenAI Embeddings API. Requires an OpenAI account and API key.
| Property | Value |
|---|---|
| Provider key | openai |
| Default | no |
| Required env | OPENAI_API_KEY |
| Recommended | text-embedding-3-small |
| Vector dim | 1536 (text-embedding-3-small) |
-
Create an API key at platform.openai.com/api-keys.
-
Add the key to your environment. In
.env(created by./dev env init):OPENAI_API_KEY=sk-...
Or export directly:
export OPENAI_API_KEY=sk-... -
Set the provider in
~/.hatch/config.yaml:embed_provider: openai
Or via environment variable:
export HATCH_EMBED_PROVIDER=openai -
Verify by ingesting a small source. If the API key is missing or invalid, hatch exits with a clear error before any embeddings are generated.
Uses the Google Generative AI Embeddings API. Requires a Google Cloud account and API key.
| Property | Value |
|---|---|
| Provider key | gemini |
| Default | no |
| Required env | GEMINI_API_KEY |
| Recommended | text-embedding-004 |
| Vector dim | 768 (text-embedding-004) |
-
Create an API key at aistudio.google.com/app/apikey.
-
Add the key to your environment. In
.env(created by./dev env init):GEMINI_API_KEY=AIza...
Or export directly:
export GEMINI_API_KEY=AIza... -
Set the provider in
~/.hatch/config.yaml:embed_provider: gemini
Or via environment variable:
export HATCH_EMBED_PROVIDER=gemini -
Verify by ingesting a small source. If the API key is missing or invalid, hatch exits with a clear error before any embeddings are generated.
| Provider | Status | Milestone |
|---|---|---|
| Fake (test double) | ✅ | M1 |
| OpenAI | ✅ | M2 |
| Google Gemini | ✅ | M2 |
| Ollama | 🔲 | v4 |
docs/PROVIDERS.md— provider overviewdocs/providers/LLM.md— LLM provider setupdocs/providers/CONFIGURATION.md— full config referencedocs/milestones/M1-foundation.md— fake provider implementation