.env file for service credentials and runtime settings, and compile-time constants in src/pipeline-processing/consts.ts that control pipeline behavior.
Environment variables
All variables are validated with Zod on startup. If any required variable is missing or invalid, Quark exits with an error message before doing anything else.LLM provider
Register at https://console.groq.com (or any OpenAI-compatible provider) to obtain these credentials.
API key for your LLM provider. Passed as the
Authorization: Bearer header to the inference endpoint.Base URL of the OpenAI-compatible inference endpoint. For Groq, this is
https://api.groq.com/openai/v1.Model identifier to request from the provider. Must be a model name recognized by the endpoint at
LLM_URL.Embeddings (VoyageAI)
Register at https://www.voyageai.com/ to obtain your embedding API key.
API key for VoyageAI. Note the intentional double-
D spelling — this matches the variable name in .env.example and the Zod schema (EMBEDDING_TOKEN).VoyageAI model used to generate document and query embeddings. Changing this requires re-ingesting all documents so vector dimensions stay consistent.
Document parser (Unstructured.io)
Register at https://unstructured.io/?modal=try-for-free to obtain your API key and server URL.
API key for the Unstructured.io document partitioning service.
Server URL for the Unstructured API. The default hosted endpoint is
https://api.unstructuredapp.io/general/v0/general.Vector database (Qdrant)
Register at https://qdrant.tech/ to create a free cloud cluster. The API key and cluster URL are available in the Qdrant dashboard.
API key for your Qdrant cloud cluster.
Full URL of your Qdrant cluster, for example
https://your-id.us-east4-0.gcp.cloud.qdrant.io.Name of the Qdrant collection where document vectors are stored. The collection is created automatically on first ingest if it does not exist.
Long-term memory (Mem0)
Register at https://mem0.ai/ to obtain your API key.
API key for the Mem0 memory service. Mem0 stores user preferences and conversation history that persist across sessions.
Short-term memory (Redis)
Register at https://upstash.com/ and create a Redis database. Copy the
REDIS_URL (including credentials) from the database details page.Full connection URL for Redis, including credentials. For Upstash, this is in the form
rediss://default:[email protected]:6379. Used for short-term session memory (STM).Object storage (ElasticLake)
Register at https://app.elasticlake.com/ to create an object and obtain your access credentials.
The name of the object store bucket in ElasticLake where ingested files and extracted assets are uploaded.
Access key ID for ElasticLake (equivalent to an AWS
accessKeyId). Used to authenticate S3-compatible requests.Secret access key for ElasticLake (equivalent to an AWS
secretAccessKey). Keep this value private.Database (Supabase)
Register at https://supabase.com/ and create a project. All four values are available under Project Settings → API and Project Settings → Database.
The base URL of your Supabase project, for example
https://your-ref.supabase.co. Used by the Supabase JS client.The
anon (public) API key for your Supabase project. Used for client-side operations with row-level security applied.The
service_role key for your Supabase project. This key bypasses row-level security — keep it private and never expose it to clients.Direct PostgreSQL connection string for running database migrations via
psql. Format: postgresql://postgres.[REF]:[PASSWORD]@aws-0-[REGION].pooler.supabase.com:5432/postgres.Runtime settings
Runtime environment. Accepted values:
dev, staging, prod. Controls behavior such as log verbosity and client initialization.Log level for the Pino logger. Standard levels:
trace, debug, info, warn, error, fatal. Set to info or warn in production to reduce noise.Pipeline constants
These values are defined insrc/pipeline-processing/consts.ts and are compiled into the binary. To change them you must edit the source file and restart the process.
| Constant | Value | Description |
|---|---|---|
MAXCHAR | 1500 | Maximum character length of a single text chunk after partitioning. Chunks longer than this are split further before embedding. |
BATCHSIZE | 12 | Number of chunks sent to VoyageAI in a single embedding request. Higher values improve throughput but increase latency per batch. |
SIMILARITY_THRESHOLD | 0.2 | Minimum cosine similarity score for a Qdrant result to be included in the retrieved context. Results below this threshold are discarded. |
VECTOR_LIMIT | 15 | Maximum number of vectors returned per Qdrant search query before similarity filtering. |
MAX_MESSAGES | 20 | Maximum number of messages stored in Redis short-term memory (STM) for a session before the buffer is trimmed. |
TTL_SECONDS | 1800 | Time-to-live in seconds for Redis STM keys. After 30 minutes of inactivity a session’s short-term context expires. |
TRIM_TO | 10 | Number of messages to retain when the STM buffer is trimmed after exceeding MAX_MESSAGES. Oldest messages are dropped first. |