Class: FactDb::Config
- Inherits:
-
MywayConfig::Base
- Object
- MywayConfig::Base
- FactDb::Config
- Defined in:
- lib/fact_db/config.rb
Overview
FactDb Configuration using MywayConfig
Schema is defined in lib/fact_db/config/defaults.yml (single source of truth)
All config sections return ConfigSections with symbol keys:
FactDb.config.database # => ConfigSection with {adapter: "postgresql", host: "localhost", ...}
FactDb.config.llm # => ConfigSection with {provider: :anthropic, model: "claude-...", ...}
FactDb.config. # => ConfigSection with {generator: nil, dimensions: 1536}
FactDb.config.ranking # => ConfigSection with {ts_rank_weight: 0.25, ...}
Access values via hash keys or dot notation:
FactDb.config.database[:host]
FactDb.config.database.host
FactDb.config.llm[:provider]
FactDb.config.llm.provider
Configuration sources (lowest to highest priority):
- Bundled defaults: lib/fact_db/config/defaults.yml (ships with gem)
- XDG user config:
- ~/Library/Application Support/fact_db/fact_db.yml (macOS only)
- ~/.config/fact_db/fact_db.yml (XDG default)
- $XDG_CONFIG_HOME/fact_db/fact_db.yml (if XDG_CONFIG_HOME is set)
- Project config: ./config/fact_db.yml (environment-specific)
- Local overrides: ./config/fact_db.local.yml (gitignored)
- Environment variables (FDB_*)
- Explicit values passed to configure block
Instance Attribute Summary collapse
-
#embedding_generator ⇒ Object
Callable Accessors (not loaded from config sources) ==========================================================================.
-
#llm_client ⇒ Object
Callable Accessors (not loaded from config sources) ==========================================================================.
-
#logger ⇒ Object
Callable Accessors (not loaded from config sources) ==========================================================================.
Class Method Summary collapse
- .active_xdg_config_file ⇒ Object
- .xdg_config_file ⇒ Object
-
.xdg_config_paths ⇒ Object
XDG Config Path Helpers ==========================================================================.
Instance Attribute Details
#embedding_generator ⇒ Object
==========================================================================
Callable Accessors (not loaded from config sources)
58 59 60 |
# File 'lib/fact_db/config.rb', line 58 def @embedding_generator end |
#llm_client ⇒ Object
==========================================================================
Callable Accessors (not loaded from config sources)
58 59 60 |
# File 'lib/fact_db/config.rb', line 58 def llm_client @llm_client end |
#logger ⇒ Object
==========================================================================
Callable Accessors (not loaded from config sources)
58 59 60 |
# File 'lib/fact_db/config.rb', line 58 def logger @logger end |
Class Method Details
.active_xdg_config_file ⇒ Object
84 85 86 |
# File 'lib/fact_db/config.rb', line 84 def self.active_xdg_config_file MywayConfig::Loaders::XdgConfigLoader.find_config_file(:fact_db) end |
.xdg_config_file ⇒ Object
74 75 76 77 78 79 80 81 82 |
# File 'lib/fact_db/config.rb', line 74 def self.xdg_config_file xdg_home = ENV["XDG_CONFIG_HOME"] base = if xdg_home && !xdg_home.empty? xdg_home else File.("~/.config") end File.join(base, "fact_db", "fact_db.yml") end |
.xdg_config_paths ⇒ Object
==========================================================================
XDG Config Path Helpers
70 71 72 |
# File 'lib/fact_db/config.rb', line 70 def self.xdg_config_paths MywayConfig::Loaders::XdgConfigLoader.config_paths(:fact_db) end |