Gralkor.Config (jido_gralkor v11.0.0)

Copy Markdown View Source

Configuration for the embedded Gralkor runtime.

Three operator-facing knobs decide what :jido_gralkor does at boot:

  • The FalkorDB connection — either embedded (falkordblite spawns a local redis-server child under a directory chosen by GRALKOR_DATA_DIR) or remote (network host:port plus optional credentials, set via the :jido_gralkor, :falkordb application env). Remote wins when both are configured. See falkordb_spec/0.
  • The embedded FalkorDB socket read timeout — configured in milliseconds as :embedded_falkordb_socket_timeout_ms, defaulting to 60 seconds. It is validated only when the embedded backend starts.
  • The LLM and embedder models — set via the GRALKOR_LLM_MODEL and GRALKOR_EMBEDDER_MODEL env vars in "provider:model" form (operator contract). llm_model/0 and embedder_model/0 return them as %{provider: atom(), id: String.t()} maps — the inline-map shape ReqLLM.model/1 accepts without a catalog lookup (no "unverified model" IO.warn when the model id is newer than the LLMDB snapshot bundled with req_llm). Parsing is provider-agnostic, but the native Gralkor.GraphitiPool boundary accepts OpenAI and Google LLM and embedder specs; explicit ReqLLM-only calls may use other providers.

Summary

Types

Resolved FalkorDB selection. :remote carries the validated keyword list the operator supplied; :embedded carries the expanded data directory.

Resolved model spec — the inline-map shape ReqLLM.model/1 accepts directly.

Functions

Resolve the embedded FalkorDB socket read timeout in milliseconds.

Resolve the FalkorDB connection spec from configuration. Returns nil when neither knob is set so the supervisor can run with no children.

Validate a remote FalkorDB keyword spec. Raises ArgumentError with a pointed message if the shape is wrong; returns the keyword list unchanged on success.

Types

falkordb_spec()

@type falkordb_spec() :: {:remote, keyword()} | {:embedded, String.t()}

Resolved FalkorDB selection. :remote carries the validated keyword list the operator supplied; :embedded carries the expanded data directory.

model_spec()

@type model_spec() :: %{provider: atom(), id: String.t()}

Resolved model spec — the inline-map shape ReqLLM.model/1 accepts directly.

Functions

embedded_falkordb_socket_timeout_ms()

@spec embedded_falkordb_socket_timeout_ms() :: pos_integer()

Resolve the embedded FalkorDB socket read timeout in milliseconds.

embedder_model()

@spec embedder_model() :: model_spec()

falkordb_spec()

@spec falkordb_spec() :: falkordb_spec() | nil

Resolve the FalkorDB connection spec from configuration. Returns nil when neither knob is set so the supervisor can run with no children.

Remote wins over embedded when both are present.

llm_model()

@spec llm_model() :: model_spec()

validate_falkordb!(kw)

@spec validate_falkordb!(any()) :: keyword()

Validate a remote FalkorDB keyword spec. Raises ArgumentError with a pointed message if the shape is wrong; returns the keyword list unchanged on success.