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_ENDPOINTStatic file endpoint, used for serving static fileshttp://localhost:5800/v1/misc/

Credentials

EnvDescriptionDefault Value
OPENAI_API_KEYOpenAI API key, used for LLM inference and embeddings(not set)
OPENROUTER_API_KEYOpenRouter API key, used for LLM inference(not set)
JINA_API_KEYJina API key, used for embeddings(not set)
FIREWORKS_API_KEYFireworks API key, used for embedding(not set)
SERPER_API_KEYSerper API key, used for online search(not set)

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
  • Elasticsearch: used for full-text searching within workspace
  • MinIO: used for object storage for canvas, document and resource data

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_PASSWORDRedis passwordtest

Qdrant (Vector Store)

EnvDescriptionDefault Value
QDRANT_HOSTQdrant hostlocalhost
QDRANT_PORTQdrant port6333
QDRANT_API_KEYQdrant API key(not set)
REFLY_VEC_DIMVector dimension size768

Elasticsearch

EnvDescriptionDefault Value
ELASTICSEARCH_URLElasticsearch URLhttp://localhost:9200
ELASTICSEARCH_USERNAMEElasticsearch username(not set)
ELASTICSEARCH_PASSWORDElasticsearch username(not set)

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 internal datalocalhost
MINIO_EXTERNAL_PORTMinIO port used for internal data9000
MINIO_EXTERNAL_USE_SSLWhether to use HTTPS for transportfalse
MINIO_EXTERNAL_ACCESS_KEYAccess key for internal MinIOminioadmin
MINIO_EXTERNAL_SECRET_KEYSecret key for MinIOminioadmin
MINIO_EXTERNAL_BUCKETBucket name for internalrefly-weblink

Authentication Configuration

EnvDescriptionDefault Value
AUTH_SKIP_VERIFICATIONWhether to skip email verificationfalse
REFLY_COOKIE_DOMAINCookie domain used for signing authentication tokenslocalhost
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

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.

Embeddings Configuration

EnvDescriptionDefault Value
EMBEDDINGS_PROVIDEREmbeddings provider (either jina, fireworks or openai)jina
EMBEDDINGS_MODEL_NAMEEmbeddings model namejina-embeddings-v3
EMBEDDINGS_DIMENSIONSEmbedding vector dimensions768
EMBEDDINGS_BATCH_SIZEBatch size for embedding processing512

WARNING

The default EMBEDDINGS_PROVIDER is jina. If you want to use other embeddings providers, please set the corresponding environment variables.

WARNING

EMBEDDINGS_DIMENSIONS must be set to the same value as REFLY_VEC_DIM in Qdrant.

Reranker

EnvDescriptionDefault Value
RERANKER_TOP_NNumber of top results to rerank10
RERANKER_MODELReranker model namejina-reranker-v2-base-multilingual
RERANKER_RELEVANCE_THRESHOLDRelevance threshold for reranking0.5

WARNING

Currently, only Jina rerankers are supported. You need to set the JINA_API_KEY environment variable.

Skill Execution

EnvDescriptionDefault Value
REFLY_DEFAULT_MODELDefault AI modelopenai/gpt-4o-mini
SKILL_IDLE_TIMEOUTSkill idle timeout in milliseconds60000
SKILL_EXECUTION_TIMEOUTSkill execution timeout in milliseconds180000

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

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

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