pub struct RuntimeConfig {
pub db_path: Option<PathBuf>,
pub default_namespace: Namespace,
pub embedding_model: Option<EmbeddingModel>,
pub additional_embedding_models: Vec<EmbeddingModel>,
pub gate: GateRef,
pub packs: Vec<String>,
pub backend_id: BackendId,
pub brain_profile: Option<String>,
pub visible_namespaces: Vec<Namespace>,
pub allowed_outbound_namespaces: Vec<Namespace>,
pub actor_id: Option<String>,
}Expand description
Runtime configuration.
The db_path and embedding_model fields are deprecated in favour of
constructing the backend externally and calling crate::KhiveRuntime::from_backend.
They remain for backward compatibility with tests and single-binary deployments.
Fields§
§db_path: Option<PathBuf>Path to the SQLite database file. None = in-memory (tests).
Deprecated: use crate::KhiveRuntime::from_backend instead. The boot path
constructs backends from khive.toml (AppConfig) and passes them to
from_backend. Direct db_path usage persists only in tests.
default_namespace: NamespaceNamespace used when no explicit namespace is provided.
embedding_model: Option<EmbeddingModel>Local embedding model. None disables embedding and hybrid vector search;
hybrid_search then falls back to text-only.
Deprecated: embedding engines move to a per-pack EmbedderRegistry.
This field persists for backward compatibility until the embedder registry
is fully plumbed.
additional_embedding_models: Vec<EmbeddingModel>Additional embedding models to make available by request name.
embedding_model remains the default used by existing embed() and
embed_batch() callers. This list adds non-default models that can be
selected with embedder(name), embed_with_model(...), memory
remember.embedding_model, and memory recall.embedding_model.
gate: GateRefAuthorization gate consulted before each verb dispatch.
Default: AllowAllGate (permissive). For production policy enforcement,
plug in a Rego- or capability-witness-backed impl.
packs: Vec<String>Names of packs the transport layer should register into the VerbRegistry.
The transport layer (e.g. khive-mcp) reads this list and instantiates
the matching concrete pack types. Unknown names are reported as errors
by the transport, not silently ignored.
Default: ["kg"].
backend_id: BackendIdIdentifies this runtime’s backend in a multi-backend deployment.
Set by the boot path when constructing per-pack runtimes from khive.toml.
Single-backend deployments use the default BackendId::MAIN.
brain_profile: Option<String>Brain profile to use for memory.feedback / knowledge.feedback and
recall-time score boosting (ADR-035 §Brain profile configuration).
Resolution order (highest to lowest, ADR-035): CLI flag, then
runtime.brain_profile in project/global khive.toml, then the
KHIVE_BRAIN_PROFILE env var as fallback default. Callers must keep
env OUT of the base config they pass in (see khive-mcp serve.rs).
--brain-profileCLI flag (explicit only)- Namespace-bound profile resolved via
brain.resolveat feedback time - Pack-local global tuning prior (default fallback)
visible_namespaces: Vec<Namespace>Operator-configured read-visibility set (ADR-007 Rev 4 Rule 3b).
OSS dispatch widens the DEFAULT multi-record read scope to
['local'] ∪ visible_namespaces. Writes remain pinned to 'local'.
An explicit namespace= request param is a precise single-namespace
escape and is not widened. Populated from actor.visible_namespaces
in khive.toml.
allowed_outbound_namespaces: Vec<Namespace>Namespaces this actor’s comm.send/reply may deliver messages INTO
(outbound, sender-side). Populated from actor.allowed_outbound_namespaces
in khive.toml. Empty by default — cross-namespace delivery denied
unless explicitly declared. The comm handler uses an ordinary
NamespaceToken (minted via with_namespace) in an append-only manner;
the token itself is NOT type-enforced write-only. The recipient-side
allowed_inbound_namespaces (bilateral mutual opt-in) is reserved for
a future cloud-path authorization ADR (not yet written).
actor_id: Option<String>Configured actor identity label (ADR-057). Populated from [actor] id in
khive.toml. When Some, authorize() mints tokens carrying this actor
label so that comm.inbox filters by to_actor instead of falling back to
the party-line “local” behavior. When None (default), tokens carry
ActorRef::anonymous() and inbox shows all inbound messages.
Trait Implementations§
Source§impl Clone for RuntimeConfig
impl Clone for RuntimeConfig
Source§fn clone(&self) -> RuntimeConfig
fn clone(&self) -> RuntimeConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more