SYSTEM NOTICE

Auto translation by AI. Be sure, accuracy, nuances and authorial intent may not be fully reflected.
見出し画像

An Introduction to 'Context Engineering': Changing Common Sense in AI

You thought you gave ChatGPT the best instructions, but it returned a somewhat lackluster answer. Even after copy-pasting the 'ultimate' prompt you found online, you didn't get the results you expected.

Have you ever had that experience?

Actually, that is not because your way of giving instructions is bad. It might be because you are not providing the AI with an environment where it can do its job.

Right now, at the forefront of AI development, the era of desperately trying to craft the perfect prompt is ending, and we are entering an era of designing context (environment and background).

In this article, I will explain context engineering, which is becoming an essential AI skill, in an easy-to-understand way without using technical jargon.


1. AI is a genius detective with amnesia

To understand the new concept of context engineering, it is helpful to imagine AI as a genius detective with amnesia.

He has a top-tier brain, so he can solve any difficult problem. However, he has a fatal weakness: he knows nothing about you or the current situation.

Traditional prompt engineering was like handing this detective only a letter (instruction sheet).

'You are a master detective. Please identify the culprit using your best reasoning.'

You just hand him a letter written like that. But even the detective is troubled by this. He wants to ask, 'Where is the crime scene? Who is the victim? What are the alibis?' but he has no information. So, he has no choice but to tell a plausible lie or gloss over the situation with harmless generalities.

The technology to build an investigation headquarters

On the other hand, the new context engineering approach is different. Instead of writing a letter, you build the investigation headquarters itself for the detective.

You put up a correlation diagram on a whiteboard, lay out evidence on the desk, and prepare past case files. You invite him in, saying, 'Now, the situation is all set. All that's left is to use your brain.'

This is context engineering. It is not about how to command, but about designing what state of knowledge the AI is in. That is what dramatically changes AI performance.

2. Understanding the difference between three terms through filmmaking

The three terms often heard in the AI field—CE, PE, and RAG—can also be clearly understood by comparing them to filmmaking.

Context Engineering (CE)

This is the film director. It is the role of creating the worldview of the entire work, including stage sets, actor placement, scripts, and lighting. It designs the entire system for the AI to operate.

RAG (Retrieval-Augmented Generation)

This is the reference material. It is the technique of finding and providing historical documents or manuals necessary for character development from a library. It is a mechanism that allows AI to refer to external knowledge (such as internal company documents).

Prompt Engineering (PE)

This is the dialogue. It refers to the single instruction spoken by an actor on a prepared stage.

Many people focus only on the dialogue (prompt), but even the best actor cannot be expected to 'be moving' in a space without a set or costumes. Only when the director (CE) prepares the perfect stage does that dialogue (PE) come to life.

3. Four techniques to organize the AI's mental desk

So, what exactly does a director called a context engineer do?

There is a limit to the amount of information an AI can remember at one time. In other words, there is a limit to the size of the AI's workspace desk. If unnecessary documents or irrelevant conversation history are scattered across this small desk, the AI cannot work.

Therefore, engineers organize the desk using mainly four methods.

Write

This is the task of sticking rules that must never be forgotten onto the desk. For example, notes like 'Always use polite language' or 'Output only source code' are placed in the most visible spot on the desk.

Select

This is a technique called RAG. If you place a thick dictionary on the desk, it will fill up. So, the idea is to copy only the one necessary page relevant to the current task and place it on the desk.

Compress

If you make the AI read the minutes of a long meeting as they are, it will strain the AI's brain capacity. Therefore, we rewrite them into notes that summarize the key points, such as 'Person A agreed with Proposal B,' before providing them.

Isolate

Analyzing data, creating graphs, and writing emails. If you make one person do all of this, they will panic. Therefore, we divide the AI into three people—an analyst, a graph specialist, and an email specialist—and provide each with a dedicated desk to divide the labor.

4. Practice: Before and After that will change from tomorrow

For those who understand the concept but wonder how the instructions specifically change, let's look at an example of writing an apology email when a product delivery is delayed.

Conventional method (Prompt Engineering)

Instruction (Prompt): 'Since the delivery to the customer has been delayed, please write a polite apology email.'

AI response: 'Dear customer, we apologize for the delay in delivery. We are making every effort to ensure it reaches you as soon as possible... (omitted)'

This is too generic a template to be used as is. This is because the AI does not know why it was delayed or when it will arrive.

A new approach (Context Engineering)

Here, we prepare the environment (context) before giving instructions. Paste all of the following information into the chat box.

Information setup:

  1. Factual information (Why): The reason for this delay is the impact of a typhoon.

  2. Current status information (What): It has now left the distribution center and is scheduled to arrive tomorrow morning, the 20th.

  3. Customer information (Who): This customer is a regular who has purchased from us over 10 times in the past.

  4. Role definition (Role): You are a veteran customer support representative.

Instruction (Prompt): 'Based on the above information, write an apology email that will put the customer at ease.'

AI response: 'Thank you for your continued patronage. We sincerely apologize that the arrival of the product you were looking forward to has been delayed due to the impact of the typhoon. The product has already been shipped and is scheduled to reach you tomorrow morning, the 20th. We apologize for the concern this has caused you, Mr./Ms. [Name], who uses our service regularly...'

What do you think? The reason being a typhoon, the reassuring information that it will arrive tomorrow, and consideration for a regular customer. By combining these, the AI's response reaches a level indistinguishable from one written by a human.

Instead of instructing it on clever phrasing, provide all the information needed for judgment. This is the practice of context engineering.

5. Why is this the strongest skill right now?

The era where you could get by just by working hard on prompts is over. In a business setting, it is more important than anything else not to let the AI lie.

AI lies (hallucinations) not because it has a bad personality, but because it has no choice but to fill in the gaps with imagination when information is lacking.

If you make full use of context engineering to set up the facts perfectly, the AI will no longer need to imagine.

As a result, it evolves into a partner that is surprisingly accurate and capable of human-like thoughtfulness.

6. Summary: Become a director if you use AI

What will make the difference in future AI utilization is not whether you know the magic spells.

What kind of information or tools does an AI need to complete its task? The ability to imagine these needs and set the stage for them will surely become the most valuable skill in the coming era.

Try providing your AI not with the best letter, but with the best stage.

いいなと思ったら応援しよう!

なり よろしければサポートお願いします! いただいたサポートはクリエイターとしての皆様に有意義な記事提供の活動費に使わせていただきます!