Skip to main content

Configuration and extensions

RAGLight 4 has no global configuration singleton. Applications either inject ready component instances or build them from an explicit PipelineConfig and IntegrationRegistries value.

Direct dependency injection

Direct injection is the primary API and is the best choice for application code, notebooks, and tests.
Components satisfy structural protocols. They do not need to inherit from a RAGLight class or be registered.

Optional extras

Extras compose:

Registry-backed construction

Registries are useful when component selection comes from JSON or TOML. Built-in registries contain lazy references, so inspecting names does not import every provider SDK.
PipelineConfig.from_file() supports .toml and .json. The serialized component sections are llm, embeddings, vector_store, and optional reranker. Provider-specific options remain owned by the selected factory.

Register a custom component

Registration is optional when constructing a pipeline directly.

Credentials and environment variables

Provider adapters read conventional environment variables when an explicit key is not supplied:
AWS authentication follows the standard credential chain used by the AWS SDK. RAGLight does not load a .env file or configure global logging; those are application responsibilities.

Validation behavior

  • top_k must be greater than zero.
  • Unknown serialized fields are rejected.
  • Duplicate registry names require replace=True.
  • Missing optional dependencies produce an error naming the required extra.
  • The vector-store embedding model is injected by the pipeline and cannot be overridden in serialized options.