---
title: Context Engineering, the art and science behind AI Agents
description: Discover what context engineering is, how it differs from prompt engineering, and how it enables AI Agents to operate reliably and effectively
image: https://newsroom.kireygroup.com/hubfs/Data%26AI_27.png
---

[kireygroup.com](https://www.kireygroup.com/)

[![](https://newsroom.kireygroup.com/hubfs/item-2020-dicembre/logo-Blog-v2.svg)](https://newsroom.kireygroup.com/en/news)

- [Ita](https://newsroom.kireygroup.com/news/context-engineering-l-arte-e-la-scienza-che-guidano-gli-ai-agent?hsLang=it)
- Eng
- [Esp](https://newsroom.kireygroup.com/es/news/context-engineering-el-arte-y-la-ciencia-detras-de-los-ai-agents?hsLang=es)

[Kireygroup.com](https://www.kireygroup.com/)

# Get your daily dose of tech!

## We Shape Your Knowledge

# [Welfare: from compliance to competitiveness, digital services and technologies are key to pension funds’ future](https://newsroom.kireygroup.com/en/news/welfare-digital-services-and-technologies-are-key-to-pension-funds-future?hsLang=en)

By Michela Sertorio, Business Line Manager - BU Pension Funds atKirey.

[Read more](https://newsroom.kireygroup.com/en/news/welfare-digital-services-and-technologies-are-key-to-pension-funds-future?hsLang=en)

 9 MIN READ

26 October 2026

### Latest News

- [Welfare: from compliance to competitiveness, digital services and technologies are key to pension funds’ future](https://newsroom.kireygroup.com/en/news/welfare-digital-services-and-technologies-are-key-to-pension-funds-future?hsLang=en)
- [Inference Costs: how to prevent AI agents from driving costs up exponentially](https://newsroom.kireygroup.com/en/news/inference-costs-how-to-prevent-ai-agents-from-driving-costs-up-exponentially?hsLang=en)
- [Kirey Advisory at the ABI Lab workshop on Processes, Operations and Organization](https://newsroom.kireygroup.com/en/news/kirey-advisory-at-the-abi-lab-workshop-on-processes-operations-and-organization?hsLang=en)
- [Kirey Strengthens Its SAP Presence: Mind The Value Achieves Reselling Partner Status](https://newsroom.kireygroup.com/en/news/kirey-strengthens-its-sap-presence-mind-the-value-achieves-reselling-partner-status?hsLang=en)
- [The Dark Side of Multicloud: how to prevent workload placement from generating technical debt](https://newsroom.kireygroup.com/en/news/the-dark-side-of-multicloud-how-to-prevent-workload-placement-from-generating-technical-debt?hsLang=en)
- [Shadow AI: 4 out of 5 employees use tools not governed by the company](https://newsroom.kireygroup.com/en/news/shadow-ai-4-out-of-5-employees-use-tools-not-governed-by-the-company?hsLang=en)

- [Artificial Intelligence](https://newsroom.kireygroup.com/en/news/tag/artificial-intelligence) /

# Context Engineering, the art and science behind AI Agents

#### Kirey

[![](https://newsroom.kireygroup.com/hubfs/it.svg)](https://newsroom.kireygroup.com/news/context-engineering-l-arte-e-la-scienza-che-guidano-gli-ai-agent?hsLang=it)    [![](https://newsroom.kireygroup.com/hubfs/ES.svg)](https://newsroom.kireygroup.com/es/news/context-engineering-el-arte-y-la-ciencia-detras-de-los-ai-agents?hsLang=es)

 12 MIN READ

15 September 2026

- Share on:
- <https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fnewsroom.kireygroup.com%2Fen%2Fnews%2Fcontext-engineering-the-art-and-science-behind-ai-agents>
- <https://www.twitter.com/share?url=https%3A%2F%2Fnewsroom.kireygroup.com%2Fen%2Fnews%2Fcontext-engineering-the-art-and-science-behind-ai-agents>
- <http://www.linkedin.com/shareArticle?mini=true&url=https://newsroom.kireygroup.com/en/news/context-engineering-the-art-and-science-behind-ai-agents>

- [All](https://newsroom.kireygroup.com/news?hsLang=en)
- Categories + 
    - [Corporate](https://newsroom.kireygroup.com/en/news/tag/corporate)
    - [Cybersecurity](https://newsroom.kireygroup.com/en/news/tag/cybersecurity)
    - [Cloud](https://newsroom.kireygroup.com/en/news/tag/cloud)
    - [Data Value](https://newsroom.kireygroup.com/en/news/tag/data-value)
    - [Innovation](https://newsroom.kireygroup.com/en/news/tag/innovation)
    - [Artificial Intelligence](https://newsroom.kireygroup.com/en/news/tag/artificial-intelligence)
    - [Software Development](https://newsroom.kireygroup.com/en/news/tag/software-development)
    - [Corporate Social Responsibility](https://newsroom.kireygroup.com/en/news/tag/corporate-social-responsibility)
    - [Advisory](https://newsroom.kireygroup.com/en/news/tag/advisory)
    - [Welfare & Social Services](https://newsroom.kireygroup.com/en/news/tag/welfare-social-services)
- [Press & PR](https://newsroom.kireygroup.com/en/news/tag/press)

With the spread of LLMs, **the discipline of prompt engineering** emerged, studying **the most effective ways to provide instructions to an AI model** and obtain responses that are consistent with the user’s objective. From the very beginning, one principle became clear: **the more relevant information and well-defined context the model has access to**, the more likely it is to generate a high-quality output.

This is where one of today’s hottest topics comes into play: **context engineering.**

Key Points

- With the arrival of AI Agents, prompt engineering is no longer enough. The challenge is to design the entire context that will guide the model throughout execution.
- LLMs can process only a limited amount of information before losing precision, making intelligent management of the attention budget essential.
- Context engineering combines context design, dynamic information retrieval, external memory, and multi-agent architectures

## Why prompt engineering is not enough

As LLMs have evolved, the quality of instructions (prompt engineering in the strict sense) has become just **one part of the equation**. Today, the challenge is to effectively manage all the information the model receives while performing a task, i.e. **the context in which it operates**. This shift has been driven by two phenomena:

- **Chats have become much longer and more complex.** With each new exchange, the context grows because, quite simply, the model needs to remember previous interactions in order to provide consistent future responses. This makes it increasingly difficult to determine **which information is actually relevant** to the AI.
- **AI agents have arrived.** Unlike a traditional chat, an agent does not interact with the LLM just once, but **continuously calls it as part of an iterative process.** At each step, it consults documents, tools, APIs, and knowledge bases, generates new information, and uses it as context for subsequent steps. The result is **an ever-evolving workflow** in which the volume of information to be managed grows rapidly.

The challenge stems from the fact that, much like humans, LLMs **have limited memory** and must operate efficiently. Each model can process only a finite amount of information within its context window, and when that window fills up, the system inevitably loses precision, forgets information that is essential for subsequent decisions, and can no longer assign the appropriate weight to different pieces of information. Since AI agents are intended to support core business processes, losing relevant information or assigning it the wrong weight can result in financial and reputational damage.

The discipline of Context Engineering emerged precisely because providing more context is not enough to obtain better responses: you need to provide **the right context at the right time.**

## What is Context Engineering and how does it optimize the attention budget?

Anthropic defines Context Engineering as the art and science of **selecting, organizing, and maintaining the optimal set of information** that feeds a language model during each stage of processing. In other words, while prompt engineering focuses on the optimal way to provide instructions, context engineering deals with **which information should be made available to the model and when.**

The ultimate goal is to make the most efficient possible use of the limited context window of LLMs, ensuring that **every token contributes to the quality of the response** and avoiding an excess of information that can lead to so-called context rot, i.e. the progressive deterioration of the model’s ability to retrieve the most relevant information.

As mentioned above, context engineering is a dynamic and iterative process because the context evolves based on the tasks performed by the agent and **the new information that emerges during the process.** The context arises from a combination of three different sources.

### User defined instructions

This is the component closest to traditional prompt engineering. It includes **system prompts, objectives, constraints, and behavioral rules** defined by developers to guide the model.

### Information retrieved during execution

While working, an agent continuously retrieves new data by querying external tools and systems. Through protocols such as the Model Context Protocol (MCP), for example, it can access CRM and ERP systems, technical documentation, or web services, loading only the information needed at that particular moment into the context window. The same principle applies to documents, images, or web pages, which are **retrieved only when needed, avoiding unnecessary use of space in the context window.**

### Knowledge produced by the agent

Every search, tool response, intermediate decision, or final output can be useful in subsequent steps. Some systems use **agentic memory mechanisms**, saving notes and summaries in external memories that can be retrieved when necessary.

## How to design an efficient Context Engineering system

In practical terms, context engineering means designing a system capable of providing the model with the right context when needed, regardless of the ad hoc instructions manually provided by the user to the model through prompts. Achieving this requires intervention across several aspects of agent architecture.

### Design an essential context

The first principle is to **avoid wasting the attention budget.** System prompts, instructions, examples, and constraints should be detailed enough to guide behavior, but without going too far. Otherwise, they risk unnecessarily occupying the entire context window. The solution lies in finding the right balance between hard-coding every single rule and relying on generic statements with little real value.

### Design token-efficient tools

The tools used by AI agents must also be designed with the need to interact with a limited context window in mind. The goal is to ensure that each integration **returns only the information that is necessary.** A well-designed tool does not return hundreds of records when three are enough, nor entire documents when an excerpt will do.

### Retrieve context progressively

Preloading all the information available to the agent is not a good practice. A more effective approach is what Anthropic calls progressive disclosure: the agent can, for example, view only the metadata of a set of documents, decide which ones to investigate further, and retrieve the full content only when necessary. This behavior is defined by developers through **the design of workflows, APIs, and the rules governing information integration.**

### Manage long-running tasks

The most complex tasks can far exceed the context window capacity of an LLM. For this reason, more advanced architectures adopt strategies such as summarization, which automatically **summarizes the work performed while preserving essential decisions and information with a significant reduction in space**. Another possibility is to use multi-agent architectures, which distribute the work among specialized agents, each with its own context window, while delegating to a coordinating agent the task of collecting and synthesizing the results.

## Take on the challenges of Agentic AI together with us

At Kirey, we help companies [make the most of the potential of artificial intelligence](https://www.kireygroup.com/en/products/artificial-intelligence). In recent months, AI Agents have become the main driver of this evolution due to their ability to reason, make decisions, and act autonomously on business processes. This certainly has the potential to transform the way companies operate.

The opportunities are enormous, but the technical and design challenges to be addressed are equally concrete, especially in a field that is evolving at an unprecedented pace.

It is through challenges such as the context window that **we support companies in their transformation, helping them improve efficiency and productivity**, accelerate innovation, and build the capabilities they need today to address tomorrow’s demands.

[Contact us](https://www.kireygroup.com/en/contact) to discover how to bring Agentic AI into your organization’s processes.

- [Previous post](https://newsroom.kireygroup.com/en/news/agentic-ai-governance-how-to-effectively-manage-ai-that-can-act?hsLang=en)
- [Read all posts](https://newsroom.kireygroup.com/en/news?hsLang=en)
- [Next post](https://newsroom.kireygroup.com/en/news/legacy-modernization-in-banking-discover-the-true-cost-of-legacy-systems?hsLang=en)

## Related posts:

#### [Inference Costs: how to prevent AI agents from dri...](https://newsroom.kireygroup.com/en/news/inference-costs-how-to-prevent-ai-agents-from-driving-costs-up-exponentially?hsLang=en)

Artificial intelligence has an innovative side, but it also comes with a bill to pay. And in recent ...

[Read more](https://newsroom.kireygroup.com/en/news/inference-costs-how-to-prevent-ai-agents-from-driving-costs-up-exponentially?hsLang=en)

 18 MIN READ

15 September 2026

#### [Agentic AI Governance: how to effectively manage A...](https://newsroom.kireygroup.com/en/news/agentic-ai-governance-how-to-effectively-manage-ai-that-can-act?hsLang=en)

For years, companies have been asking themselves how to govern AI-generated responses. But what happ...

[Read more](https://newsroom.kireygroup.com/en/news/agentic-ai-governance-how-to-effectively-manage-ai-that-can-act?hsLang=en)

 10 MIN READ

15 September 2026

#### [AI Act: what happens on 2 August 2026 and what cha...](https://newsroom.kireygroup.com/en/news/ai-act-what-happens-on-2-august-2026-and-what-changes-for-businesses?hsLang=en)

2 August 2026 has always been considered a key milestone in the AI Act implementation timeline. Foll...

[Read more](https://newsroom.kireygroup.com/en/news/ai-act-what-happens-on-2-august-2026-and-what-changes-for-businesses?hsLang=en)

 8 MIN READ

15 September 2026

#### Explore

- [Home](https://www.kireygroup.com/)
- [Competencies](https://www.kireygroup.com/en/competencies)
- [Industries](https://www.kireygroup.com/en/industries)
- [About Us](https://www.kireygroup.com/en/about-us)
- [Tech&Partners](https://www.kireygroup.com/en/tech-partners)
- [Careers](https://www.kireygroup.com/en/careers)
- [Contact](https://www.kireygroup.com/en/contact)
- [Corporate Social Responsibility](https://www.kireygroup.com/en/corporate-social-responsibility)
- [Advisory](https://www.kireyadvisory.com/en)

#### Policy

- [Quality](https://www.kireygroup.com/oven/media/PKG-COMP-AL14-Quality-Policy.pdf)
- [Security](https://www.kireygroup.com/oven/media/PKG-CIS-LG02-Security-Policy.pdf)
- [Gender Equality](https://www.kireygroup.com/oven/media/PKG-COMP-LG03-Politica-per-la-parita-di-Genere-v2.pdf)
- [Service Management](https://www.kireygroup.com/oven/media/PKG-COMP-AL45-Politica-per-la-gestione-dei-servizi.pdf)
- [Environment](https://www.kireygroup.com/oven/media/PKG-COMP-AL44-Politica-Ambientale-Kirey.pdf)
- [Health, Safety & Wellbeing](https://www.kireygroup.com/oven/media/PKG-COMP-LG02-Policy-on-health-safety-and-well-being-in-the-work-environment.pdf)
- [ESG](https://www.kireygroup.com/oven/media/Policy-ESG-ENG-v1.pdf)
- [Info on Data Processing](https://www.kireygroup.com/en/information-on-data-processing)

#### Certifications

- [ISO 9001:2015](https://www.kireygroup.com/oven/media/KIREY-S-R-L-9001.pdf)
- [ISO/IEC 27001:2022](https://www.kireygroup.com/oven/media/KIREY-S-R-L-27001.pdf)
- [PDR 125](https://www.kireygroup.com/oven/media/PDR-125-2022.pdf)  
  <https://www.kireygroup.com/oven/media/PKG-COMP-AL45-Politica-per-la-gestione-dei-servizi.pdf>
- [ISO/IEC 20000-1:2018](https://www.kireygroup.com/oven/media/ISOIEC-20000-12018-ENG.pdf)
- [ISO 14001:2015](https://www.kireygroup.com/oven/media/ISO-14001-2015-ENG.pdf)
- [ISO 45001:2018](https://www.kireygroup.com/oven/media/CERTIFICATO-ISO-45001-KIREY-ENG.pdf)
- [ISO 22301:2019](https://www.kireygroup.com/oven/media/ISO-22301-2019-ENG.pdf)

#### Info

**Kirey Srl**

[info@kireygroup.com](mailto:info@kireygroup.com)  
Viale Francesco Restelli, 5  
20124 Milano

[kirey@pec.it](mailto:kirey@pec.it)  
**PI/CF**: 06729880960  
**REA**: MI 1910802  
**Tel**: +39 02 78625200

Capitale sociale 1.089.620,00 

[![Linkedin](https://newsroom.kireygroup.com/hs-fs/hubfs/Linkedin.png?width=20&name=Linkedin.png)](https://www.linkedin.com/company/kireygroup/)<https://open.spotify.com/show/41V5g7d4zccIrVcmNB3ZWd>   <https://www.instagram.com/kireygroup/?igshid=MzRlODBiNWFlZA%3D%3D>

- [Privacy Policy](https://www.kireygroup.com/oven/media/Kirey-Privacy-ENG-policy-art-13.pdf)
- [Cookie Policy](https://www.kireygroup.com/oven/media/Kirey-Cookie-Policy-ENG-1.pdf)
- [Terms and Conditions](https://www.kireygroup.com/oven/media/Kirey-Website-Terms-and-Conditions-1.pdf)

[![KIREY LOGO](https://newsroom.kireygroup.com/hs-fs/hubfs/KIREY_LOGO_PAYOFF_RGB_POS.png?width=200&height=72&name=KIREY_LOGO_PAYOFF_RGB_POS.png)](https://www.kireygroup.com/)

© Copyright 2026 by Kirey