Expand description
Unified public API for Cognee-Rust.
This crate provides a single entry point by re-exporting the core operations:
- add (
AddPipeline) - cognify (
cognify()free function and related types) - search (
SearchBuilder/SearchOrchestratorand related types)
§OpenTelemetry support
Cognee emits structured spans for every pipeline stage, search retriever,
and HTTP route. To export them to an OTLP collector (Grafana Tempo,
Honeycomb, Dash0, in-cluster otel-collector, …), enable the
telemetry cargo feature and set OTEL_EXPORTER_OTLP_ENDPOINT:
ⓘ
use cognee_lib::telemetry::{init_telemetry, TelemetryGuard};
use cognee_lib::config::{ConfigManager, Settings};
use tracing_subscriber::Registry;
let settings: Settings = ConfigManager::from_env().settings().clone();
let (_layer, _guard) = init_telemetry::<Registry>(&settings)
.expect("telemetry init");
// ... compose `_layer` onto your subscriber; spans are flushed when
// `_guard` is dropped.See docs/observability/opentelemetry.md
for the full operator guide, env-var reference, and deployment recipes.
Re-exports§
pub use api::notebooks::NotebookError;pub use api::notebooks::create_notebook;pub use api::notebooks::delete_notebook;pub use api::notebooks::list_notebooks;pub use api::notebooks::update_notebook;pub use api::DatasetDb;pub use api::DatasetError;pub use api::DatasetManager;pub use component_manager::ComponentManager;pub use config::ConfigError;pub use config::ConfigManager;pub use config::Settings;pub use context::PipelineContext;pub use error::ComponentError;pub use cognee_core;pub use cognee_database;pub use cognee_delete;pub use cognee_embedding;pub use cognee_graph;pub use cognee_llm;pub use cognee_models;pub use cognee_ontology;pub use cognee_session;pub use cognee_storage;pub use cognee_vector;pub use uuid;
Modules§
- add
- Data ingestion (add) pipeline.
- api
- Top-level API functions mirroring the Python SDK. High-level API functions for Cognee-Rust.
- cognify
- Knowledge-graph extraction (cognify) pipeline.
- component_
manager - Component lifecycle management. ComponentManager: lazy-initializing, shared component store.
- config
- Runtime configuration management. Shared configuration types for cognee-rust.
- context
- Pipeline execution context. Pipeline context trait for shared component access.
- core
- Core pipeline orchestration primitives.
- database
- Metadata database abstraction.
- delete
- Data and dataset deletion pipeline.
- embedding
- Embedding engine abstraction and providers.
- error
- Component error types. Error types for the cognee-lib crate.
- graph
- Graph database abstraction.
- llm
- LLM provider abstraction.
- models
- Core data models.
- ontology
- Ontology resolution.
- prelude
- Convenience re-exports for common usage.
- search
- Search pipeline and retrieval strategies.
- session
- Session management.
Public session management API — thin wrappers over
SessionManager. - storage
- File storage abstraction.
- telemetry
- Product-analytics telemetry. Telemetry surface for embedders.
- vector
- Vector database abstraction.
- visualization
- Knowledge-graph visualization (requires
visualizationfeature).
Structs§
- AddParams
- Optional parameters for the
AddPipeline::addmethod. - AddPipeline
- Ingest pipeline driven by the cognee-core task framework.
- Content
Hasher - Processed
Input - Metadata extracted from a
DataInputduring streaming processing.
Enums§
- Visualization
Error - Errors that can occur while generating an HTML graph visualization.
Functions§
- build_
add_ pipeline - Build a complete ingest
Pipeline:DataInput→ProcessedInput→Data. - generate_
dataset_ id - Generate a deterministic dataset ID matching Python’s formula:
uuid5(NAMESPACE_OID, f"{dataset_name}{str(user_id)}{str(tenant_id)}") - make_
persist_ data_ task - Build a
TypedTaskthat resolves or creates the dataset, deduplicates by content hash, persists a newDatarecord if needed, and returns it. - make_
process_ input_ task - Build a
TypedTaskthat streams aDataInputto storage, hashes its content, and returns a self-containedProcessedInput. - persist_
data - Persist a
ProcessedInputas aDatarecord: resolve or create the dataset, deduplicate by content hash, create the record if new, and attach it to the dataset. - process_
input - Process a single
DataInput: resolve URLs, stream to storage, compute content hash, and extract all metadata needed to create aDatarecord. - visualize
- Generate an interactive HTML knowledge-graph visualization of the supplied graph database.