Effect · AWS Bedrock AgentCore · Alchemy

One Effect program.
Agent + infrastructure.

Build an AI agent and deploy it to Amazon Bedrock AgentCore as a single, type-safe Effect program — the handler, the model, the IAM, the runtime, the gateway and the memory all in one language, one deploy, one mental model.

your code
HttpApi + BedrockModel + tools
+
same program
ECR · IAM · Runtime · Gateway · Memory
Why infrastructure-as-effects

The same agent, four ways to ship it

The AgentCore samples deploy with YAML, HCL, or a second TypeScript runtime that only describes infrastructure. Alchemy collapses the gap: resources are values in your Effect program, so a failed CreateAgentRuntime is a tagged error you handle — not a stack event you go hunting for.

YAML

CloudFormation

  • templates
  • no types
  • console to debug
HCL

Terraform

  • separate state
  • own language
  • plan/apply split
TS

CDK

  • synth → CFN
  • infra-only
  • runtime elsewhere
Effect

Alchemy

  • infra + runtime
  • errors in types
  • one program
The course

Nine lessons, source-grounded and runnable

Build an Effect-docs agent and deploy it to Amazon Bedrock AgentCore — agent, tools, memory and observability — from a single typed Effect program with Alchemy.

Milestones: runs locally at 02–03 · first deploy at 05 · full stack by 08

  1. 00Project setup & installing dependenciesToolchain (Node + pnpm), the pinned dependency set, workspace settings, tsconfig; verify with pnpm test.
  2. 01What AgentCore is, and why Infrastructure-as-EffectsThe two-route runtime contract; the "one Effect program" pitch; CDK/TF/CFN vs Alchemy.
  3. 02The agent as an Effect HttpApi/ping + /invocations on :8080; the Init vs Runtime phase split. runs locally
  4. 03Talking to the model: a minimal BedrockModelA provider-agnostic LanguageModel over Bedrock Converse; stub ⇄ Bedrock as one line.
  5. 04Containerize the agent and push to ECRThe container that serves the contract; declare the registry in the same program.
  6. 05IAM role and the AgentCore RuntimeExecution role + the given Runtime resource; deploy + invoke for real. first deploy
  7. 06Gateway: explainer search as an MCP toolsearchExplainers as an Effect Lambda, fronted by a Gateway MCP target.
  8. 07Memory: learner progress across turnsPersist context across invocations; read at turn start, write at end.
  9. 08Observability: tracing the agentEffect spans around the model and tools; OTEL → X-Ray / CloudWatch, connected across services. full stack
  10. 10Appendix: authoring the AgentCore resourceHow the given Resource + Provider is built against the control-plane SDK.
The arc

Local-first, then real

01

Local

Run the agent on :8080 with a stub model — no AWS creds, instant feedback.

02

Deploy

One alchemy deploy stands up ECR, IAM, Runtime, Gateway and Memory together.

03

Operate

Trace, invoke, and tear down with alchemy destroy — same program, every stage.