.env file, or container orchestration system.
Quick Start
Copy the example environment file and customize it:.env with your configuration values, particularly the required AI API key.
AI Configuration
These variables configure the AI model provider and behavior.API key for Aliyun DashScope (百炼). This is the primary authentication credential for accessing Qwen models.Required: YesExample:
sk-1234567890abcdefGet your API key from the Aliyun DashScope Console.The Qwen model to use for AI operations.Options:
qwen-plus- Balanced performance and cost (recommended)qwen-max- Highest quality, slower and more expensiveqwen-long- Optimized for long-context tasksqwen-turbo- Fastest, lower quality
spring.ai.openai.chat.options.model in application.ymlMaximum number of retry attempts when parsing structured output from the AI model.When the AI returns JSON that doesn’t match the expected schema, the system will retry up to this many times.Maps to:
app.ai.structured-max-attempts in application.ymlWhether to include the previous parsing error in the retry prompt to help the model fix its output.When enabled, the error message is sent back to the AI to guide it toward producing valid output.Maps to:
app.ai.structured-include-last-error in application.ymlRAG (Retrieval-Augmented Generation) Configuration
These advanced variables tune the knowledge base search behavior.Enable query rewriting to improve search quality. When enabled, user queries are reformulated for better vector search results.Maps to:
app.ai.rag.rewrite.enabledQueries with character count ≤ this value are considered “short” and use different search parameters.Maps to:
app.ai.rag.search.short-query-lengthNumber of documents to retrieve for short queries.Maps to:
app.ai.rag.search.topk-shortNumber of documents to retrieve for medium-length queries.Maps to:
app.ai.rag.search.topk-mediumNumber of documents to retrieve for long queries.Maps to:
app.ai.rag.search.topk-longMinimum similarity score threshold for short queries. Lower threshold allows more results.Maps to:
app.ai.rag.search.min-score-shortMinimum similarity score threshold for normal queries.Maps to:
app.ai.rag.search.min-score-defaultDatabase Configuration
PostgreSQL connection settings.Hostname or IP address of the PostgreSQL server.In Docker Compose, this should be the service name
postgres.Maps to: spring.datasource.url in application.ymlPort number for PostgreSQL.Maps to:
spring.datasource.url in application.ymlName of the PostgreSQL database.Maps to:
spring.datasource.url in application.ymlPostgreSQL username for authentication.Maps to:
spring.datasource.username in application.ymlPostgreSQL password for authentication.Maps to:
spring.datasource.password in application.ymlRedis Configuration
Redis is used for caching and Redis Streams for asynchronous task processing.Hostname or IP address of the Redis server.In Docker Compose, this should be the service name
redis.Maps to: spring.redis.redisson.config.singleServerConfig.address in application.ymlPort number for Redis.Maps to:
spring.redis.redisson.config.singleServerConfig.address in application.ymlStorage Configuration
S3-compatible object storage settings (MinIO or RustFS).The endpoint URL for your S3-compatible storage service.Examples:
- Local MinIO:
http://localhost:9000 - Docker network:
http://minio:9000 - RustFS: Your RustFS server URL
app.storage.endpoint in application.ymlS3 access key ID (equivalent to username).For MinIO, the default is
minioadmin.Maps to: app.storage.access-key in application.ymlS3 secret access key (equivalent to password).For MinIO, the default is
minioadmin.Maps to: app.storage.secret-key in application.ymlThe S3 bucket name where all files will be stored.This bucket must exist before the application starts. The Docker Compose setup creates this automatically.Maps to:
app.storage.bucket in application.ymlAWS region identifier.For MinIO/RustFS, this can be any value as regions aren’t enforced. The default
us-east-1 is conventional.Maps to: app.storage.region in application.ymlInterview Configuration
Settings that control interview behavior.Number of follow-up questions to generate after each user answer in mock interviews.Higher values create more in-depth interviews but take longer to complete.Maps to:
app.interview.follow-up-count in application.ymlNumber of interview answers to evaluate in a single batch during report generation.Larger batches are more efficient but require more memory.Maps to:
app.interview.evaluation.batch-size in application.ymlCORS Configuration
Comma-separated list of allowed origins for CORS (Cross-Origin Resource Sharing).Add your frontend URL to this list. Multiple origins can be specified.Example:
http://localhost:5173,https://myapp.comMaps to: app.cors.allowed-origins in application.ymlEnvironment Variable Mapping
This table shows how environment variables map toapplication.yml properties:
Complete Mapping Reference
Complete Mapping Reference
| Environment Variable | application.yml Property | Type | Default |
|---|---|---|---|
AI_BAILIAN_API_KEY | spring.ai.openai.api-key | string | required |
AI_MODEL | spring.ai.openai.chat.options.model | string | qwen-plus |
APP_AI_STRUCTURED_MAX_ATTEMPTS | app.ai.structured-max-attempts | integer | 2 |
APP_AI_STRUCTURED_INCLUDE_LAST_ERROR | app.ai.structured-include-last-error | boolean | true |
APP_AI_RAG_REWRITE_ENABLED | app.ai.rag.rewrite.enabled | boolean | true |
APP_AI_RAG_SHORT_QUERY_LENGTH | app.ai.rag.search.short-query-length | integer | 4 |
APP_AI_RAG_TOPK_SHORT | app.ai.rag.search.topk-short | integer | 20 |
APP_AI_RAG_TOPK_MEDIUM | app.ai.rag.search.topk-medium | integer | 12 |
APP_AI_RAG_TOPK_LONG | app.ai.rag.search.topk-long | integer | 8 |
APP_AI_RAG_MIN_SCORE_SHORT | app.ai.rag.search.min-score-short | float | 0.18 |
APP_AI_RAG_MIN_SCORE_DEFAULT | app.ai.rag.search.min-score-default | float | 0.28 |
POSTGRES_HOST | spring.datasource.url | string | localhost |
POSTGRES_PORT | spring.datasource.url | integer | 5432 |
POSTGRES_DB | spring.datasource.url | string | interview_guide |
POSTGRES_USER | spring.datasource.username | string | postgres |
POSTGRES_PASSWORD | spring.datasource.password | string | 123456 |
REDIS_HOST | spring.redis.redisson.config | string | localhost |
REDIS_PORT | spring.redis.redisson.config | integer | 6379 |
APP_STORAGE_ENDPOINT | app.storage.endpoint | string | http://localhost:9000 |
APP_STORAGE_ACCESS_KEY | app.storage.access-key | string | (varies) |
APP_STORAGE_SECRET_KEY | app.storage.secret-key | string | (varies) |
APP_STORAGE_BUCKET | app.storage.bucket | string | interview-guide |
APP_STORAGE_REGION | app.storage.region | string | us-east-1 |
APP_INTERVIEW_FOLLOW_UP_COUNT | app.interview.follow-up-count | integer | 1 |
APP_INTERVIEW_EVALUATION_BATCH_SIZE | app.interview.evaluation.batch-size | integer | 8 |
CORS_ALLOWED_ORIGINS | app.cors.allowed-origins | string | http://localhost:5173,... |
Examples
See Also
- Database Configuration - Detailed PostgreSQL and pgvector setup
- Storage Configuration - S3-compatible storage details
- AI Model Configuration - AI model selection and tuning
- Docker Deployment - Using environment variables with Docker
