Repository navigation
AgentCore Lab A · ParcelPilot: runtime, memory, and a bounded definition of done #17
akash-coded
started this conversation in
Hands-on Labs
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Mid-Session Exercise A — “ParcelPilot”
Follows: notebooks 01–03 (build an agent three ways · Runtime · Memory)
Format: two parts — Part 1 is thinking only (no code), Part 2 is build
Time box: ~55 min total · Part 1 ~18 min · Part 2 ~37 min
Assumes you can already: create a Strands
Agentwith a@tool, wrap it inBedrockAgentCoreApp, deploy withRuntime(), attach AgentCore Memory.Region / models: us-east-1 · Haiku 4.5 for the agent.
Scenario
Company: ParcelPilot, a last-mile delivery startup.
Your role: solutions engineer embedded with the support team.
The pain: every time a customer messages, agents re-ask the same things — “where should we leave it?”, “which gate?”, “call on arrival?”. Customers hate repeating themselves, and handle time is high. Leadership wants an assistant that remembers each recipient’s delivery preferences and answers basic parcel-status questions.
That’s the whole brief you were handed. It is deliberately thin. Expanding it is the first half of your job.
The problem to expand
“Build an agent that remembers delivery preferences and answers status questions.”
A sentence is not a spec. Before any code, turn it into something a teammate could build from.
Part 1 — Design & brainstorm (no code, ~18 min)
Work on paper, a whiteboard, or a doc. Produce these seven deliverables.
Job decomposition. List every distinct job the agent must do. For each, mark tool (needs data/action) or model-only (reasoning/phrasing). Example to get you started: look up parcel status → tool; phrase a polite update → model.
Tool design. Define the one or two tools you need: name, inputs, and the exact output shape (a dict with which fields?). State what is mocked today and what becomes a real backend later.
Memory model — the key decision.
userPreferenceMemoryStrategy?semanticMemoryStrategy?) and a namespace template using{actorId}.Invocation contract. Define the request payload (which keys) and the response shape. Decide: who is
actor_idin a delivery context — the recipient, the address, the account? Justify it.Conversation design. Write the agent’s system prompt in plain English: its scope, tone, and the rule for when to use remembered preferences vs ask.
Acceptance checks. Write three concrete checks a non-technical PM could verify by chatting with it (e.g., “Returning customer is not asked for their drop spot again”).
Architecture sketch. Draw it as a simple diagram, e.g.:
flowchart LR C[Customer message] --> R[Runtime: app.py] R --> A[ParcelPilot agent] A -->|status tool| T[Parcel status backend] A -->|memory hook| M[(AgentCore Memory: recipient prefs)]Skeptic prompts — answer at least two in writing:
actor_idchoice handle that, or quietly mix them up?Part 1 is “done” when: a peer could pick up your seven deliverables and start building without asking you a clarifying question.
Part 2 — Build (code / agent actions, ~37 min)
Layered. Do your band; reach up if you finish.
Base — everyone
Implement the agent in Strands with your status tool, and test it locally (plain Python call, no deploy).
us.anthropic.claude-haiku-4-5-20251001-v1:0).Stretch
Wrap the agent in
BedrockAgentCoreAppwith an@app.entrypointthat honors your payload contract, and test the container locally.curl /pingis healthy andcurl /invocationswith your payload returns the agent’s answer.Advanced
Add a memory hook that preloads recipient preferences on init and persists turns. Demonstrate cross-session recall.
session_ids) for the sameactor_id. In conversation 1 the customer states a drop preference; in conversation 2 the agent honors it without being told again.Run it (essentials — full steps in NB0/NB2):
aws configureor env vars) → select thePython (agentcore)kernel.pip install -r requirements.txt→ credentials via Colab secrets/env vars → run.actor_idmust be a stable id, secrets never hardcoded,MEMORY_IDinjected via env.You may not: paste the TravelMind capstone and rename it. The tools, memory namespace, and contract must be yours, designed in Part 1.
LLM-integrated task (pass/fail — required)
Send your agent a vague request: just “my parcel?”.
Pass = you show the before, the diagnosis, and a genuinely better after.
Reflection & viva-readiness
Be ready to answer in ~2 minutes each:
Self-check rubric (100 pts — formative)
All reactions