Context Engineering
Deciding what goes into an LLM's context window: context limits, context rot, compaction and summarization, prompt caching and agentic context management.
A larger context window does not make an agent smarter; it makes the cost of a bad context larger. Models lose track of facts buried in the middle of long prompts, and a context that grows without pruning degrades on its own while the bill for every token keeps rising. Context engineering is the discipline of choosing what the model sees on each turn and throwing away what it no longer needs.
These articles look at long-context behaviour, compaction and summarization strategies, prompt caching and the case for treating context as something an agent manages rather than something it accumulates. For the difference between remembering across sessions and managing a single window, start with the comparison linked below.
Start here: Memory vs context windows · Context engineering (glossary) · Context rot (glossary) · Prompt caching (glossary)

Async Subagents: What the Orchestrator Keeps in Context, What Workers Hand Back, and What Should Outlive the Session
Async subagents let an orchestrator stay reachable while background workers run long tasks. What the orchestrator must keep about in-flight work so compaction cannot erase it, what a worker should hand back, when a follow-up should interrupt or enqueue, how results reach an orchestrator that is busy, idle or waiting on an approval, and which decisions and preferences should outlive the session, with LangChain Deep Agents, Claude Code and OpenAI behaviour as of 6 November 2026.

What Is a Company Brain? What It Is, What Memory It Actually Needs, and How to Test One
A company brain is a shared memory layer that pulls what a company knows out of Slack, Notion, meeting notes, docs and tickets and serves it to people and any AI assistant. Connectors and storage are the easy part. What it needs to be trusted: scoping (who may see what), time (when a fact was true), conflict handling when sources disagree, provenance and forgetting. A plain definition, what is in and out, an architecture checklist and a test plan.

Memory for Background Agents: Where It Lives When the Sandbox Is Discarded, What to Remember With No User in the Loop, and Who May Write or Forget
A background agent wakes on a cron, a heartbeat or an event, runs in a sandbox that is thrown away afterwards, and keeps only what it wrote somewhere else. Where that memory has to live (outside compute, scoped to the user and the agent, loaded at the start of every run), what to remember when no user is there to confirm anything, how async subagent results get written back without duplicates, and who may write to and delete from a memory several bots share.

Context Compaction vs Retrieval: When Summarising a Long Agent Session Is Cheap, When Exact Lines Win, and What Neither Does Across Sessions
Compacting a 400,000-token Claude Opus 5.5 session costs about $0.08 of input when the prompt cache is warm and $1.60 to $2.00 when it has expired, at list prices as of 30 October 2026. Mainplane's measurement, Claude Code's and OpenAI's compaction docs, when to compact and when to start fresh and retrieve exact lines from the old session file, and the cross-session problem neither approach solves.

Ontology for Agent Memory: Glossary, Taxonomy or Ontology, and How Much Schema an Agent Needs
Agent memory borrows three layers from data architecture: a glossary of definitions and aliases, a taxonomy of memory categories and an ontology of typed relationships. Definitions alone lifted extraction F1 from 0.42 to 0.57 in one 2026 study, while a typed ontology pays off on set, negation and supersession questions. How ontologies constrain extraction and entity resolution in Zep, Cognee and LangChain, which layer you need at which scale, and what over-modelling costs.

OpenRouter Pricing 2026: Credit Fees, BYOK, Free Model Limits, and What Routing Costs Next to Going Direct
OpenRouter pricing as of 29 October 2026: model tokens at the provider's list price, a 5.5% fee on credit purchases on Standard ($0.80 minimum by card) and 8% on Business, BYOK free up to $25,000 of list-price inference a month and 5% after that, free models at 20 requests a minute and 50 or 1,000 a day, and what a 40-turn conversation costs through OpenRouter next to going direct to Anthropic, Google, DeepSeek, Mistral, Moonshot and Groq.

Fireworks AI vs Together AI Pricing 2026: Same Models Side by Side, Cached Input, Batch, GPUs, Fine-Tuning and Cost per Conversation
Fireworks AI vs Together AI pricing as of 29 October 2026: identical list prices on Kimi K3, GLM 5.3, DeepSeek V4.1 Flash, Muse Spark Open and four more shared models, but GPT-OSS 120B cached input at $0.015 on Fireworks and no cached rate on Together, a 50% batch discount on Fireworks against one discounted batch model on Together, H100s at $8.00 an hour against $5.49, cheaper fine-tuning on Together, a $1 credit against a $15 minimum, and what a 40-turn conversation costs on each.

GLM 5.2 API Pricing 2026: GLM-5.2, GLM-5.3 and Every Z.ai Model per Million Tokens, Cache, Free Models, Coding Plan and Cost per Conversation
GLM 5.2 API pricing as of 29 October 2026: $1.40 input, $0.26 cached input and $4.40 output per million tokens on Z.ai, the same as the newer GLM-5.3 that replaced it as Zhipu's flagship in August. Every current GLM model in USD and on bigmodel.cn in CNY, free Flash models, how the automatic cache bills, the Coding Plan's credits and what they mean for API users, open-weight hosts from Together to DeepInfra, and what a 40-turn conversation costs next to Kimi, Qwen, DeepSeek, Groq, Gemini and Claude.

Qwen API Pricing 2026: Every Qwen Model per Million Tokens on Alibaba Cloud, by Region, Free Quota, Cache, Batch and Cost per Conversation
Qwen API pricing per million tokens as of 29 October 2026: Qwen3.8-Max at $2 input and $6 output on Alibaba Cloud Model Studio's Singapore region and $1.65 and $4.95 on Global-scope rows, Qwen3.7-Plus at $0.40 and $1.60 (20% off for now), Qwen3.8-Flash at $0.15 and $0.47, Qwen3.7-Flash from $0.03 and $0.13, 1 million free tokens per model, context tiers, cache and Batch rules, CNY prices, where open-weight Qwen runs cheaper, and what a 40-turn conversation costs next to DeepSeek, Groq, Gemini and Claude.

Kimi K3 API Pricing 2026: K3, K3.1 Pro and Every Kimi Model per Million Tokens, Cache Writes, Limits and Cost per Conversation
Kimi K3 API pricing as of 30 October 2026: $3.00 input, $0.30 cached input and $15.00 output per million tokens on Moonshot's platform, while the newer Kimi K3.1 Pro costs less at $2.00, $0.20 and $10.00. Every current Kimi model in USD and CNY, the new 5-minute and 1-hour cache writes, rate-limit tiers, what Together, Fireworks, DeepInfra and OpenRouter charge, and what a 40-turn conversation costs next to DeepSeek, Mistral, Groq, Gemini and Claude.

Claude Code Memory, Codex Memory and Cursor Memory: What Each Coding Agent Remembers Between Sessions, Where It Lives, and How to Share It
Claude Code remembers through CLAUDE.md and auto memory (the first 200 lines or 25KB of MEMORY.md), Codex through AGENTS.md (32 KiB by default) and opt-in local Memories, and Cursor through Rules and AGENTS.md since it removed Memories in 2.1. Where each one stores memory, what each forgets, and how to make one memory persist and be shared across all three, read from each vendor's docs on 28 October 2026.

Mistral API Pricing 2026: Every Model per Million Tokens, Free Mode, Batch, Priority and Cost per Conversation
Mistral API pricing per million tokens as of 30 October 2026: Mistral Small 4 at $0.15 input and $0.60 output, Large 3 at $0.50 and $1.50, Large 4 at $0.70 and $2.10 after a price cut, Medium 3.5 at $1.50 and $7.50, cached input at 10%, Batch at 50% off, Priority at 1.75x, EU and US endpoints at 1.1x, what Free mode includes, and what a 40-turn conversation costs next to DeepSeek, Groq, Gemini and Claude.

Agent Memory vs RAG: When Do You Use Which?
Use RAG for shared knowledge that changes by new versions and agent memory for per-person facts that get corrected. Plain RAG over raw chat history matched or beat memory systems in six of seven benchmark settings in October 2026, and retrieving the raw history alongside memory cut the losses memory adds.

Groq API Pricing 2026: Every GroqCloud Model per Million Tokens, Free Tier Limits, Batch and Cost per Conversation
Groq API pricing per million tokens as of 27 October 2026: GPT-OSS 120B at $0.15 input and $0.60 output, GPT-OSS 20B at $0.075 and $0.30, Qwen 3.8 27B at $0.80 and $4.00, cached input at half price, Batch at 50% off, free and Developer plan limits, the Llama models that moved to enterprise, and what a 40-turn conversation costs next to DeepSeek, Gemini and Claude.

DeepSeek API Pricing 2026: deepseek-flash and V4 Pro per Million Tokens, Peak vs Off-Peak, and Cost per Conversation
DeepSeek API pricing per million tokens as of 27 October 2026: deepseek-flash from $0.15 input and $0.60 output off-peak, V4 Pro from $0.66 and $1.98, cache hits from $0.003, the weekday peak hours that double every rate, and what a 40-turn conversation costs next to Claude and Gemini.

Gemini API Pricing 2026: Every Model per Million Tokens, and the Rates That Double in December and January
Gemini API pricing per million tokens for every current model as of 27 October 2026, from Flash-Lite at $0.25 to Gemini 4 Argon at $2 input, the December and January rises that double Argon and 3.8 Flash, and what a 40-turn conversation costs next to Claude and OpenAI.

Prompt Caching in Coding Agents: How Claude Code, Codex CLI, OpenCode and Pi Keep the Prefix Stable
A coding agent sends its entire context again on every request, so prompt caching decides most of what a session costs: a 60-request session on Claude Sonnet 5.5 costs $12.99 with no caching and $1.31 when every request hits the cache.

TencentDB Agent Memory, Read From the Source: It Needs a Second LLM and Searches by Keyword by Default
The guides and news pages that rank for TencentDB Agent Memory repeat three claims its source code does not support: that it builds memory without any model API, that it runs hybrid vector search out of the box, and that no conversation data leaves the machine.

Context Language Models: What the UW and Meta Paper Changes for Agent Builders, and What It Leaves to Memory
A Context Language Model is an existing model that rewrites its own context like a file. It manages working context inside a task better than summarisation, with less compute, and throws that context away when the task ends.

What Is an Agent Harness? Harness vs Model vs Agent, and Why the Harness Sets the Bill
An agent harness is the software that turns a stateless model into an agent: the loop, tools, context, compaction and permissions around it. Same-model studies from October 2026 show the harness barely moves the score on short coding tasks but sets the bill, with up to 3x cost per task from preamble size and a 13x gap in one practitioner's single-task anecdote that he puts down to prompt caching.

Short-Term vs Long-Term Memory in LLMs, and What "Context Memory" Actually Means
Short-term memory in an LLM is whatever sits in the context window on the current call: the system prompt, the recent conversation, tool results and any retrieved text, all re-sent by the application on every request and gone when the request ends.

LLM Context Window Sizes in 2026: Every Model's Limit, the Long-Context Price Cliffs, GPT-4o's 128K, and What Happens When a Chat Runs Out
Every major LLM's context window and max output as of 28 October 2026, from GPT-6's 1,050,000 tokens to Grok 4.7's 500,000, the long-context price cliffs at 100K (Claude Haiku 5.5), 200K (Gemini 3.1 Pro, Grok 4.7) and 272K (OpenAI), GPT-4o's 128,000-token window and 16,384-token output limit, and what each API and chat app does when you run out.

Agentic Context Management: Agent Memory Is Not Merely a Storage & Retrieval Problem, It Is an Architecture Problem
We argue in our latest paper, that agent memory and cost is a lifecycle and architecture problem

An Anthropic Leader Told a Room of Founders to Stop Worrying About Context Windows. Here's the catch
An Anthropic researcher told a room of founders to stop worrying about context windows. Here is the question I did not get to ask, and why a bigger window solves short-term memory with bad tradeoffs and does nothing for long-term memory.