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
| Variable | Required | Description | Default |
|---|---|---|---|
C42_DATA_DIR | Optional | Directory for storing index data | ~/.local/share/context42 |
C42_LOG_LEVEL | Optional | Logging level (DEBUG, INFO, WARNING, ERROR) | INFO |
C42_EMBEDDING_MODEL | Optional | Sentence-transformers model for embeddings | BAAI/bge-small-en-v1.5 |
C42_CHUNK_SIZE | Optional | Characters per chunk when splitting documents | 500 |
C42_BATCH_SIZE | Optional | Chunks processed per batch during indexing | 50 |
HF_TOKEN | Optional | Hugging 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.5can 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:
| Platform | Path |
|---|---|
| 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.