What is the remember operation
The.remember operation is the main ingestion entry point in Cognee v1.0. It stores information in memory with a single API call.
It has two modes:
- Permanent memory: without
session_idprovided,remember()runs the full ingestion pipeline for you — normalizing your data, building the knowledge graph, and enriching it for retrieval, all in one call. Cognee does not create a session ID for this path. - Session memory: with
session_id,remember()writes to the session cache for fast short-term memory. Ifself_improvement=True(the default), it then starts a background Improve pass to bridge that session content into the permanent graph. - Dataset-aware: permanent memory is written into a named dataset, which defaults to
main_dataset.
Where remember fits
- Use
remember()when you want the simplest way to get data into Cognee. - Use it for raw text, files, file lists, and
DataItemobjects. - Use
session_idwhen you want fast conversational memory first and long-term graph sync second. - Use
self_improvement=Falseif you want to skip the follow-up improvement pass.
What happens under the hood
Permanent memory
- Ingest — data is normalized and attached to a named dataset.
- Build the graph — documents are chunked, entities and relationships are extracted, and embeddings are created.
- Enrich — by default, Cognee runs a follow-up Improve pass that adds derived retrieval structures to the graph.
Session memory
- Store in session cache — the content is written to the cache keyed by user and session.
- Return immediately — the call completes quickly with a session-stored result.
- Optional background bridge — when
self_improvement=True(default), Cognee immediately starts Improve in the background to sync that session into the permanent graph. - Manual bridge when disabled — when
self_improvement=False, nothing is bridged automatically; the content stays in session cache until you explicitly runcognee.improve(dataset=..., session_ids=[...]).
After remember finishes
- Permanent memory: your data is stored in a dataset, chunked, turned into graph structure, embedded for retrieval, and usually enriched with an immediate follow-up improve pass.
- Session memory: your data is available quickly through the session cache; it only becomes permanent graph memory if the improvement bridge runs.
Examples and details
Accepted inputs
Accepted inputs
remember() accepts these input types (any of these, or a list mixing them):- Raw text strings — e.g.
"Einstein was born in Ulm." - Local file paths as strings — absolute (
"/path/to/doc.pdf"),file://URLs, or relative paths that resolve to an existing file - HTTP/HTTPS URLs as strings — fetched and ingested in permanent mode
- S3 paths as strings —
"s3://bucket/key"(requiress3fs) DataItemobjects — a lightweight wrapper for attaching metadata to any of the above (see below)- HTTP upload objects with
.fileand.filenameattributes — e.g. FastAPIUploadFile. This is the supported path for “file-like” inputs in permanent-memory mode; it is what the HTTP API uses internally
In the default blocking mode, plain Python file handles such as
open("doc.pdf", "rb") (i.e. BufferedReader) are not accepted and will raise IngestionError: Data type not supported. Pass the file path as a string instead, wrap the bytes in an object that exposes .file and .filename, or use run_in_background=True so Cognee can materialize stream-like inputs before scheduling the pipeline.- Plain text is stored directly as memory content.
- File paths are ingested and normalized into text before graph building.
- HTTP/HTTPS URLs are fetched and passed through the ingestion pipeline.
- Dataset scoping still applies through
dataset_name.
In session-memory mode, a URL string is stored in the session cache as text. It is not fetched or scraped. Permanent mode is required for URL ingestion to work end-to-end.
DataItem?DataItem is a small dataclass exported from cognee.tasks.ingestion.data_item that lets you attach metadata to a single input alongside its content. Use it when you want a stable ID or extra labels travelling with the data through the ingestion pipeline.data field of a DataItem accepts the same types as remember() itself (string text, file path, URL, etc.). You can also pass a list of DataItem objects to ingest several items in one call.Supported formats
Supported formats
In permanent-memory mode,
remember() supports the following file formats out of the box:This formats table applies only to permanent-memory
remember(). In session-memory mode, remember() does not parse files or fetch URLs; it stores the provided content as session text, so plain text inputs are the recommended form. Non-text inputs become text representations rather than parsed source content.Users and ownership
Users and ownership
- Permanent-memory
remember()writes data into a dataset owned by a user. - If you do not pass a user explicitly, Cognee resolves or creates the default user context.
- Ownership affects who can later read, write, share, improve, or forget that dataset.
- In session-memory mode, entries are still scoped to the current user in the session cache, so the same
session_idunder different users does not mean shared memory.
What permanent remember produces
What permanent remember produces
When
remember() runs without session_id, the result is not just stored text. It produces the full retrieval-ready memory stack:- Dataset records in the relational store
- Normalized source content attached to that dataset
- Chunks created from the ingested content
- Graph nodes and edges extracted from those chunks
- Embeddings and summaries used for retrieval
- Improvement artifacts from the follow-up improve pass when
self_improvement=True, depending on the active enrichment configuration
What session remember produces
What session remember produces
When
remember() runs with session_id, it behaves differently:- The content is written to the session cache for that user and session.
- The call returns quickly with a session-stored result.
- The content is available for session-aware Recall immediately.
- No permanent graph write happens unless the improvement bridge runs.
Session availability and configuration
Session availability and configuration
Session memory is enabled by default in the current Cognee 1.0 configuration.If session caching is disabled or unavailable,
session_idworks through the cache layer used for session storage.- The default cache backend is filesystem-based cache.
- If you want to disable session caching entirely, set
CACHING=false. - If you want a shared or production-oriented backend, set
CACHE_BACKEND=redis.
remember(..., session_id=...) cannot persist session memory in the normal way. For broader cache behavior and adapters, see Sessions and Caching.If the session cache is unavailable,
remember(..., session_id=...) can still return a session-style result object, but the session content may not actually have been stored. If session memory matters for your workflow, make sure caching is enabled and available.Latency and cost
Latency and cost
The two remember modes have very different cost and latency profiles:
- Session memory is the fast path. It writes to session cache and returns quickly.
- Permanent memory is the heavier path. It runs ingestion, chunking, graph extraction, embedding, and usually improvement.
remember() is the right choice when you want durable graph memory, but it costs more time and more model work than session-only storage.The biggest cost drivers are:- How much data you ingest
- How many chunks the content becomes
- The graph extraction and summarization work during graph building
- Whether
self_improvement=Trueadds a follow-up improvement pass
chunk_size, chunker, and custom_prompt. If you want the lightest permanent ingestion path, set self_improvement=False.Background execution and result object
Background execution and result object
remember()returns a promise-likeRememberResult.- In blocking mode, it finishes only after the permanent pipeline completes.
- With
run_in_background=True, it returns immediately and you canawaitthe result later. - Useful fields include status, dataset name, elapsed time, and the raw pipeline result.
With
run_in_background=True, file-like inputs (HTTP upload objects exposing .file/.filename, or stream-like objects with .read()) are read up-front and copied into owned in-memory buffers before the background task is scheduled. This lets background runs outlive the originating request or stream — you can pass an upload object or stream and let the call return immediately without the underlying stream being closed out from under the pipeline. Plain text strings, file paths, and URLs are unaffected.Concurrent recall while indexing is running
Concurrent recall while indexing is running
You can call recall while a permanent-memory
remember() run is still indexing in the background. Cognee does not place a global lock over ingestion and retrieval.- Existing indexed data remains searchable while new data is being processed.
- Newly ingested content only becomes available to graph-backed
recall()once its indexing work has completed. - In practice, that means a background
remember()run may produce partial retrieval coverage until the dataset finishes processing.
Checking indexing status
Checking indexing status
When Possible status values:
remember() writes to permanent memory, it runs a multi-step indexing pipeline in the background of that operation. For larger datasets, you may want to verify that indexing completed before calling recall.- Python SDK
- HTTP API
For the low-level API reference, see cognee.datasets.get_status().
RememberResult format
RememberResult format
remember() returns a RememberResult object. In docs terms, it behaves like a small status object you can print, inspect, or await.Common fieldsTypical shapes
Permanent memory completed
Permanent memory completed
Session memory stored in cache
Session memory stored in cache
Background execution running
Background execution running
Parameters
Parameters
- Basic Parameters
- Advanced Parameters
Under the hood — legacy operations
Under the hood — legacy operations
Inspect what you've stored
Inspect what you've stored
After calling See datasets API reference for the full set of listing and management methods.
remember(), you can list datasets and browse their contents using cognee.datasets:Recall
Query memory with auto-routing and session awareness
Improve
Enrich the graph and bridge session memory