Repository navigation
Strands Build 1 · Give the agent a job, then stop it guessing #32
akash-coded
started this conversation in
Exercises
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.
Give the agent a job
You are prototyping a desk-side assistant for your team. Before it can do anything clever, it needs two things: a clear role, and the sense to reach for a tool when it does not actually know something. That is what you will shape here.
Work at whatever level fits you. Everyone should clear Level 1; go as far past it as you like.
Spin up (30 seconds)
Run once, in Colab or locally. Stay on Haiku 4.5 while experimenting - it is fast and cheap.
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEY.aws configureonce, or export theAWS_variables in your shell.us-west-2).If something complains:
us.prefix on the model idLevel 1 - give it a role
Create one agent with a personality and a job, then talk to it.
You are done when: you can show two clearly different "personalities" answering the same question, changed only by the system prompt.
Level 2 - stop it from guessing
Your agent will happily invent things it cannot know: today's date, a live price, an order status. Give it one tool so it looks things up instead.
You are done when: the agent answers an order question by calling your tool, not by guessing.
Level 3 - push it
Pick any one:
result.metrics.get_summary()and find total cycles and total tokens.temperature=0, ask a creative question twice; rebuild withtemperature=0.9, ask twice. Compare.agent.tool_names, then look in the metrics summary to see which tools fired.You are done when: you can explain in one sentence each what temperature changed, and how the agent decided which tool to use.
Notice this
Poke at it
Ask the agent something your tool does not cover. Does it still try the tool? Why might it, and how would you stop it?
All reactions