• bitcoinBitcoin(BTC)$80,040.00-1.67%
  • ethereumEthereum(ETH)$2,315.70-2.19%
  • tetherTether(USDT)$1.000.02%
  • binancecoinBNB(BNB)$741.43-1.74%
  • rippleXRP(XRP)$1.29-3.07%
  • usd-coinUSDC(USDC)$1.000.01%
  • solanaSolana(SOL)$100.05-2.70%
  • tronTRON(TRX)$0.331131-0.23%
  • Figure HelocFigure Heloc(FIGR_HELOC)$1.030.09%
  • zcashZcash(ZEC)$1,253.18-4.66%
  • HyperliquidHyperliquid(HYPE)$79.19-3.52%
  • dogecoinDogecoin(DOGE)$0.077958-2.91%
  • moneroMonero(XMR)$598.92-1.28%
  • USDSUSDS(USDS)$1.00-0.01%
  • whitebitWhiteBIT Coin(WBT)$76.83-1.73%
  • chainlinkChainlink(LINK)$11.47-3.02%
  • leo-tokenLEO Token(LEO)$9.450.53%
  • cardanoCardano(ADA)$0.199193-4.07%
  • stellarStellar(XLM)$0.168522-1.85%
  • nearNEAR Protocol(NEAR)$4.35-7.43%
  • bitcoin-cashBitcoin Cash(BCH)$279.23-7.31%
  • RainRain(RAIN)$0.006901-2.21%
  • daiDai(DAI)$1.00-0.02%
  • Ethena USDeEthena USDe(USDE)$1.000.02%
  • litecoinLitecoin(LTC)$57.25-0.89%
  • uniswapUniswap(UNI)$7.03-1.99%
  • USD1USD1(USD1)$1.000.00%
  • avalanche-2Avalanche(AVAX)$8.70-3.50%
  • CantonCanton(CC)$0.096537-6.49%
  • suiSui(SUI)$0.91-3.06%
  • the-open-networkGram (prev. Toncoin)(GRAM)$1.21-2.78%
  • hedera-hashgraphHedera(HBAR)$0.073775-3.49%
  • tether-goldTether Gold(XAUT)$4,025.29-0.40%
  • Global DollarGlobal Dollar(USDG)$1.000.01%
  • paypal-usdPayPal USD(PYUSD)$1.00-0.01%
  • BittensorBittensor(TAO)$248.36-3.31%
  • shiba-inuShiba Inu(SHIB)$0.000005-2.67%
  • quant-networkQuant(QNT)$192.21-4.57%
  • BitwayBitway(BTW)$1.824.31%
  • crypto-com-chainCronos(CRO)$0.053132-1.85%
  • EthenaEthena(ENA)$0.197749-4.55%
  • Ripple USDRipple USD(RLUSD)$1.00-0.02%
  • MemeCoreMemeCore(M)$1.05-5.45%
  • Ondo US Dollar YieldOndo US Dollar Yield(USDY)$1.150.01%
  • Circle USYCCircle USYC(USYC)$1.140.01%
  • okbOKB(OKB)$110.850.20%
  • BlackRock USD Institutional Digital Liquidity FundBlackRock USD Institutional Digital Liquidity Fund(BUIDL)$1.000.00%
  • pepePepe(PEPE)$0.000005-1.35%
  • aaveAave(AAVE)$130.49-3.74%
  • OndoOndo(ONDO)$0.408149-3.02%
TradePoint.io
  • Main
  • AI & Technology
  • Stock Charts
  • Market & News
  • Business
  • Finance Tips
  • Trade Tube
  • Blog
  • Shop
No Result
View All Result
TradePoint.io
No Result
View All Result

Context Engineering for AI Agents: Key Lessons from Manus

July 22, 2025
in AI & Technology
Reading Time: 5 mins read
A A
Context Engineering for AI Agents: Key Lessons from Manus
ShareShareShareShareShare

Building effective AI agents means more than just picking a powerful language model. As the Manus project discovered, how you design and manage the “context” – the information the AI processes to make decisions – is paramount. This “context engineering” directly impacts an agent’s speed, cost, reliability, and intelligence.

Initially, the choice was clear: leverage the in-context learning of frontier models over slow, iterative fine-tuning. This allows for rapid improvements, shipping changes in hours instead of weeks, making the product adaptable to evolving AI capabilities. However, this path proved far from simple, leading to multiple framework rebuilds through what they affectionately call “Stochastic Graduate Descent” – a process of experimental guesswork.

YOU MAY ALSO LIKE

Hackers Leaked Details Of More Than 41,000 Homeland Security Personnel

Infini-AI-Lab Releases Hermit, an Open-Source Harness Adapter Framework for AI Agents

Here are the critical lessons learned at Manus for effective context engineering:

1. Design Around the KV-Cache

The KV-cache is vital for agent performance, directly affecting latency and cost. Agents continuously append actions and observations to their context, making the input significantly longer than the output. KV-cache reuses identical context prefixes, drastically reducing processing time and cost (e.g., a 10x cost difference with Claude Sonnet).

To maximize KV-cache hits:

  • Stable Prompt Prefixes: Even a single-token change at the start of your system prompt can invalidate the cache. Avoid dynamic elements like precise timestamps.
  • Append-Only Context: Do not modify past actions or observations. Ensure deterministic serialization of data (like JSON) to prevent subtle cache breaks.
  • Explicit Cache Breakpoints: Some frameworks require manual insertion of cache breakpoints, ideally after the system prompt.

2. Mask, Don’t Remove

As agents gain more tools, their action space becomes complex, potentially “dumbing down” the agent as it struggles to choose correctly. While dynamic tool loading might seem intuitive, it invalidates the KV-cache and confuses the model if past context refers to undefined tools.

Manus instead uses a context-aware state machine to manage tool availability by masking token logits during decoding. This prevents the model from selecting unavailable or inappropriate actions without altering the core tool definitions, keeping the context stable and the agent focused.

3. Use the File System as Context

Even with large context windows (128K+ tokens), real-world agentic observations (like web pages or PDFs) can easily exceed limits, degrade performance, and incur high costs. Irreversible compression risks losing crucial information needed for future steps.

Manus treats the file system as the ultimate, unlimited context. The agent learns to read from and write to files on demand, using the file system as externalized, structured memory.Compression strategies are always designed to be restorable (e.g., keeping a URL but dropping page content), effectively shrinking context length without permanent data loss.

4. Manipulate Attention Through Recitation

Agents can lose focus or forget long-term goals in complex, multi-step tasks. Manus tackles this by having the agent constantly rewrite a todo.md file. By reciting its objectives and progress into the end of the context, the model’s attention is biased towards its global plan, mitigating “lost-in-the-middle” issues and reducing goal misalignment. This leverages natural language to bias the AI’s focus without architectural changes.

5. Keep the Wrong Stuff In

Agents will make mistakes – hallucinate, encounter errors, misbehave. The natural impulse is to clean up these failures. However, Manus found that leaving failed actions and observations in the context implicitly updates the model’s internal beliefs. Seeing its own mistakes helps the agent learn and reduces the chance of repeating the same error, making error recovery a key indicator of true agentic behavior.

6. Don’t Get Few-Shotted

While few-shot prompting is powerful for LLMs, it can backfire in agents by leading to mimicry and sub-optimal, repetitive behavior. When the context is too uniform with similar action-observation pairs, the agent can fall into a rut, leading to drift or hallucination.

The solution is controlled diversity. Manus introduces small variations in serialization templates, phrasing, or formatting within the context. This “noise” helps break repetitive patterns and shifts the model’s attention, preventing it from getting stuck in a rigid imitation of past actions.

In conclusion, context engineering is very new but a critical field for AI agents. It goes beyond raw model power, dictating how an agent manages memory, interacts with its environment, and learns from feedback. Mastering these principles is essential for building robust, scalable, and intelligent AI agents.


Sponsorship Opportunity: Reach the most influential AI developers in US and Europe. 1M+ monthly readers, 500K+ community builders, infinite possibilities. [Explore Sponsorship]


Max is an AI analyst at MarkTechPost, based in Silicon Valley, who actively shapes the future of technology. He teaches robotics at Brainvyne, combats spam with ComplyEmail, and leverages AI daily to translate complex tech advancements into clear, understandable insights

Credit: Source link

ShareTweetSendSharePin

Related Posts

Hackers Leaked Details Of More Than 41,000 Homeland Security Personnel
AI & Technology

Hackers Leaked Details Of More Than 41,000 Homeland Security Personnel

October 29, 2026
Infini-AI-Lab Releases Hermit, an Open-Source Harness Adapter Framework for AI Agents
AI & Technology

Infini-AI-Lab Releases Hermit, an Open-Source Harness Adapter Framework for AI Agents

October 29, 2026
NVIDIA Releases Nemotron 3.5 Transcribe: An Open 30B MoE Model for 40-Language Transcription with ~4B Active Parameters
AI & Technology

NVIDIA Releases Nemotron 3.5 Transcribe: An Open 30B MoE Model for 40-Language Transcription with ~4B Active Parameters

October 29, 2026
FCC Chair Wants To Let Prisons Jam Illegal Cellphones
AI & Technology

FCC Chair Wants To Let Prisons Jam Illegal Cellphones

October 28, 2026
Next Post
Clorox lawsuit says hackers got passwords simply by asking

Clorox lawsuit says hackers got passwords simply by asking

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

No Result
View All Result
Famous 24-hour Los Angeles diner sets reopening date after closure

Famous 24-hour Los Angeles diner sets reopening date after closure

October 23, 2026
Hurricane Isaias kills at least four people as millions are still under threat

Hurricane Isaias kills at least four people as millions are still under threat

October 28, 2026
Ex-fiancé of missing Florida ‘People Court’ mom arrested

Ex-fiancé of missing Florida ‘People Court’ mom arrested

October 25, 2026

About

Learn more

Our Services

Legal

Privacy Policy

Terms of Use

Bloggers

Learn more

Article Links

Contact

Advertise

Ask us anything

©2020- TradePoint.io - All rights reserved!

Tradepoint.io, being just a publishing and technology platform, is not a registered broker-dealer or investment adviser. So we do not provide investment advice. Rather, brokerage services are provided to clients of Tradepoint.io by independent SEC-registered broker-dealers and members of FINRA/SIPC. Every form of investing carries some risk and past performance is not a guarantee of future results. “Tradepoint.io“, “Instant Investing” and “My Trading Tools” are registered trademarks of Apperbuild, LLC.

This website is operated by Apperbuild, LLC. We have no link to any brokerage firm and we do not provide investment advice. Every information and resource we provide is solely for the education of our readers. © 2020 Apperbuild, LLC. All rights reserved.

No Result
View All Result
  • Main
  • AI & Technology
  • Stock Charts
  • Market & News
  • Business
  • Finance Tips
  • Trade Tube
  • Blog
  • Shop

© 2023 - TradePoint.io - All Rights Reserved!