Expand description
khive-runtime: composable Service API used by daemon, MCP server, and CLI.
Wraps StorageBackend + query compilation into a single Rust API.
§Quick start
ⓘ
use khive_runtime::{KhiveRuntime, RuntimeConfig};
// In-memory for tests:
let rt = KhiveRuntime::memory()?;
// Default (production): reads ~/.khive/khive-graph.db
let rt = KhiveRuntime::new(RuntimeConfig::default())?;
// Create an entity:
let entity = rt.create_entity(None, "concept", "LoRA", None, None, vec![]).await?;
// Link two entities (EdgeRelation is the typed relation):
let edge = rt.link(None, entity.id, other_id, EdgeRelation::Extends, 1.0).await?;Re-exports§
pub use curation::EdgeListFilter;pub use curation::EntityPatch;pub use curation::MergeStrategy;pub use curation::MergeSummary;pub use error::RuntimeError;pub use error::RuntimeResult;pub use fusion::FusionStrategy;pub use graph_traversal::PathNode;pub use graph_traversal::TraversalOptions;pub use objectives::GraphProximityObjective;pub use objectives::RetrievalCandidate;pub use objectives::RrfFusionObjective;pub use objectives::TextRelevanceObjective;pub use objectives::VectorSimilarityObjective;pub use operations::NoteSearchHit;pub use operations::QueryResult;pub use operations::Resolved;pub use pack::DispatchHook;pub use pack::KindHook;pub use pack::PackFactory;pub use pack::PackRegistration;pub use pack::PackRegistry;pub use pack::PackRuntime;pub use pack::VerbRegistry;pub use pack::VerbRegistryBuilder;pub use portability::ImportSummary;pub use portability::KgArchive;pub use retrieval::SearchHit;pub use retrieval::SearchSource;pub use runtime::parse_pack_list;pub use runtime::KhiveRuntime;pub use runtime::RuntimeConfig;
Modules§
- curation
- Curation operations: entity update/merge and edge-list filter type.
- error
- Runtime error types.
- fusion
- Fusion strategies for combining ranked result lists.
- graph_
traversal - objectives
- Retrieval Objective implementations for khive-runtime.
- operations
- High-level operations composing storage capabilities into user-facing verbs.
- pack
- Pack runtime trait and verb registry (ADR-025 step 2).
- portability
- KG export / import — portable JSON archive for namespace-scoped knowledge graphs.
- retrieval
- Retrieval operations: local embedding generation and hybrid search with RRF fusion.
- runtime
- KhiveRuntime — composable handle to all storage capabilities.
Structs§
- Actor
Ref - Caller identity.
kinddistinguishes user vs agent vs lambda etc. - Allow
AllGate - Permissive gate — every request is allowed with no obligations.
- Audit
Event - Structured audit record emitted once per gate consultation (ADR-033).
- Gate
Context - Per-request context — session, timing, transport source.
- Gate
Request - What the gate sees on every verb invocation.
Enums§
- Audit
Decision - The outcome field of an
AuditEvent, serialised as"allow"/"deny". - Gate
Decision - Gate
Error - Obligation
- Side-effects a policy may attach to an
Allowdecision.
Traits§
- Gate
- Authorization gate consulted before each verb dispatch.
Type Aliases§
- GateRef
- Shareable handle to a
Gateimpl.