AWS Builder Center

Upgrade your context, not your model

Giving an agent the meaning of your data will improve accuracy. Here's why a context layer (or semantic layer) matters, and which AWS services help you build one.

TL;DR: If your AI agent gives wrong answers on your business data, a newer model usually won't fix it. Giving the agent the meaning of your data will. Here's why a context layer (or semantic layer) matters, and which AWS services help you build one.



Semantic Layer / Context Layer for Agentic AI


The pattern I keep seeing

A startup builds an agent. The demo works great. Then in production it fails on simple questions like "What was our Q3 revenue?"
The first reflex is to swap the model. Accuracy goes up a little, the bill goes up a lot, and the agent is still wrong.
The teams that made it to production did something else: they invested in context. Colleagues of mine tested exactly this: they kept the model the same, added a semantic layer, and accuracy jumped significantly. Public research shows the same: in a  benchmark on enterprise SQL databases , GPT-4 went from 16% to 54% correct answers once a knowledge graph was added.
You rent the model by the token, but you own the meaning of your data. So invest in what you own.

Schema is not semantics

Take a sales table with  order_date ,  ship_date ,  gross_revenue  and  net_revenue . To answer "What was Q3 revenue?", the agent has to guess: gross or net? Order date or ship date? Calendar or fiscal Q3?
A human analyst knows. The agent doesn't, and it won't tell you it's guessing. It hallucinates with confidence.
A context layer stores that business meaning in a form machines can read: business descriptions, metric definitions, how things relate, and verified example queries. It's not a prompt template. It's a curated asset you keep improving.


The AWS building blocks


Catalogs and business meaning
  • Amazon SageMaker Catalog: your business catalog with glossary terms, data products, and ownership. This is where meaning gets governed, so for me it's one of the most important pieces.
  •  SageMaker Data Agent : combines both catalogs, so "calculate customer retention rate" picks the right tables and respects access rights.


Knowledge graphs, ontology solution, and graph database
  • AWS Context (coming soon,  announcement blog ): maps relationships across your data into a governed knowledge graph that agents query through MCP.
  •  Context Ontology Accelerator : open source on GitHub. It helps you build your ontology and knowledge graph today, and it's the on-ramp to AWS Context.
  •  Amazon Neptune : the managed graph database where your knowledge graph lives. Neptune Database is for always-on graph workloads (SPARQL for ontologies, openCypher/Gremlin for property graphs). Neptune Analytics adds fast in-memory graph analytics and vector search. It's also the graph store behind GraphRAG in Bedrock Knowledge Bases.
Agent memory

How agents get the context at runtime
  • RAG with  Amazon Bedrock Knowledge Bases : retrieves the right documents and passes them to the model with the question. Good for unstructured content like policies, wikis, and runbooks. It also supports structured data (natural language to SQL) and  GraphRAG , which adds relationships from a graph in Amazon Neptune Analytics to plain vector search.
  • MCP servers: the Model Context Protocol is the standard way for an agent to call tools and fetch context. The open-source  AWS MCP servers  give agents access to services like Glue Data Catalog, S3 Tables, and Redshift. Your catalog and knowledge graph become something the agent can actually query instead of guess.
  •  AgentCore Gateway : turns your existing APIs and Lambda functions into MCP tools, with identity built in, so each agent only sees the context its user is allowed to see.
Put simply: catalogs and knowledge graphs store the meaning, memory keeps what was learned, and RAG and MCP deliver the right piece of it to the agent at the right moment.

Context for your own work: productivity and coding tools

Everything above is what you build into your product's agents. The same idea also pays off in the AI tools you use every day. These come with context built in, so there's nothing to set up:
  •  Amazon Quick Desktop : comes with a built-in knowledge graph of your people, projects, and decisions, so its answers are grounded in your actual work.
  •  Kiro Memory : for coding. Kiro remembers your build and test commands, conventions, and debugging insights across sessions. If it learns once that tests fail until the database is seeded, it seeds it first next time.
  •  Kiro Crew : adds persistent memory, self-learning from your corrections, scheduled jobs, and background agents on top of kiro-cli. Tell it once how you like things done, and it keeps doing it that way in every new session. You can run it remotely, and connect to channels such as Telegram or Slack.
  •  Karpathy's LLM Wiki : a lightweight pattern where an LLM turns your documents into curated, linked markdown pages and keeps them up to date.

Don't skip the foundation

Context only helps if the data under it is right. If a pricing pipeline fails silently, your agent will quote the old price. Start with data contracts: agreed schema, quality rules, and freshness. When data breaks the contract, the agent should say "I don't have current pricing" instead of being confidently wrong.

Where to start

  1. Pick one question your agent gets wrong today.
  1. Describe the tables behind it in Glue Data Catalog and SageMaker Catalog.
  1. Define the key metric once, and add a few verified example queries.
  1. Measure accuracy before and after, on the same model.

The model matters less than you think. The meaning you give it matters more.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article