Skip to content

Configuration

API Server

The following are the detailed configurations for the API server. You can inject these environment variables into the refly_api container.

General Config

EnvDescriptionDefault Value
NODE_ENVNode environmentdevelopment
PORTHTTP API service port, used for regular API requests5800
WS_PORTWebSocket server port, used for real-time synchronization for canvases and documents5801
ORIGINClient origin (where you are accessing the Refly application from), used for CORS checkhttp://localhost:5700
STATIC_PUBLIC_ENDPOINTPublic static file endpoint (which can be accessed without authentication)http://localhost:5800/v1/misc/public
STATIC_PRIVATE_ENDPOINTPrivate static file endpoint (which must be accessed with authentication)http://localhost:5800/v1/misc

Middlewares

Refly depends on following middlewares to function properly:

  • Postgres: used for basic data persistence
  • Redis: used for cache, asynchronous task queue and coordination within distributed environment
  • Qdrant: used for semantic searching via embeddings
  • MinIO: used for object storage for canvas, document and resource data

Optional:

  • SearXNG: used for online searching
  • Elasticsearch: used for full-text searching within workspace

Postgres

EnvDescriptionDefault Value
DATABASE_URLPostgreSQL connection URLpostgresql://refly:test@localhost:5432/refly?schema=refly

INFO

Refer to Prisma doc for detailed definition of connection URL.

Redis

EnvDescriptionDefault Value
REDIS_HOSTRedis hostlocalhost
REDIS_PORTRedis port6379
REDIS_USERNAMERedis username(not set)
REDIS_PASSWORDRedis password(not set)

Vector Store

EnvDescriptionDefault Value
VECTOR_STORE_BACKENDVector store backend (qdrant or lancedb)qdrant
Qdrant (Vector Store)
EnvDescriptionDefault Value
QDRANT_HOSTQdrant hostlocalhost
QDRANT_PORTQdrant port6333
QDRANT_API_KEYQdrant API key(not set)
LanceDB (Vector Store)
EnvDescriptionDefault Value
LANCEDB_URILanceDB database URI./data/lancedb

Object Storage

EnvDescriptionDefault Value
OBJECT_STORAGE_RECLAIM_POLICYObject storage reclaim policy (retain or delete)retain
OBJECT_STORAGE_BACKENDObject storage backend (minio or fs)minio
File System Storage
EnvDescriptionDefault Value
OBJECT_STORAGE_FS_ROOTFile system storage root path./storage
MinIO

Refly requires two MinIO instances:

  • Internal: used for storing canvas, resource, and document data, typically with visibility set to private.
  • External: used for storing uploaded files, typically with visibility set to public.
EnvDescriptionDefault Value
MINIO_INTERNAL_ENDPOINTMinIO host used for internal datalocalhost
MINIO_INTERNAL_PORTMinIO port used for internal data9000
MINIO_INTERNAL_USE_SSLWhether to use HTTPS for transportfalse
MINIO_INTERNAL_ACCESS_KEYAccess key for internal MinIOminioadmin
MINIO_INTERNAL_SECRET_KEYSecret key for MinIOminioadmin
MINIO_INTERNAL_BUCKETBucket name for internalrefly-weblink
MINIO_EXTERNAL_ENDPOINTMinIO host used for external datalocalhost
MINIO_EXTERNAL_PORTMinIO port used for external data9000
MINIO_EXTERNAL_USE_SSLWhether to use HTTPS for transportfalse
MINIO_EXTERNAL_ACCESS_KEYAccess key for external MinIOminioadmin
MINIO_EXTERNAL_SECRET_KEYSecret key for MinIOminioadmin
MINIO_EXTERNAL_BUCKETBucket name for externalrefly-weblink
EnvDescriptionDefault Value
FULLTEXT_SEARCH_BACKENDFull-text search backend (prisma or elasticsearch)prisma
ELASTICSEARCH_URLElasticsearch URL (required if FULLTEXT_SEARCH_BACKEND is elasticsearch)http://localhost:9200
ELASTICSEARCH_USERNAMEElasticsearch username (required if FULLTEXT_SEARCH_BACKEND is elasticsearch)(not set)
ELASTICSEARCH_PASSWORDElasticsearch password (required if FULLTEXT_SEARCH_BACKEND is elasticsearch)(not set)

Authentication Configuration

EnvDescriptionDefault Value
AUTH_SKIP_VERIFICATIONWhether to skip email verificationfalse
LOGIN_REDIRECT_URLURL to redirect after OAuth login(not set)
JWT_SECRETJWT signing secrettest
JWT_EXPIRATION_TIMEJWT access token expiration time1h
JWT_REFRESH_EXPIRATION_TIMEJWT refresh token expiration time7d
COLLAB_TOKEN_EXPIRYCollaboration token expiration time1h
EnvDescriptionDefault Value
REFLY_COOKIE_DOMAINCookie domain used for signing authentication tokens(not set)
REFLY_COOKIE_SECUREWhether to use secure cookies(not set)
REFLY_COOKIE_SAME_SITESameSite cookie attribute(not set)

INFO

The time format is compatible with Vercel MS.

Email Authentication

EnvDescriptionDefault Value
EMAIL_AUTH_ENABLEDWhether to enable email authenticationtrue
EMAIL_SENDEREmail senderRefly <[email protected]>
RESEND_API_KEYResend API key, used for sending emailsre_123

WARNING

The default RESEND_API_KEY is invalid (just a placeholder). Please set your own API key if needed.

GitHub Authentication

EnvDescriptionDefault Value
GITHUB_AUTH_ENABLEDWhether to enable GitHub authenticationfalse
GITHUB_CLIENT_IDGitHub OAuth client IDtest
GITHUB_CLIENT_SECRETGitHub OAuth client secrettest
GITHUB_CALLBACK_URLGitHub OAuth callback URLtest

WARNING

The default OAuth credentials are invalid (just a placeholder). Please set your own GitHub OAuth credentials if needed.

INFO

You can learn more about GitHub OAuth at GitHub Developer.

Google Authentication

EnvDescriptionDefault Value
GOOGLE_AUTH_ENABLEDWhether to enable Google authenticationfalse
GOOGLE_CLIENT_IDGoogle OAuth client IDtest
GOOGLE_CLIENT_SECRETGoogle OAuth client secrettest
GOOGLE_CALLBACK_URLGoogle OAuth callback URLtest

WARNING

The default OAuth credentials are invalid (just a placeholder). Please set your own Google OAuth credentials if needed.

INFO

You can learn more about Google OAuth at Google Developer.

Image Processing

EnvDescriptionDefault Value
IMAGE_MAX_AREAMaximum area of images passed to LLM360000
IMAGE_PAYLOAD_MODEImage payload mode (base64 or url)base64
IMAGE_PRESIGN_EXPIRYExpiry time (in seconds) for presigned image URLs900

Encryption

EnvDescriptionDefault Value
ENCRYPTION_KEYEncryption key used for encrypting and decrypting sensitive data(not set)

Skill Execution

EnvDescriptionDefault Value
SKILL_STREAM_IDLE_TIMEOUTSkill stream idle timeout in milliseconds30000
SKILL_STREAM_IDLE_CHECK_INTERVALSkill stream idle check interval in milliseconds10000
SKILL_STUCK_CHECK_INTERVALSkill stuck check interval in milliseconds60000
SKILL_STUCK_TIMEOUT_THRESHOLDSkill stuck timeout threshold in milliseconds300000
SKILL_AI_MODEL_NETWORK_TIMEOUTAI model network timeout in milliseconds30000

Provider Configuration

EnvDescriptionDefault Value
PROVIDER_DEFAULT_MODEDefault provider mode (global or custom)custom

Default Models

EnvDescriptionDefault Value
DEFAULT_MODEL_CHATDefault chat model(not set)
DEFAULT_MODEL_AGENTDefault agent model(not set)
DEFAULT_MODEL_QUERY_ANALYSISDefault query analysis model(not set)
DEFAULT_MODEL_TITLE_GENERATIONDefault title generation model(not set)
DEFAULT_MODEL_IMAGEDefault image model(not set)
DEFAULT_MODEL_VIDEODefault video model(not set)
DEFAULT_MODEL_AUDIODefault audio model(not set)

Stripe

EnvDescriptionDefault Value
STRIPE_API_KEYStripe API key(not set)
STRIPE_ACCOUNT_WEBHOOK_SECRETStripe account webhook secrettest
STRIPE_ACCOUNT_TEST_WEBHOOK_SECRETStripe test account webhook secrettest
STRIPE_SESSION_SUCCESS_URLStripe success redirect URL(not set)
STRIPE_SESSION_CANCEL_URLStripe cancellation redirect URL(not set)
STRIPE_PORTAL_RETURN_URLStripe customer portal return URL(not set)

Quota

Token Quota

EnvDescriptionDefault Value
QUOTA_T1_TOKENTier 1 token quota-1
QUOTA_T2_TOKENTier 2 token quota-1

Request Quota

EnvDescriptionDefault Value
QUOTA_T1_REQUESTTier 1 request quota-1
QUOTA_T2_REQUESTTier 2 request quota-1

Storage Quota

EnvDescriptionDefault Value
QUOTA_STORAGE_FILEFile storage quota-1
QUOTA_STORAGE_OBJECTObject storage quota-1
QUOTA_STORAGE_VECTORVector storage quota-1

File Parse Quota

EnvDescriptionDefault Value
QUOTA_FILE_PARSE_PAGEFile parse page quota-1

Langfuse

EnvDescriptionDefault Value
LANGFUSE_PUBLIC_KEYLangfuse public key(not set)
LANGFUSE_SECRET_KEYLangfuse secret key(not set)
LANGFUSE_HOSTLangfuse host URL(not set)

Web Frontend

The following are the detailed configurations for the web frontend. You can inject these environment variables into the refly_web container.

General Config

EnvDescriptionDefault Value
REFLY_API_URLRefly API server URLhttp://localhost:5800
COLLAB_URLCollaboration endpoint URLhttp://localhost:5801
SUBSCRIPTION_ENABLEDWhether to enable subscription and billing features(not set)