Configuration

No configuration required — Context42 works out of the box. All settings below are optional and only needed if you want to customize the default behavior.

Environment variables

VariableRequiredDescriptionDefault
C42_DATA_DIROptionalDirectory for storing index data~/.local/share/context42
C42_LOG_LEVELOptionalLogging level (DEBUG, INFO, WARNING, ERROR)INFO
C42_EMBEDDING_MODELOptionalSentence-transformers model for embeddingsBAAI/bge-small-en-v1.5
C42_CHUNK_SIZEOptionalCharacters per chunk when splitting documents500
C42_BATCH_SIZEOptionalChunks processed per batch during indexing50
HF_TOKENOptionalHugging Face token for faster model downloads

Embedding model

By default Context42 uses BAAI/bge-small-en-v1.5, a lightweight model that runs efficiently on CPU without requiring a GPU. The model is downloaded automatically on the first indexing run.

To use a different sentence-transformers model:

export C42_EMBEDDING_MODEL="BAAI/bge-base-en-v1.5"

Tip: If you have a GPU available, larger models like BAAI/bge-large-en-v1.5 can provide better search quality at the cost of higher resource usage.

After changing the embedding model you must re-index your sources:

c42 index

Hugging Face token

Set the HF_TOKEN environment variable to enable faster model downloads and avoid rate limiting:

export HF_TOKEN="hf_your_token_here"

Get your token at huggingface.co/settings/tokens.

Data directory

Context42 stores its vector index and metadata in the data directory. By default this is:

PlatformPath
macOS~/Library/Application Support/context42
Linux~/.local/share/context42
Windows%LOCALAPPDATA%\context42

Override with the C42_DATA_DIR environment variable:

export C42_DATA_DIR=/path/to/custom/dir

Supported file formats

Context42 indexes the following file types:

  • Markdown (.md) — Full support with heading-aware chunking
  • reStructuredText (.rst) — Full support

More formats are planned for future releases.