← All AI Engineer talks

AI Engineer World's Fair 2026

When all context matters: Extended Cache Augmented Generation (ECAG)

Read the talk

When All Context Matters: Extended Cache Augmented Generation

ECAG distributes a rapidly changing document collection across cached context buckets, then uses a supervisor model to explore their contents and assemble an answer.

From a talk by Luis Romero-Sevilla

Before you start: Basic familiarity with LLM context windows and document retrieval is helpful; embeddings, graph retrieval, and KV caching are explained as they arise.

A collection where every document matters

Suppose you have a large collection of documents describing an event. Answering the user's questions requires information from every document. Then add a second constraint: the collection becomes obsolete quickly, and the whole set must be replaced. A system must preserve access to the entire collection without making each replacement prohibitively expensive. This is the knowledge-representation problem Luis Romero-Sevilla, who introduces himself as VP of AI at Orbis Operations, sets out to solve.

A bronze robot sits amid scattered papers while more documents cascade overhead.
A robot surrounded by a downpour of documents.
0:000:19
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

0:00 · section reference included

Vector RAG makes replacement practical

Start with ordinary retrieval-augmented generation, or RAG. An embedding model and a vector database provide a straightforward pipeline:

  1. Convert each document into a learned numerical vector.
  2. Store those vectors in a database designed for vector operations.
  3. Embed the user's question into the same representation space.
  4. Retrieve documents whose vectors meet a similarity threshold, then supply their content to the LLM to answer the question.

Romero-Sevilla describes vector insertion as relatively fast, making it practical to replace an obsolete collection with a new one. But the retrieval step creates a mismatch with this workload: it selects material by similarity when the answer needs information from the whole collection. A document can matter to the global explanation without looking sufficiently similar to the initial question. Simply passing everything to the LLM would bypass that selection problem, but it would also move the burden into the model's context window.

0:450:53
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

0:45 · section reference included

GraphRAG exposes relationships—and must rebuild them

If all the documents contribute to a global question, relationships between their details become useful structure. GraphRAG builds that structure by having an LLM read the documents and extract entities and relationships into a knowledge graph. Answering can then draw on connections across the collection instead of relying only on similarity to the question.

Romero-Sevilla describes the answering process as navigating the graph to synthesize a complete response. More specifically, Microsoft's GraphRAG global search uses pregenerated community reports, produces partial answers, and aggregates their useful content into a final answer. The graph supports a representation of the collection that can serve global questions.

That preprocessing is attractive when documents remain useful for a while. Romero-Sevilla recommends GraphRAG for collections that change infrequently. In the opening scenario, however, the documents are both densely interconnected and frequently replaced. Repeatedly extracting entities and relationships and reconstructing the graph makes each refresh computationally expensive and relatively slow. The useful structure has a short life in which to repay its construction cost.

1:552:08
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

1:55 · section reference included

Keep the documents in cached context

Graph construction already requires each document to pass through an LLM. What if that pass retained the document context directly, instead of extracting a separate graph? Cache Augmented Generation, or CAG, loads the documents into a model with a large context window and caches the computed key/value inference state for that document prefix. Subsequent questions can reuse this state. The KV cache contains intermediate inference computations, not changes to the model's learned weights.

A robot floats beside a cylindrical chamber containing a glowing grid, with the words Context and Cache above.
Context caching illustrated as a glowing lattice in a chamber.

The limit is the context window itself. The collection must fit, and answer quality can deteriorate as the amount of context grows, depending on the model, task, and context length. Caching avoids repeatedly computing the same prefix; it does not create unlimited capacity or guarantee that the model will use every detail effectively.

3:083:21
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

3:08 · section reference included

Extend CAG with parallel context buckets

Extended Cache Augmented Generation, or ECAG, distributes the collection across multiple CAG instances. Each context bucket holds part of the collection and answers questions about its own contents. A more capable supervisor model asks questions of the buckets and synthesizes their responses into an answer. The collection no longer has to fit inside one document context.

Partitioning by domain sounds convenient: give each bucket a category and let the supervisor choose where to look. But Romero-Sevilla reports that, with dense relationships across documents, the supervisor tends to ignore categories that appear irrelevant at first glance. Those skipped categories may contain precisely the connections needed to answer the global question.

The proposed allocation therefore uses no particular document order and balances document counts across buckets. A simple TypeScript allocation helper illustrates that rule without introducing domain labels:

typescript

function distributeDocuments<T>(
  documents: readonly T[],
  bucketCount: number,
): T[][] {
  if (!Number.isInteger(bucketCount) || bucketCount < 1) {
    throw new RangeError("bucketCount must be a positive integer");
  }

  const buckets = Array.from(
    { length: bucketCount },
    (): T[] => [],
  );

  documents.forEach((document, index) => {
    buckets[index % bucketCount]!.push(document);
  });

  return buckets;
}

const buckets = distributeDocuments(
  ["event-a", "event-b", "event-c", "event-d"],
  2,
);
// [["event-a", "event-c"], ["event-b", "event-d"]]

Here, each document goes into one bucket, and the counts are balanced without inspecting subject matter. This handles allocation only: choosing a bucket count still requires ensuring that each bucket's document content fits its model's usable context. Equal document counts do not imply equal token counts.

3:463:54
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

3:46 · section reference included

Build understanding through follow-up questions

The supervisor progressively explores the buckets and builds its understanding from their responses. When something interesting appears, it can return to a specific bucket with a follow-up question. This makes answering an iterative process: an initial response can reveal which detail to investigate next, rather than forcing all relevance decisions into the first query. All the document caches can be loaded in parallel.

For this workload, Romero-Sevilla claims significantly faster knowledge building than GraphRAG and more accurate answers than simple RAG. He supplies no latency measurements, accuracy metric, corpus size, model configuration, hardware, or concurrency conditions for that comparison. Parallel cache loading explains the proposed reduction in preparation time, while bucket exploration is intended to recover information that a similarity-based retrieval step might omit.

A gold balance labeled Accuracy and Speed, with a partly obscured Cost label, a glowing ECAG tile, and a robot on the right pan.
ECAG depicted alongside a balance of speed, cost, and accuracy.
4:404:56
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

4:40 · section reference included

Cache lifetime is part of the architecture

Keeping multiple KV caches available can be expensive. Romero-Sevilla identifies cache lifetime as a way to reduce that cost: optimize how long each cache remains alive. In a workload where documents quickly become obsolete, the useful life of their cached state matters alongside the speed of creating it. The talk leaves the cache provider, expiration policy, and pricing model unspecified.

ECAG is a response to a particular combination of requirements: whole-collection reasoning, dense relationships, and frequent replacement. Its supervisor and cached buckets exchange graph-building work for cache retention and repeated model interrogation. Compute, cost, and speed remain trade-offs; which architecture makes sense depends on how long the knowledge stays useful and what the questions require.

5:065:26
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

5:06 · section reference included

Resources

From the talk

Read the complete timestamped transcript
  1. 0:00

    [outro jingle] Hi, I'm Luis Romero-Sevilla, and I'm the VP of AI at Orbis Operations. I'm on a mission to solve knowledge representation when all context matters.

  2. 0:19

    So let's start with a very specific example. Let's say you have a large number of documents, and all documents represent an event, and all documents in the collection are relevant to answer a set of questions that the user has.

  3. 0:34

    Not only that, there's one more challenge. The document in the collection becomes obsolete very fast, and all documents get replaced with new information.

  4. 0:45

    Let's start with the simplest approach. We could start with a simple RAG. For that, we just need a vector database and an embedding model.

  5. 0:53

    An embedding model takes the documents and turns them into a learned numerical representation vector. Now we take those vectors, and we store them in a database optimized for performing operations with vectors.

  6. 1:07

    Perfect. Now we can take all of our questions, turn them into vectors, and then look for vectors that are similar to the initial query.

  7. 1:18

    Those vectors that are within the tri-- similarity threshold are retrieved, and we can pass them to the LLM to answer the question.

  8. 1:27

    Inserting to a vector database, it's relatively fast. So whenever a collection becomes obsolete, we can just replace it with a new one.

  9. 1:36

    We still have one problem with our very specific scenario.

  10. 1:41

    All the documents in the collection are relevant for us to answer the question, so we can't just take all the documents in the collection and pass them to LLM, and that's just one of the many limitations with this approach.

  11. 1:55

    Now let's get a bit more sophisticated. All documents are relevant to answer a global question. Therefore, there must be some connections and relationship between the details within a document in the collections.

  12. 2:08

    For us to map out those relationship, we're going to need a knowledge graph, and one implementation we could try is GraphRAG. GraphRAG has many steps, but basically it uses an LLM to read through all the documents and extract key entities and relationship between them.

  13. 2:27

    It constructs a network, a knowledge graph, where all those connections and details are tied together. Then when the question is asked, it navigates this graph to synthesize a complete answer drawn across the entire collection.

  14. 2:39

    If your collection of documents isn't changing very often, GraphRAG is an excellent approach for finding those relationships within details to answer the user's question.

  15. 2:51

    However, our very specific scenario states that our data is not only deeply interconnected, but also the data gets replaced very often. Recomputing a knowledge graph every time the data gets replaced is computationally very expensive, and it takes relatively long time.

  16. 3:08

    Okay, what if we take an even simpler approach, and we continue to build on top of it? If we were to use something like GraphRAG, each document needs to pass through an LLM for the entity and relationship extraction anyway.

  17. 3:21

    Why can't we just throw all the documents into context? This approach will look something like Cache Augmented Generation, CAG, where we use a model with a large context window, load the documents into the context, and cache the context by storing the model's KV matrix.

  18. 3:38

    The problem here is that the context window is limited, and if you fill the context window too much, the quality of the answer gets degraded too.

  19. 3:46

    The solution: what if we use more CAGs in parallel and distribute the documents across different context buckets?

  20. 3:54

    Now each CAG can answer questions regarding its content, and now we just need something to ask the right questions to the right buckets. So for this, we can use a smarter model to interrogate each bucket and eventually synthesize an answer.

  21. 4:11

    How do we distribute the documents? It sounds tempting to organize the documents by domains and tell the supervisor, "Hey, here are the different categories." But in practice, with very dense relationship between documents, the supervisor tends to ignore domains that at first glance seem irrelevant.

  22. 4:30

    For this reason, all documents are distributed in no particular order. The only requirement is to balance the number of documents in a way that the least amount of documents are needed.

  23. 4:40

    Then the supervisor model start exploring the buckets and progressively build its internal understanding. And if it finds something interesting, it can ask a specific bucket follow-up questions. Because all caches can be loaded in parallel,

  24. 4:56

    the knowledge-building process is significantly faster than GraphRAG while providing more accurate answers than a simple RAG.

  25. 5:06

    And you're probably thinking, "KV cache can be pretty expensive," and you're absolutely right. But there are ways to reduce that cost by optimizing how long each cache lives. And at the end, there are many retrieval strategies, and all of them have their trade-offs, whether it's compute, cost, speed.

  26. 5:26

    Currently, there is no one solution fits all. So ECAG is our solution to our very specific problem. Thank you for watching and for questions or continuing this conversation, gonna leave my details here. [outro jingle]