Skip to main content

normalize_scope

Function normalize_scope 

Source
pub fn normalize_scope(
    input: Option<ScopeInput>,
) -> Result<Vec<RecallScope>, SearchError>
Expand description

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

  • None -> [Auto] (Python: ["auto"]).
  • "all" -> [Graph, Session, Trace, GraphContext] (entries.py:105-106).
  • Single string -> singleton list.
  • List of strings -> order-preserving dedup (entries.py:108-115).
  • Unknown values -> Err(SearchError::InvalidInput(...)) with the Python-parity error message (entries.py:99-103).