recall() call carried about 1,118 tokens of context over a 16,075-token corpus, and about 1,864 tokens over a 201,987-token corpus, where full-context prompting sends the whole corpus on every call. Building the graph costs a one-time amount of tokens, which paid for itself after about 23–26 repeated queries on that report’s dense test corpus.
How Cognee compresses context
There are two ways to give an LLM knowledge of a document set:- Full-context prompting puts the entire corpus in the prompt on every question. The cost per call equals the corpus size, so total cost grows linearly with both corpus size and number of questions.
- Cognee memory does the expensive reading once.
remember()splits your data into chunks, then summarizes each chunk and extracts its entities and relationships into a knowledge graph.recall()then finds the passages, entities and facts relevant to the question and passes only those to the LLM.
Apollo 11 → landed on → Moon, and recall sends a bounded number of them per question, however large the corpus grows.
If you build a Global Context Index, it adds one more layer of compression: a dataset-wide summary, which the summary prompt asks to keep within 500 tokens, plus per-topic summaries. See Reading the Global Context Index for what it adds to recall.
What recall sends
By default, recall sends at most 10 source passages, 10 entities and 10 facts per question (top_k is 15, and each of those three is capped at 10). The entities and facts are the compressed graph. The passages are full chunk text, so they cost the most: how many tokens a call carries depends on your chunk size, and on a corpus of only a few chunks, recall can send nearly all of it. The saving grows once your data is much larger than 10 chunks, since recall never sends more than 10 passages.
To send the graph alone, turn the passages off with retriever_specific_config={"chunks_top_k": 0}:
When memory pays off
The token cost report compared Cognee with full-context prompting on a high-density synthetic corpus, packed with entities and relationships, at two sizes:
The report retrieved with
top_k = 10. The blog post on the 7× figure explains these numbers further.
Dense text is the expensive case, since graph extraction writes out more tokens for denser text. Cognee’s token usage analysis measured the one-time ingestion cost for four corpora of about 10–12k tokens each:
Ordinary prose costs about 8–10× its size to ingest at a 4,095-token chunk size, close to Cognee’s default of 4,096, against 14× for the dense corpus. Larger chunks lower the cost, because each chunk carries the same fixed prompt overhead. The analysis finds that break-even tracks this ingestion multiplier, so ordinary prose breaks even sooner than the report’s dense corpus, whose 23–26 queries are the outlier rather than typical input.
Memory pays off when you ask repeated questions over a stable corpus, which is how agents and assistants use memory. For a single question over a small document, sending the document directly is cheaper.
These are single runs. Graph extraction isn’t fully deterministic, so its output length varies between runs, most on dense text. Treat the numbers as representative, not exact.
How the ingestion numbers were measured
The token usage analysis runs real text throughremember()’s summary and graph-extraction calls and reads token counts from the actual LLM responses. The prompt wrapper and graph schema are therefore included, not estimated.
Measure it on your own data
To see how many tokens Cognee sends for a question, askrecall() for the prompt it would send instead of an answer. With only_context=True, Cognee builds the prompt without calling the LLM, so you can count its tokens and compare against your source text. Drop retriever_specific_config to measure default recall, passages included:
--retrieved-context.