← Back to Blog
Research

Context Engineering: Why Google's "Mise en Place" Requires Information Theory

Moving beyond geometric distance to information-theoretic scoring for precise context retrieval in agentic AI systems.

Published
Read
7 min read
Author
Majid Fekri, CTO

The Chef's Dilemma

I was reading Google's recent white paper on Context Engineering, and one passage perfectly captures the single biggest bottleneck in Agentic AI today. They compare the preparation of an LLM's context window to a chef's mise en place:

"If you only give a chef the recipe (the prompt), they might produce an okay meal with whatever random ingredients they have. However, if you first ensure they have all the right, high-quality ingredients... they can reliably produce an excellent, customized result."

The problem with most RAG systems today is that they are still tossing "random ingredients" at the model. They rely on Geometric Distance (specifically Cosine Similarity) to select context.

Mathematically, Cosine Similarity only measures the angle between two vectors. It asks: "Is this data point spatially close to the query?"

It does not ask: "Does this data point actually contain the information required to solve the query?"

This leads to the "Clutter Problem": retrieving data that is mathematically close but semantically irrelevant. You fill the context window with noise, and the "Chef" (the LLM) gets confused.

Cosine Similarity

🥕
🔧
🧸
📦
🎨
⚙️

Geometric Proximity

ITS + Kiosk Mode

🥕
🧅
🧄
🥔
🌶️
🍅

Information Relevance

Beyond Geometry: The Full Covariance Matrix

To build the ultimate memory for AI agents, we realized we had to go deeper than standard vector search. We had to move beyond simple geometric proxies and look at the Physics of Information.

Moorcheh's engine is built on Information-Theoretic Scoring (ITS).

Unlike Cosine Similarity, which treats dimensions independently or purely spatially, ITS utilizes the full covariance matrix of your dataset. It analyzes how information flows between dimensions.

Covariance Matrix

Think of ITS as a universal relevance metric (normalized 0 to 1). It statistically measures: "How much uncertainty about the query is reduced by this specific piece of data?"

By leveraging the covariance structure, Moorcheh ensures your agent receives no more and no less than the most relevant information—the perfect mise en place for every generation.

Dynamic Thresholding: The Agent's Choice

This brings us to the practical application of Context Engineering: Agentic Agency.

Not all tasks require the same level of strictness.

  • Creative Writing Agent: Needs a loose association of ideas (Low Threshold).
  • Legal Compliance Agent: Needs absolute, precise fact retrieval (High Threshold).

In standard Vector DBs, setting a "Distance Threshold" (e.g., distance < 0.4) is arbitrary and varies wildly depending on the embedding model used. 0.4 in OpenAI's embedding space means something totally different than 0.4 in Cohere's.

Because ITS is normalized (0-1) and grounded in information theory, it is consistent. This enables Kiosk Mode.

Kiosk Mode in Practice

Moorcheh makes this readily available within the /search and /answer endpoints. Agents can now dynamically choose their own "Relevance Threshold" at runtime.

python
# A Legal Agent demanding high precision
response = client.answer(
    query="What is the liability cap?",
    kiosk_mode=True,
    threshold=0.85,  # Strict: Only high-information matches
    ai_model="anthropic.claude-sonnet-4.5"
)

If the data retrieved has an ITS score of 0.72, Moorcheh will automatically filter it out before it hits the LLM. The agent is protected from low-quality ingredients.

Context Engineering isn't just about prompt tuning; it's about the physics of information.

§ More field notes

All posts →