Skip to main content

Module api

Module api 

Source
Expand description

Top-level API functions mirroring the Python SDK. High-level API functions for Cognee-Rust.

These are the top-level convenience functions that compose the lower-level pipeline primitives (add, cognify, search, delete, memify) into user-friendly operations matching the Python SDK.

  • [forget] – Unified deletion API
  • [update] – Data replacement (delete + re-add + re-cognify)
  • [prune] – Selective backend cleanup
  • [recall] – Smart search with session routing
  • [remember] – One-call add + cognify + optional improve
  • [improve] – Bidirectional session-graph bridge

Re-exports§

pub use datasets::DatasetDb;
pub use datasets::DatasetManager;
pub use error::ApiError;
pub use error::DatasetError;
pub use forget::DatasetRef;
pub use forget::ForgetResult;
pub use forget::ForgetTarget;
pub use forget::forget;
pub use improve::ImproveParams;
pub use improve::ImproveResult;
pub use improve::improve;
pub use pipeline_runs::reset_dataset_pipeline_run_status;
pub use pipeline_runs::reset_pipeline_run_status;
pub use prune::PruneResult;
pub use prune::PruneTarget;
pub use prune::prune_data;
pub use prune::prune_system;
pub use recall::RecallResult;
pub use recall::recall;
pub use remember::RememberItemInfo;
pub use remember::RememberResult;
pub use remember::RememberStatus;
pub use remember::remember;
pub use remember::remember_entry;
pub use update::UpdateResult;
pub use update::update;
pub use user::get_or_create_default_user;

Modules§

datasets
High-level dataset management facade.
error
Shared error types for the high-level API functions.
forget
Unified deletion API – forget().
improve
Bidirectional session-graph bridge — improve().
notebooks
cognee_lib::notebooks — per-user notebook CRUD facade.
pipeline_runs
Python-parity reset helpers for the pipeline_runs table.
prune
Selective backend cleanup – prune_data() and prune_system().
recall
Smart search with session routing – recall().
remember
One-call add + cognify + optional improve – remember().
update
Data replacement API – update().
user
Default user management.

Structs§

RecallItem
A single recall result item.
RecallOptions
Advanced tuning options forwarded from cognee_lib::api::recall::RecallOptions.

Enums§

RecallScope
Scope selector. Mirrors Python’s RecallScope = Literal["auto", "graph", "session", "trace", "graph_context", "all"] (cognee/memory/entries.py:75). Auto is the sentinel returned by normalize_scope(None) and is resolved into concrete sources inside recall(). All never appears in a normalized list — it expands to the four concrete sources during normalization.
RecallSource
Source tag for recall results. Mirrors the discriminator strings emitted by Python’s _search_session, _search_trace, _fetch_graph_context, and _run_graph helpers in cognee/api/v1/recall/recall.py.
ScopeInput
Untyped input accepted by normalize_scope – mirrors Python’s Optional[Union[str, list[str]]] (entries.py:81). HTTP/CLI layers can build a ScopeInput directly from JSON; callers with a strongly-typed Vec<RecallScope> can pass it via recall()’s scope parameter without going through this helper.

Functions§

normalize_scope
Normalize the recall scope parameter to a concrete source list, mirroring Python’s normalize_scope at cognee/memory/entries.py:81-115.