Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Infiniflow Ragflow Settings Init Settings

From Leeroopedia
Knowledge Sources
Domains RAG, Configuration_Management
Last Updated 2026-02-12 06:00 GMT

Overview

Concrete tool for initializing all backend services and connections provided by RAGFlow's settings module.

Description

settings.init_settings() loads configuration from service_conf.yaml and environment variables, then initializes: docStoreConn (ESConnection/InfinityConnection/etc.), STORAGE_IMPL (MinIO/S3/Azure/etc.), retriever (Dealer instance), kg_retriever (KGSearch), and FACTORY_LLM_INFOS (LLM provider catalog from llm_factories.json).

Usage

Called automatically by ragflow_server.py during startup.

Code Reference

Source Location

  • Repository: ragflow
  • File: common/settings.py (L171-349), conf/llm_factories.json (5646 lines)

Signature

def init_settings():
    """Initialize all backend services.

    Reads: service_conf.yaml, environment variables

    Sets global variables:
        LLM_FACTORY: str - Default LLM provider name
        docStoreConn: DocStoreConnection - Document store
        STORAGE_IMPL: StorageBase - Object storage
        retriever: Dealer - Search engine
        kg_retriever: KGSearch - Knowledge graph search
        FACTORY_LLM_INFOS: dict - LLM provider catalog

    DOC_ENGINE options: elasticsearch, infinity, oceanbase, opensearch
    STORAGE_IMPL_TYPE options: MINIO, AZURE_SPN, AZURE_SAS, AWS_S3, OSS, OPENDAL, GCS
    """

Import

from common.settings import init_settings
from common import settings

# After init_settings():
settings.docStoreConn   # Document store connection
settings.STORAGE_IMPL   # Storage backend
settings.retriever       # Dealer search engine

I/O Contract

Inputs

Name Type Required Description
service_conf.yaml file Yes Backend configuration
Environment variables env No Override configuration values

Outputs

Name Type Description
settings.docStoreConn DocStoreConnection Initialized document store
settings.STORAGE_IMPL StorageBase Initialized object storage
settings.retriever Dealer Initialized search engine
settings.FACTORY_LLM_INFOS dict LLM provider catalog

Usage Examples

from common.settings import init_settings
from common import settings

# Initialize (called once at startup)
init_settings()

# Use initialized services
print(f"Doc Engine: {settings.DOC_ENGINE}")
print(f"Storage: {settings.STORAGE_IMPL_TYPE}")
print(f"LLM Factory: {settings.LLM_FACTORY}")

Related Pages

Implements Principle

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment