back to blog

Context systems vs RAG: from retrieval to context engineering

Read Time 8 mins | Written by: Cole

Context systems vs RAG: from retrieval to context engineering

When Redis launched its Iris context engine in May 2026, CEO Rowan Trollope opened with a line aimed at every team building AI agents: "Agents don't have an intelligence problem. They have a context problem."

In Redis's State of Context Engineering 2026 survey of more than 1,000 IT and AI infrastructure leaders, 97% say context is critical. Only 4% have built the infrastructure to deliver it for AI agents.

RAG systems were the first context systems, and they're still crucial. They're now one part of a bigger context stack. Here’s what you need to know about RAG and context systems to keep up with and learn from AI-native companies like Ramp, Notion, and Anthropic.

What is context engineering?

Anthropic's engineering team defines context engineering as "the set of strategies for curating and maintaining the optimal set of tokens (information) during LLM inference."

The term took off in June 2025, when Shopify CEO Tobi Lütke said it named the real skill: "providing all the context for the task to be plausibly solvable by the LLM."

Andrej Karpathy's list of what fills that context window included task descriptions, few-shot examples, RAG, multimodal data, tools, state, and history. RAG is one item on the list.

But AI agents don’t work without humans and both need the same context to work together. Industry leaders like Notion are already building shared context systems, where employees and AI agents work from the same linked projects, people, customers, skills, workflows, and documents. Notion's guide sums up the strategy in six words: "Rent the intelligence. Own the context."

 

What is a context system?

A context system is the shared store that context engineering draws from, so every person and every agent starts from the same information. Context engineering decides what goes into the window on each turn. The context system decides what's there to choose from.

It holds four kinds of context:

  • Knowledge – documents, notes, and records. RAG is the foundation here, because retrieval is how anything in the system gets found.
  • Schema structure – links between records, like customers to projects to owners, so agents navigate instead of searching.
  • Skills – written instructions for how the company does a task, like running a monthly close or triaging a support ticket. An agent sees only each skill's name and description until a task needs the full instructions. Anthropic introduced Agent Skills in October 2025.
  • Permissions – who and what can see each piece, kept current as people and data change.

Documents tell agents what the company knows. Skills tell them how to perform their tasks.

Organizing context ahead of time pays off in tokens and accuracy. Pinecone's Nexus compiles documents into task-ready knowledge before an agent asks:

These numbers show that context organized ahead of time is cheaper and more accurate than raw search at runtime.

What a full context system looks like at Notion

Notion's guide describes the system it runs on internally.company-topology

 Notion's connected company topology. Source: Notion, A new shape for work. 

  • Core databases, linked. Projects, Tasks, Documents, People, Teams, and Customers, with relations between them. An agent can go from a customer to its projects to the people who own them without a keyword search.
  • Meetings as records. Each meeting links to the projects and people it involved, so meeting notes stay connected to the work they're about.
  • Fine-grained permissions. Access is set by group, row, and column. A salary column can stay private while the rest of the record is shared.
  • Syncs over scattered connections. Data from tools like Salesforce is synced in, so agents have one place to look.
  • Shared skills over personal ones. Repeatable work runs as shared workflows that a few people maintain and everyone uses, with prompts versioned in a database and evals to test changes.
  • Agents that maintain the context. Agents fix stale or misplaced information over time.
  • Built for people, too. Comments, @mentions, notifications, and mobile apps, because in Notion's words, "a context system needs to be great for humans, too."

Why AI agents outgrew single-shot RAG

RAG was designed for a person who asks a question and reads the answer. Agents ask far more questions, and they ask them in a loop.

  • Volume. "Companies will have orders of magnitude more agents than human beings," Trollope told VentureBeat. Pinecone CEO Ash Ashutosh was blunter when he launched Nexus, Pinecone's new context engine: "RAG was built for human users. Nexus was built for agentic users, because their language is very different."
  • Context rot. When RAG answers come up short, the instinct is to retrieve more chunks. That backfires. Chroma tested 18 models in July 2025 and found "model performance grows increasingly unreliable as input length grows." Anthropic calls this context rot: as tokens pile up, "the model's ability to accurately recall information from that context decreases."
  • Cost. An agent pays for its context window on every turn. A 20-turn task that carries 50,000 tokens of documents from turn to turn bills a million input tokens before it writes a word. Prompt caching cuts that, but only when the window stays stable between turns. Overstuffing the window makes answers worse and the bill bigger.
  • State. A multi-step agent needs to remember what it already searched, what it found, and what it ruled out. One-shot retrieval starts from zero every time.

Why teams need shared context as AI use spreads

The same gap shows up for people. Most companies adopted AI one chat at a time. Each person connects their own tools, writes their own prompts, and pastes in their own background. Notion's guide calls that kind of AI "essentially stateless and single-player" – what one person teaches it doesn't carry over to the next.

That gets expensive as usage spreads:

  • Different answers to the same question. Two people ask about the same customer and get different answers, because their assistants saw different information.
  • Skills that only work on one laptop. The same skill gives different results on another machine, and nobody can see why.
  • A setup cost for every new hire. Each person pays what Notion calls a "configuration tax" before their AI is useful.

Agents raise the stakes. An agent running on a schedule has no person filling in the gaps, so it only knows what the shared context gives it. A context system has to serve both:

  • People need it readable, searchable, and easy to comment on.
  • Agents need it structured and permissioned.
  • Both need shared skills – one version, maintained in one place.

When people and agents draw from the same source, a correction one person makes reaches every teammate and every agent.

Where to start: build a context system around your RAG pipeline

You don't retire RAG to get to a context system. You build on it in stages. Start by logging what goes into the window on every turn – it's the fastest way to find wasted tokens and missing data. Then move up a stage when you see its sign:

  1. RAG. Search over your documents. Many teams already have it.
  2. Agentic RAG. The agent decides when and how to retrieve, across steps and search types, with hybrid search and a reranker. Move here when answers miss exact terms or one search isn't enough. Intent to adopt hybrid retrieval tripled from 10.3% to 33.3% in Q1 2026, per VentureBeat's Pulse research.
  3. Structure. A semantic layer and links between your data, so agents navigate to the right record instead of searching for it. Move here when agents need structured business data.
  4. Tools, skills, and syncs. Write skills for repeatable tasks and keep them in the shared system, not on individual laptops. Connect agents to data where it lives through Model Context Protocol (MCP), or sync it into one store. Connecting is faster to start. Syncing gives one place to look and one set of permissions to enforce.
  5. Memory and compaction. Notes kept outside the window and summaries of long sessions, for tasks that run more than a few turns.
  6. Governance and maintenance. Permissions, freshness rules, and agents that keep content current. Scope permissions from day one – they're easier to build in than to bolt on.

Measure answer quality and cost per task on a fixed test set before and after each stage. Our guide to choosing LLMs for production RAG systems covers which model fits each step. And take Notion's advice: start with one workflow or one team.

Building context with agentic RAG: a client example 

We built an agentic RAG system for a national clean-energy engineering firm: 2.3 million files across 544 projects, most of them scanned PDFs with no text layer.

  • Five Claude workflows each retrieve differently – deep search, keyword search, side-by-side comparison, code compliance, and general chat
  • Hybrid search improved keyword search results by 62%
  • Continuous ingestion picks up new files every 15 minutes, because engineers add files daily
  • Citations link every answer to its source file, so engineers can check it in one click

Engineer-scored answer quality rose 15%.

Models will keep changing, and you'll swap them as they do. The context you build – your documents, your data, how it connects, and who can see it – stays yours. Teams with strong RAG already own the hardest part of it.

Codingscape builds production RAG and agentic AI systems with senior, AI-native engineering teams. If you want to evolve your RAG system into a context system for humans and AI agents to work together, let's talk >

Don't Miss
Another Update

Subscribe to be notified when
new content is published
Cole

Cole is Codingscape's Content Marketing Strategist & Copywriter.