Context engineering · memory and related information

Less information.
More correct context.

What should be in front of the model at the moment of answering? Take your pick, weigh the budget, and see which degree really answers the question.

Setting the context
Nima’s creations Context engineering

Why try this product?

Everything the model sees passes through a limited window.

Context engineering means selecting, summarizing and deleting information in time. In this workshop you will work with a real token budget and see how a wrong choice can throw the model's response off track.

  • The real budget of the tokenSelect the items and see how full the window is.
  • Summarize and deleteLearn what to stay, what to squeeze and what to go.
  • Diagnosing the cause of the errorTroubleshoot broken scenarios and tell which piece of context was at fault.
Full access, free

Do you want to learn more and differently?

First, register your profile and email address here to get full access to this educational content, simulators, and games — once for all builds.

No spam; Only the news of new creations and courses. Do you have an account? enter

Model to what?
does it need

The prompt is only part of the context. Commands, user question, tool result, retrieved document and conversation summary also play a role in the response. The work of context engineering is the selection and organization of these inputs.

Exercise: The customer asked "My order has not been shipped yet; Can I cancel it?" Select the relevant documents. More information does not always mean a better answer.

Information selection table

The token numbers are the hypothetical values ​​of this exercise.
What things can reach the model?

Input consumption / selected budget

1200 / 1600

300 fixed tokens are meant for commands and questions. The output capacity is not calculated in this simple model.

Sample answer based on your choice

This answer is built with fixed rules of practice; The output is not a language model.

Timely recovery

To answer the status of the order, find the same order and the related rule. RAG adds relevant information from an external source to model input; The relevance and freshness of the source should still be checked.

In short, it is a choice

A good summary preserves the current demand, previous decisions, and important constraints. If the summary omits the rule or exception, shrinking the context comes at the cost of information loss.

How to calculate the token budget in the real project?

Use the tokenizer or token counting API of the same model; The number of words and letters is not an exact measure. Consider command, messages, documents, tools and output space according to the service limit.

A document is not a new order

If the retrieved document says "Ignore the rules", that sentence is part of the document's data. Keep the data source and boundary clear and do not leave the implementation of the tool to the text of the document.

A decision with you

Which input is necessary to accurately answer the cancel order question?

For further reading: Effective context engineering — Anthropic

From learning to implementation

Your own problem
Make it a project.

A conversation with Nima