
Amazon S3 as the Foundation for Agentic Workflows on AWS
How S3 can serve as the data layer for AI agents, using S3 Vectors for semantic search, S3 Tables and S3 Metadata for structured questions, and event notifications as triggers. Includes four example workflows with Kiro and MCP servers, plus guardrails for agents that touch your buckets.
Amazon S3 as the Foundation for Agentic Workflows on AWS
An AI agent is only as useful as the data it can reach. It needs documents to read, a place to search by meaning, tables to query, a way to know when something new arrives, and somewhere safe to write its results. For many teams, most of that data already sits in Amazon S3. AWS has added several S3 features aimed at exactly this use case, and there is an MCP server that lets an assistant work with them in plain language. This article explains the pieces, shows how they fit together, and walks through example workflows you can build with Kiro and MCP.
The roles S3 can play for an agent
It helps to think of S3 as four different things in an agentic system.
- A source of documents. PDFs, reports, logs and exports uploaded to a bucket become the material an agent reads from.
- A vector store. S3 Vectors lets you store and query embeddings directly in S3.
- A table store. S3 Tables keeps tabular data in Apache Iceberg format, and S3 Metadata makes information about your objects queryable as tables.
- An event source. Uploading an object can trigger the rest of your pipeline.
Each role has its own tool and its own tradeoffs, so the sections below take them one at a time.
Documents and vectors: retrieval without a separate database
Retrieval augmented generation (RAG) means the model answers using passages retrieved from your own data instead of relying on memory. The usual pipeline stores documents in S3, converts them to embeddings, keeps the embeddings in a vector store and searches that store when a question arrives.
Amazon S3 Vectors is a vector store built into S3. AWS describes it as the first cloud object store with native support for storing and querying vectors. You work with vector buckets and vector indexes through a dedicated set of APIs, with no infrastructure to provision. According to AWS, it can reduce the cost of uploading, storing and querying vectors by up to 90%, supports up to 2 billion vectors per index and 10,000 indexes per bucket, and returns results with sub-second query performance.
It integrates natively with Amazon Bedrock Knowledge Bases, so you can point a knowledge base at documents in S3 and use S3 Vectors as the vector store behind it. AWS also positions it as a way to give agents long term memory, since storing every interaction and document becomes affordable at large scale.
One tradeoff to know about. S3 Vectors is designed for large, long term vector data that does not need the high query rates of an in memory vector database. When you need high throughput and low latency for real time applications, Amazon OpenSearch Service is the better fit, and the two can work together. A common pattern is to keep rarely queried vectors in S3 Vectors and move hot data to OpenSearch as demand grows.
Structured data: S3 Tables and S3 Metadata
Agents are often asked questions that need exact numbers, not similar passages. For that, structured data in a queryable format works better than embeddings.
S3 Tables stores tabular data in Apache Iceberg format inside special table buckets. Amazon S3 Metadata goes a step further for object storage itself. It records information about the objects in a bucket, such as tags, object keys, encryption type and user defined metadata, in tables you can query. These tables live in an AWS managed table bucket named aws-s3 in each Region.
This is useful because the question "which of my objects are not encrypted with the key I expect" becomes a table query instead of a script that lists millions of objects.
Giving the assistant access with the S3 Tables MCP server
AWS Labs maintains an MCP server for S3 Tables. With it, an assistant can create and query tables, generate tables directly from CSV files uploaded to S3, and read S3 Metadata tables, all through natural language. AWS documentation lists Kiro among the clients that work with it.
A few details matter for safety:
- By default the server runs in read only mode.
- When writes are enabled, SQL based writes support appending new data only. Updates and deletes are not available that way.
- The CSV to table conversion creates tables and does not delete or update existing ones.
- Calls made through the server using PyIceberg are identifiable in CloudTrail by a user agent string that starts with awslabs/mcp/s3-tables-mcp-server, so you can audit what the assistant did.
The server's documentation also states plainly that you are responsible for the actions and permissions of the agents that use it. A configuration for Kiro goes in ~/.kiro/settings/mcp.json and uses uvx to launch the server with an AWS profile and Region in its environment. Use a dedicated read only profile unless you have a reason not to.
Events: letting an upload start the work
S3 can send event notifications when objects are created or removed, and you can route them to services such as AWS Lambda, Amazon SQS, Amazon SNS or Amazon EventBridge. For agentic flows this means a new file can start processing automatically. A Lambda function receives the event, reads the object and calls a model or an agent, then writes the result back.
AWS publishes reference solutions that combine these pieces. One example uses Amazon Bedrock Knowledge Bases on S3 Vectors for retrieval, a Lambda function that uses a Bedrock model to turn schemas into markdown documentation saved to S3, and a daily Amazon EventBridge rule that triggers a Lambda function to re-index the knowledge base. It shows a realistic split of work between scheduled jobs, events and agents.
Example workflows with Kiro and MCP
These are example setups, and the prompts are samples to adapt. They are not measured results.
Workflow 1: Ask questions about your own buckets
Servers: S3 Tables MCP server, read only profile.
- Turn on S3 Metadata for the buckets you want to inspect.
- Connect the S3 Tables MCP server to Kiro with a read only profile.
- Ask questions such as: "Which objects in this bucket have no tags?", "What are the largest objects by prefix?" and "Which objects use a different encryption type from the rest?"
- Save the useful queries into a markdown file in the repo so the team can rerun them.
Workflow 2: Turn uploaded CSV files into queryable tables
Servers: S3 Tables MCP server.
- Upload CSV files to a bucket.
- Ask the assistant to inspect the files and create tables from them in a named table bucket and namespace.
- Review the proposed schema before approving it. Column types are where mistakes hide.
- Ask follow up questions in natural language and check the generated SQL the first few times.
Remember that this conversion creates tables only. Any later cleanup or deletion is a deliberate step you take yourself.
Workflow 3: A document pipeline triggered by uploads
Servers: Documentation, CDK. Kiro features: spec and steering files.
- Describe the pipeline in a spec: which prefix receives files, what the agent should extract or summarize, and where results go. Include file size limits and what happens when processing fails.
- Put your bucket rules in a steering file, such as naming, encryption, prefix layout and Block Public Access.
- Let the agent use the Documentation server to confirm event notification options and the CDK server to write the infrastructure.
- Write results under a separate prefix or bucket from the inputs, so a bug in the agent cannot overwrite the source documents.
- Test with a few small files in a sandbox account before enabling the trigger on a real bucket.
Workflow 4: A knowledge base over your documents
Servers: Documentation. Kiro features: spec.
- Put source documents in an S3 bucket with a clear prefix structure.
- Use the spec to state which questions the assistant must answer, and which it must refuse because the documents do not cover them.
- Create a Bedrock Knowledge Base that uses S3 Vectors as its vector store.
- Decide how updates reach the index. A scheduled sync is simple, and an event driven sync reacts faster.
- Test with questions whose answers you already know and check that the citations point to the right documents.
Choosing the right storage for the job
You need | Reach for |
|---|---|
Search documents by meaning | S3 Vectors, with Bedrock Knowledge Bases |
Very fast, high volume vector search | OpenSearch Service, optionally with S3 Vectors behind it |
Exact answers from structured data | S3 Tables |
Questions about the objects themselves | S3 Metadata tables |
Start work when a file arrives | S3 event notifications to Lambda or EventBridge |
Guardrails for agents that touch S3
- Scope permissions narrowly. Give the agent a role limited to the buckets and prefixes it needs, and read only access wherever possible.
- Separate inputs from outputs. Keep agent written results away from the original documents, and turn on versioning so overwritten objects can be recovered.
- Treat stored documents as untrusted. A file in a bucket can contain text that tries to give the model instructions. Limit what tools the agent has while it processes outside content, and do not let it take destructive actions based on what a document says.
- Block public access and encrypt. Keep S3 Block Public Access on and use server side encryption that matches your policy.
- Log what happens. CloudTrail records S3 Tables operations from the MCP server, and you can enable data events for object level activity.
- Watch cost and loops. An agent that lists or reads objects repeatedly generates requests. Set budgets and alarms, and prefer querying S3 Metadata tables over scanning a bucket.
Final thoughts
S3 is no longer only the place where data waits. With S3 Vectors for meaning based search, S3 Tables and S3 Metadata for exact questions, event notifications for triggers and an MCP server for conversational access, it can serve as the data layer of an agentic system. The service details will keep changing, so check the current documentation before you commit to a design. The structure is the part worth keeping: separate inputs from outputs, pick the storage that matches the question, give agents the least access that works, and review what they do.
Further reading
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article