This website uses cookies

Read our Privacy policy and Terms of use for more information.

What we built over 30 days

Across this series you shipped a complete generative-AI stack on AWS, one runnable piece at a time. It started with a single Bedrock CLI calling two model families through the Converse API, and it ends here with an agent that has memory, tools, guardrails, observability, a real-time RAG pipeline feeding it, and a security audit gating the whole thing.

The point of a capstone is not to add a thirty-first feature. It is to step back and look at the system as one thing, because that is how it actually runs and how it actually bills. A stack you built in thirty separate sittings hides two things from you: how the pieces connect end to end, and what they cost when they run together for a month. This post answers both, then does the harder thing: tells you which of the thirty pieces are worth keeping and which were teaching exercises you should delete before they show up on a bill you have to defend.

The finished thing is a production RAG agent. A user asks a question. The question hits an agent running in AgentCore Runtime. The agent pulls context from a Bedrock Knowledge Base backed by S3 Vectors, which is kept fresh by a Kinesis stream that embeds new documents within seconds. The agent reasons with a Bedrock model, calls tools exposed through an AgentCore Gateway, and every step is gated by Guardrails and traced into CloudWatch. That is the spine. Everything else in the series was either a component of that spine or an alternative you now know how to reach for.

The reference architecture

Here is the whole stack as one diagram. Each box maps to at least one episode.

                        +-----------------------------+
   User / client -----> |  AgentCore Runtime (ep 8)   |
                        |  microVM, session isolation |
                        +--------------+--------------+
                                       |
   +-----------------+-----------------+-----------------+-----------------+
   v                 v                 v                 v                 v
 AgentCore        AgentCore       Bedrock model     AgentCore         AgentCore
 Memory (ep 9)    Gateway (ep10)   Converse         Identity (ep12)   Observability
 pref recall      Lambda->MCP      Nova / Claude    JWT auth          OTel->CloudWatch
                  tools            + Guardrails(3)                     traces+evals(ep28)
                                       |
                                       v
                        +-----------------------------+
                        | Bedrock Knowledge Base (ep2)|
                        |  retrieval + citations      |
                        +--------------+--------------+
                                       v
                        +-----------------------------+
                        |  S3 Vectors index (ep 2,26) | <--- Kinesis -> Lambda
                        |  hot tier -> OpenSearch      |      embed on ingest (ep 25)
                        +--------------+--------------+
                                       v
                 S3 Tables / Iceberg lakehouse (ep 21) <--- Glue 5.1 clean+dedupe (ep 23)
                 Athena SQL as feature API (ep 22)     <--- Zero-ETL from DynamoDB (ep 24)

Read it top to bottom as the request path, and bottom to top as the data path. The request path is what a user triggers: runtime, then retrieval, then a model call, all observed and guarded. The data path is what keeps the retrieval layer honest: raw data lands in S3, Glue cleans and dedupes it, it flows into an Iceberg lakehouse, Zero-ETL mirrors operational tables into it without pipeline code, and Kinesis streams the freshest documents straight into the vector index so RAG answers reflect data from seconds ago rather than last night's batch.

The blocks you can ignore for a first production deployment are the ones that were alternatives rather than components: SageMaker JumpStart for open-weights models (episode 27) is the escape hatch for when Bedrock does not carry the model you need, and OpenSearch (episode 26) is the hot tier you graduate to only when S3 Vectors latency stops being good enough. Everything else is load-bearing.

The real bill

This is the part every architecture post skips. Below is a monthly bill for a small but real workload: a support-assistant RAG agent handling roughly 30,000 questions a month, over a 2 GB corpus of about 500,000 vectors, kept fresh by a low-volume document stream. Prices are US-East-1 on-demand as of July 2026. Your mileage varies with region and traffic, but the shape of this bill is the lesson.

The model calls dominate, as they always do. At 30,000 questions with roughly 4,000 input tokens each (the retrieved context is most of it) and 400 output tokens, Amazon Nova Lite at $0.06 per million input and $0.24 per million output runs about $7.20 in input and $2.88 in output, call it $10 a month. Swap to Claude Sonnet at $3 and $15 per million and the same traffic becomes roughly $360 input plus $180 output, about $540 a month. That single model choice is the largest lever on the entire bill, and it is a one-line change. Route the easy 80 percent of questions to Nova Lite and reserve Claude for the hard 20 percent and you land near $115 instead of $540, for answers most users cannot tell apart.

Retrieval is almost free by comparison. S3 Vectors storage for 2 GB is $0.06 per GB-month, so 12 cents. The initial load is a one-time PUT charge of $0.20 per GB, another 40 cents. Query processing on 30,000 lookups against a half-million-vector index runs a few cents at the tiered $0.004-per-TB rate, and the June 2026 change cut large-index query costs by up to 80 percent. Round the whole vector layer to under $1 a month. Compare that to the default Bedrock Knowledge Base backend, OpenSearch Serverless, which bills a two-OCU minimum at roughly $0.24 per OCU-hour whether you query it or not: about $345 a month for the same job. That is the single most expensive default in the entire AWS AI stack, and episode 2 quietly saved you it by choosing S3 Vectors from the start.

AgentCore Runtime bills consumption, not reservation. At $0.0895 per vCPU-hour and $0.00945 per GB-hour, per second, with CPU charged only while the agent is actually computing rather than waiting on the model, 30,000 short agent invocations land in the low single-digit dollars. Call it $3 to $5 a month. The consumption model matters precisely because agents spend most of their wall-clock time waiting on LLM responses, and you pay nothing for that wait on the CPU meter. The ingestion side (Kinesis on-demand plus a small Lambda) is another few dollars. Guardrails, observability, and the Knowledge Base retrieval API add single-digit dollars each.

Add it up. On Nova Lite with S3 Vectors, the whole stack runs roughly $25 to $35 a month at 30,000 questions. Flip two defaults the wrong way, Claude Sonnet for everything and OpenSearch Serverless instead of S3 Vectors, and the identical architecture bills north of $900. Same diagram, same code, a 30x swing. The architecture is not the cost. Two or three default choices are the cost.

The decision guide: what to keep

Thirty episodes gave you options. Options are a tax if you keep all of them. Here is the honest keep-or-delete call on the ones that matter.

Keep S3 Vectors as your default vector store. Reach for OpenSearch only when you have measured a latency problem. S3 Vectors gives sub-second cold and roughly 100ms warm queries for cents a month. OpenSearch gives roughly 10ms for hundreds of dollars a month. The tiered setup from episode 26 (S3 Vectors as the bulk store, hot vectors exported to OpenSearch) is the right end state, but only after you can point at a p95 number that a user actually feels. Most RAG apps never get there.

Keep Bedrock as the model layer. Keep SageMaker JumpStart as a documented escape hatch, not a running endpoint. A SageMaker real-time endpoint for an open-weights model runs about $1.50 an hour, which is over $1,000 a month whether it serves one request or a million, because you rent the GPU by the wall-clock hour. Bedrock bills per token. Unless you need a specific open-weights model Bedrock does not carry, or you have the sustained throughput to saturate a GPU, Bedrock wins on cost by a wide margin. Delete idle endpoints today. Episode 27 was a capability lesson, not a default.

Keep Strands and AgentCore for anything going to production. Keep the raw Converse loop for prototypes. The episode-1 CLI that called Converse directly is the right tool for a script. The moment an agent needs memory, tool routing, session isolation, identity, and traces, rebuilding those by hand is how you end up maintaining a worse version of AgentCore. The managed harness is worth its consumption bill.

Keep the data-quality layer. It is invisible until it poisons an answer. Glue 5.1 cleaning and deduping your corpus (episode 23) produces nothing a demo will show off. It also prevents the failure mode where a near-duplicate document ranks three times in retrieval and the model confidently repeats a stale fact. This is the least glamorous keep on the list and the one most teams skip until it costs them.

Keep the security audit as a CI gate, not a one-time exercise. The audit_agent_stack.py auditor and the Well-Architected Agentic AI Lens from episode 29 only pay off if they run on every change. IAM permissions drift, guardrails get loosened for a demo and never tightened, and a wildcard Action:* sneaks in during a Friday deploy. Wire the auditor to exit non-zero in CI and it earns its keep. Run it once and it is theater.

Tear the whole thing down

If you built along with the series in one account, you now have thirty tutorials' worth of resources, and some of them bill whether you use them or not. Before you close this tab, run the audit that matters most: what is still costing money.

The three usual suspects are a SageMaker endpoint left InService, an OpenSearch Serverless collection holding its two-OCU minimum, and a Redshift Serverless workgroup from the Zero-ETL episode. Each of those is a fixed hourly charge that does not care whether you are using it. Find and kill them.

# SageMaker real-time endpoints still running (the $1.50/hr trap)
aws sagemaker list-endpoints --query "Endpoints[?EndpointStatus=='InService'].EndpointName"

# OpenSearch Serverless collections (the 2-OCU / ~$345/mo minimum)
aws opensearchserverless list-collections --query "collectionSummaries[].name"

# Redshift Serverless workgroups from the Zero-ETL episode
aws redshift-serverless list-workgroups --query "workgroups[].workgroupName"

S3 Vectors, Bedrock, Kinesis on-demand, and AgentCore Runtime all bill on use, so an idle stack of those costs close to nothing and you can leave it for later cleanup. The fixed-cost resources are the ones to delete now. Delete the endpoint with aws sagemaker delete-endpoint, the collection through the OpenSearch console after emptying it, and the Redshift workgroup and namespace. Then run episode 29's auditor one more time and confirm no orphaned IAM roles are still granting access to things that no longer exist.

Where to take it next

Three directions, easiest to hardest. First, put a cost alarm on the whole stack: a CloudWatch billing alarm plus AWS Budgets scoped to the tags you have been applying since episode 12, so the next idle endpoint pages you instead of surprising you. Second, turn the request-path diagram above into infrastructure as code, so the stack is reproducible in a fresh account in one command rather than thirty sittings. Third, run a real evaluation harness against the finished agent using the Bedrock Evaluations job from episode 4, so you have a quality number to defend when you route more traffic to the cheaper model.

That last one is the real graduation. The series taught you to build the stack. The open question it leaves you with is the one every team eventually faces: how much quality are you actually giving up when you cut the bill from $900 to $30, and can you prove it? Build the eval, run it, and you will know. That is the difference between an architecture you assembled and one you own.

This is the last episode of the AWS AI Series. Thirty builds, one stack, and now you can read the bill. Go delete an endpoint.

Sources

Keep Reading