---
title: "Beyond Better Prompts: Context Engineering for AI Agents"
description: "Prompt quality still matters, but long-running agents depend on a broader system: what they retrieve, retain, compress, and expose for review at each step."
url: "https://www.agenticassets.ai/blog/beyond-better-prompts-context-engineering-for-ai-agents"
canonical: "https://www.agenticassets.ai/blog/beyond-better-prompts-context-engineering-for-ai-agents"
date: "2026-08-09"
author: "Agentic Assets Research Team"
author_title: "Agentic Assets Research"
read_time: "8 min read"
tags: ["context-engineering", "ai-agents", "agent-memory", "retrieval", "multi-agent-systems", "commercial-real-estate"]
image: "https://fhqycqubkkrdgzswccwd.supabase.co/storage/v1/object/public/blog-images/manual/beyond-better-prompts-context-engineering-for-ai-agents-2026-08-09.png"
last_updated: "2026-08-09"
site: "Agentic Assets"
---

# Beyond Better Prompts: Context Engineering for AI Agents

> Prompt quality still matters, but long-running agents depend on a broader system: what they retrieve, retain, compress, and expose for review at each step.

Commercial real estate firms are moving quickly from AI experiments to operational pilots. In [JLL's 2025 Global Real Estate Technology Survey](https://www.jll.com/en-uk/newsroom/real-estates-ai-reality-check-companies-piloting-only-achieved-all-ai-goals), 88 percent of investors, owners, and landlords and 92 percent of occupiers reported that they had started piloting AI. Yet only 5 percent of occupiers said they had achieved all of their program goals. JLL points to organizational readiness, including quality data, infrastructure, and change-management processes. A related operating question is context: what evidence an AI system sees at each step.

A prompt tells a model what to do. An agent needs more: instructions, tools, documents, permissions, current task state, prior decisions, and a way to retrieve new evidence while it works. The quality of that system determines whether an agent can move from answering a question about one lease to supporting a review across an offering memorandum, rent roll, T-12, lease files, debt documents, and market evidence without severing the link between claim and source.

That broader discipline is context engineering.

## Prompt engineering is one layer, not the whole system

In September 2025, [Anthropic's Applied AI team described context engineering](https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents) as the progression from optimizing prompt wording to curating the full set of tokens available to a model at each inference step. The prompt remains important. It is simply one component alongside tool definitions, retrieved evidence, message history, memory, and runtime state.

The distinction matters because a model's advertised context capacity is not the same as reliable use of every token. In the peer-reviewed paper ["Lost in the Middle"](https://aclanthology.org/2024.tacl-1.9/), researchers found that performance on multi-document question answering and key-value retrieval often depended on where relevant information appeared in a long input. The tested models were generally better when the evidence was near the beginning or end than when it was buried in the middle.

That result should not be flattened into a rule that shorter is always better. Long context can be useful, and newer models continue to improve. The engineering question is whether each additional document, tool description, and prior message adds enough relevant signal to justify the attention, latency, and failure surface it introduces.

## Four practices make context operational

### 1\. Retrieve evidence when the task requires it

Just-in-time retrieval keeps lightweight references available, such as file paths, database identifiers, saved queries, and source URLs, then loads the underlying material when the agent needs it. This reduces the temptation to place an entire data room into the initial context.

Tool design is part of that architecture. Anthropic's guidance on [writing effective tools for agents](https://www.anthropic.com/engineering/writing-tools-for-agents) recommends clear boundaries, token-efficient outputs, pagination, filtering, and responses that return the relevant result rather than the full underlying system state.

[OpenAI's internal data agent](https://openai.com/index/inside-our-in-house-data-agent/) offers a concrete implementation. Its context layer combines table lineage, human annotations, code-derived definitions, institutional knowledge, scoped memory, and live warehouse checks. At query time, the system retrieves relevant embedded context instead of scanning all metadata and logs. Permissions are enforced through the existing access model, not left to prompt wording.

Selective retrieval has tradeoffs. It adds latency and can omit evidence if the query or index is weak. For stable, high-priority instructions, preloading may still be appropriate. In finance and legal work, a hybrid design is usually more credible than a rule that everything must be retrieved or everything must be loaded upfront.

### 2\. Compact history without pretending compression is lossless

Long-running agents accumulate tool calls, intermediate results, and repeated explanations. OpenAI's [Responses API compaction architecture](https://openai.com/index/equip-responses-api-computer-environment/) preserves high-value prior state in a smaller representation so work can continue across context boundaries.

Compaction is not a complete continuity system. In a long-running web-application coding experiment, Anthropic's work on [effective harnesses for long-running agents](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents) found that compaction alone did not keep multi-session work on track. Agents also needed durable progress artifacts, a structured feature or task list, verification, and a clear handoff for the next session.

For investment work, a compacted handoff should preserve source identifiers, material assumptions, unresolved discrepancies, approvals, and the latest verified artifact. Raw tool output can often be dropped. A debt covenant exception or a disputed rent-roll adjustment cannot.

### 3\. Keep durable memory outside the active window

Structured memory lets an agent write durable notes and retrieve them later without carrying every prior interaction forward. A [Google DeepMind-hosted arXiv preprint on ReadAgent](https://deepmind.google/research/publications/74917/) reported results from a related pattern: compress long documents into short gist memories, then return to original passages when the task requires detail. The reported gains were specific to three reading-comprehension benchmarks, but the architecture illustrates the principle well.

External memory changes future inputs. It does not necessarily change the model's parameters, and it should not be described as unconstrained learning. Its value comes from preserving useful state while retaining a path back to the source.

### 4\. Use subagents when isolation and parallelism justify the cost

Subagents give specialized tasks clean context windows. A lead agent can delegate lease review, market research, operating-statement reconciliation, and debt-document checks, then receive concise findings rather than every search step.

Anthropic reported that, on an internal research evaluation, its [multi-agent research system](https://www.anthropic.com/engineering/multi-agent-research-system) with an Opus 4 lead agent and Sonnet 4 subagents outperformed single-agent Opus 4 by 90.2 percent. The same report says multi-agent systems used about 15 times the tokens of ordinary chat and were a poor fit for work with tightly coupled dependencies. The lesson is not that more agents are always better. It is that context isolation can be worth the cost when the work is valuable, parallelizable, and easy to reconcile.

## Memory becomes infrastructure when it persists

Once memory survives a session, it becomes a governed data system. In her June 2026 talk, ["Learning while you sleep: Beyond memory to dreaming,"](https://www.youtube.com/watch?v=tTcxVv8HHNw) Anthropic Member of Technical Staff Lamis Mukta described memory around versioning, provenance, rollback, concurrency controls, scoped permissions, and portability. [Anthropic's Claude Platform documentation](https://platform.claude.com/docs/en/managed-agents/dreams) describes Dreams, still a research preview, as an asynchronous job that reads an existing memory store and past session transcripts, produces a separate reorganized store, and leaves the input unchanged so the result can be reviewed or discarded.

This is broader than one vendor's terminology. OpenAI's [ChatGPT memory architecture](https://openai.com/index/chatgpt-memory-dreaming/) also uses a background process to synthesize fresher, more relevant memory across conversations. The systems differ, but both treat memory maintenance as work performed outside the immediate interaction.

Persistent memory also creates persistent risk. [Microsoft's guidance on guarding AI memory](https://www.microsoft.com/en-us/security/blog/2026/06/22/guarding-ai-memory/) argues for provenance before persistence, deterministic access boundaries outside the model, retrieval-time checks for freshness and tampering, lifecycle auditability, and user control. That is the right posture for institutional workflows. A stale or poisoned memory can shape later tool calls after the original source has disappeared from view.

## The enterprise layer is data architecture and governance

[McKinsey's "Building the foundations for agentic AI at scale"](https://www.mckinsey.com/capabilities/mckinsey-technology/our-insights/building-the-foundations-for-agentic-ai-at-scale) connects context engineering to the enterprise controls around it. The article emphasizes data quality, lineage, access control, stable interfaces, observability, and human supervision. It also describes scoped working memory and dynamic access to shared context based on role and use case.

This is the practical bridge from an effective agent demo to an operating system a firm can defend. The context layer should inherit the same permissions, data definitions, and audit requirements as the systems it reads. Agent-generated outputs should enter the same reconciliation and quality processes as human-generated data.

[NIST's Generative AI Profile](https://www.nist.gov/publications/artificial-intelligence-risk-management-framework-generative-artificial-intelligence) provides a broader risk-management frame across design, development, deployment, use, and evaluation. Applying that framework to memory means recording what changed, who or what proposed the change, the evidence behind it, who approved it, and how to reverse it.

## What this means for a CRE deal workflow

No cited study establishes that this architecture improves commercial real estate underwriting by a fixed amount. The following is a design implication from the evidence, not a measured industry result.

A defensible CRE context architecture has four layers:

1.  **Authoritative sources.** Original deal documents, approved market data, research, and policy files remain read-only and retain dates, owners, permissions, and identifiers.
2.  **Task-specific working context.** The agent retrieves the relevant lease pages, rent-roll rows, T-12 accounts, debt terms, and market evidence for the question at hand.
3.  **Source-linked decision history.** Material assumptions, exceptions, unresolved conflicts, human edits, and approvals are preserved with links back to the evidence.
4.  **Versioned process memory.** Repeated corrections can become proposed workflow guidance, but only through a reviewable change with provenance, scope, and rollback.

The operating test is simple. Before an agent's output enters an investment memo or model, a reviewer should be able to answer five questions:

-   What entered the context?
-   Why was it selected?
-   What relevant evidence was unavailable or omitted?
-   Which assumptions or memories changed the result?
-   Who can approve, reject, or reverse those changes?

Prompt engineering still matters. Context engineering turns it into an operating discipline. The firms that benefit will not be the ones with the longest prompts. They will be the ones with the clearest architecture for selecting evidence, preserving decisions, and governing what their agents remember.

---

Canonical HTML version: https://www.agenticassets.ai/blog/beyond-better-prompts-context-engineering-for-ai-agents
