pub struct ComponentHandles {Show 19 fields
pub database: Arc<DatabaseConnection>,
pub acl_db: Option<Arc<dyn AclDb>>,
pub storage: Arc<dyn StorageTrait>,
pub delete_service: Arc<DeleteService>,
pub cloud_client: Option<Arc<dyn CloudDeleteClient>>,
pub ontology_manager: Arc<OntologyManager>,
pub search_orchestrator: Option<Arc<SearchOrchestrator>>,
pub llm: Option<Arc<dyn Llm>>,
pub transcriber: Option<Arc<dyn Transcriber>>,
pub graph_db: Option<Arc<dyn GraphDBTrait>>,
pub vector_db: Option<Arc<dyn VectorDB>>,
pub thread_pool: Option<Arc<dyn CpuPool>>,
pub embedding_engine: Option<Arc<dyn EmbeddingEngine>>,
pub ontology_resolver: Option<Arc<dyn OntologyResolver>>,
pub session_store: Option<Arc<dyn SessionStore>>,
pub session_manager: Option<Arc<SessionManager>>,
pub checkpoint_store: Option<Arc<dyn CheckpointStore>>,
pub responses_client: Option<Arc<dyn ResponsesClient>>,
pub notebook_runner: Option<Arc<dyn NotebookRunner>>,
}Expand description
Pre-initialized pipeline component handles shared across all P2 handlers.
Obtained from state.components().
Fields§
§database: Arc<DatabaseConnection>SeaORM database connection (implements IngestDb, DeleteDb).
The AclDb implementation is provided by the closed
cognee-access-control crate and wired through Self::acl_db.
acl_db: Option<Arc<dyn AclDb>>Optional ACL backend. None in pure-OSS builds (which do not enforce
permissions). Wired by the closed cloud assembly to a newtype that
implements AclDb over the shared DatabaseConnection.
storage: Arc<dyn StorageTrait>File storage backend.
delete_service: Arc<DeleteService>Fully configured DeleteService (with storage + DB wired).
cloud_client: Option<Arc<dyn CloudDeleteClient>>Optional cloud delete proxy used by POST /api/v1/forget.
ontology_manager: Arc<OntologyManager>Ontology manager (per-user file storage).
search_orchestrator: Option<Arc<SearchOrchestrator>>Pre-built search orchestrator. None means HTTP search is unwired
— handlers return SearchError {500, "Internal server error"}.
llm: Option<Arc<dyn Llm>>Configured LLM adapter for /api/v1/llm/* handlers.
transcriber: Option<Arc<dyn Transcriber>>Transcriber for audio document processing (Whisper). None when the
configured LLM provider does not support audio transcription.
graph_db: Option<Arc<dyn GraphDBTrait>>Knowledge-graph DB used by the visualize router.
vector_db: Option<Arc<dyn VectorDB>>Vector DB handle required by cognee_core::TaskContext when the
add / cognify / memify convenience functions route through
pipeline::execute (LIB-06). None means the corresponding
pipeline handlers surface a 500 / 409 envelope at runtime.
thread_pool: Option<Arc<dyn CpuPool>>CPU pool used by cognee_core::TaskContext. Same routing notes
as vector_db.
embedding_engine: Option<Arc<dyn EmbeddingEngine>>Text embedding engine used by the cognify pipeline (chunks, entities,
summaries). None means the cognify / update handlers surface a 500
envelope at runtime.
ontology_resolver: Option<Arc<dyn OntologyResolver>>Ontology resolver passed into the cognify pipeline. None means
the cognify / update handlers fall back to a pass-through
NoOpOntologyResolver, matching the CLI default when no
ontology_file_path is configured.
session_store: Option<Arc<dyn SessionStore>>Backing store for session Q&A history — wires the session source
of POST /api/v1/recall (Python _search_session,
recall.py:146-208). None means session-source recall returns
empty (matches Python’s is_available short-circuit at
recall.py:170-171). Reuses the SessionStore re-exported by
cognee-search to avoid pulling cognee-session into the crate’s
non-dev dependency graph.
session_manager: Option<Arc<SessionManager>>Manager for agent-trace sessions and the per-session graph context
snapshot — wires the trace and graph_context sources of
POST /api/v1/recall (Python _search_trace /
_fetch_graph_context). None means both sources return empty.
checkpoint_store: Option<Arc<dyn CheckpointStore>>Checkpoint store used by improve Stage 4 (sync_graph_to_session) to
persist per-session high-water marks and avoid re-syncing old edges.
responses_client: Option<Arc<dyn ResponsesClient>>OpenAI Responses API client — wires POST /api/v1/responses
(Python get_responses_router.py). None means the handler
returns 500 “responses client is not wired” until embedders
populate it.
notebook_runner: Option<Arc<dyn NotebookRunner>>Notebook cell execution backend used by
POST /api/v1/notebooks/{notebook_id}/{cell_id}/run. None means
the handler returns 501 — the same envelope it returned in Stage A
before Stage B landed — preserving wire compatibility for embedders
that don’t want to expose code execution.
Implementations§
Source§impl ComponentHandles
impl ComponentHandles
Sourcepub async fn formatted_graph_data(
&self,
dataset_id: Option<Uuid>,
user_id: Uuid,
) -> Result<Value, Error>
pub async fn formatted_graph_data( &self, dataset_id: Option<Uuid>, user_id: Uuid, ) -> Result<Value, Error>
Return the formatted knowledge-graph data for a dataset as the JSON
shape {"nodes": [...], "edges": [...]}.
Wires to cognee_graph::get_formatted_graph_data when both a
graph_db handle and a dataset_id are available. When either is
missing — e.g. the server is running in test mode without backends —
returns the empty-graph fallback {"nodes": [], "edges": []} so that
the WS frame still has a valid shape.
Python parity: cognee.modules.graph.methods.get_formatted_graph_data.
Trait Implementations§
Source§impl Clone for ComponentHandles
impl Clone for ComponentHandles
Source§fn clone(&self) -> ComponentHandles
fn clone(&self) -> ComponentHandles
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ComponentHandles
impl !UnwindSafe for ComponentHandles
impl Freeze for ComponentHandles
impl Send for ComponentHandles
impl Sync for ComponentHandles
impl Unpin for ComponentHandles
impl UnsafeUnpin for ComponentHandles
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.