# Embeddings

> Choose the embedding model behind PentAGI's memory and knowledge search.

Embeddings power semantic search over [memory](https://pentagi.com/docs/glossary/#memory), the [knowledge base](https://pentagi.com/docs/glossary/#knowledge-base) and past results. OpenAI is the default [provider](https://pentagi.com/docs/glossary/#provider); with no `EMBEDDING_MODEL` set it uses `text-embedding-ada-002`. An example configuration in `.env`:

```bash
EMBEDDING_PROVIDER=openai          # openai, ollama, mistral, jina, huggingface, googleai, voyageai
EMBEDDING_MODEL=text-embedding-3-small
# optional custom endpoint
EMBEDDING_URL=
# provider API key, if required
EMBEDDING_KEY=
EMBEDDING_BATCH_SIZE=512               # default
EMBEDDING_MAX_TEXT_BYTES=8192          # default
```

Any service that implements OpenAI's `/embeddings` API works with `EMBEDDING_PROVIDER=openai` and a custom `EMBEDDING_URL`.

> [!WARNING]
> If you change the embedding provider or model, recompute the stored vectors with `docker exec -it pentagi /opt/pentagi/bin/etester reindex` — vectors from different models are not comparable. Do not run `etester flush` for this: it deletes every stored document, the knowledge base included.

## [Custom CA certificates](https://pentagi.com/docs/configuration/embeddings/#custom-ca-certificates)

If a model backend or [tool](https://pentagi.com/docs/glossary/#tool) server uses a private CA and you see `x509: certificate signed by unknown authority`, put the PEM bundle into the `pentagi-ssl` volume and point PentAGI at it:

```bash
EXTERNAL_SSL_CA_PATH=/opt/pentagi/ssl/ca-bundle.pem
EXTERNAL_SSL_INSECURE=false
```

Then restart with `docker compose up -d pentagi`.