Dear Diary is configured through environment variables. These may be set
directly in the shell, via a .env file in the working directory, or through
the MCP client configuration.
Environment variables
Table 1: Configuration environment variables.
| Variable | Description | Required | Default |
|---|---|---|---|
QDRANT_URL |
URL of the Qdrant server (including port) | Yes[^1] | — |
QDRANT_API_KEY |
API key for Qdrant authentication | No | — |
COLLECTION_NAME |
Default collection name (supports interpolation[^2]) | No | — |
QDRANT_LOCAL_PATH |
Path for local Qdrant storage | Yes[^1] | — |
EMBEDDING_MODEL |
FastEmbed model identifier | No | sentence-transformers/all-MiniLM-L6-v2 |
QDRANT_SEARCH_LIMIT |
Maximum number of search results | No | 10 |
QDRANT_READ_ONLY |
Disable write operations | No | false |
TOOL_STORE_DESCRIPTION |
Custom description for store tool | No | — |
TOOL_FIND_DESCRIPTION |
Custom description for find tool | No | — |
Connection modes
Dear Diary supports two mutually exclusive connection modes:
- Remote mode — Connect to a Qdrant server via
QDRANT_URL - Local mode — Use local file storage via
QDRANT_LOCAL_PATH
Exactly one of these must be configured.
Example configuration
Create a .env file in the project root:
QDRANT_URL=https://abc123.eu-west-1-0.aws.cloud.qdrant.io:6334
QDRANT_API_KEY=your_qdrant_api_key_here
COLLECTION_NAME=my-memories
EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
QDRANT_SEARCH_LIMIT=10
Collection name interpolation
The COLLECTION_NAME environment variable supports placeholder interpolation.
Placeholders are enclosed in braces and resolved at startup from the current
git repository and working directory.
Table 2: Supported placeholders for COLLECTION_NAME.
| Placeholder | Description | Example value |
|---|---|---|
{repo} |
Repository name from origin remote |
dear-diary |
{owner} |
Repository owner from origin remote |
leynos |
{cwd} |
Basename of the current working directory | my-project |
{branch} |
Current git branch name | main |
Repository information is inferred from the origin remote URL. HTTPS, SSH,
and SCP-style URLs are all supported. For Source Hut repositories, the tilde
prefix is stripped from the owner (e.g. ~sircmpwn becomes sircmpwn).
Example
COLLECTION_NAME={owner}-{repo}-notes
With a remote of [email protected]:leynos/dear-diary.git, this resolves to
leynos-dear-diary-notes.
Error behaviour
If a placeholder is used, but the corresponding value cannot be determined, the
server fails to start with a descriptive error message. Only placeholders that
are present in the value are evaluated, so {cwd} can be used outside a git
repository without requiring {repo} or {branch}.
Common failure scenarios:
{repo}or{owner}used, but nooriginremote is configured{branch}used, but HEAD is detached, or the directory is not a git repository{cwd}used, but the current directory cannot be determined
Qdrant Cloud configuration
When connecting to Qdrant Cloud, use port 6334 for gRPC connections:
QDRANT_URL=https://abc123.eu-west-1-0.aws.cloud.qdrant.io:6334
QDRANT_API_KEY=your_cloud_api_key_from_qdrant_console