SkyAICampus
HomePracticeLearnCode LabFocus

Learn

HomePracticeConcept cardsCode LabSky Tutor

Review

Revise todayMistake notebookProgress

Focus

Campus ForestFocus roomsSquads

Questions or feedback?
support@skyaicampus.com

SkyAICampus
PrivacyTermssupport@skyaicampus.com© 2026 SkyAI Campus
← All modules

Agentic AI

One 60-second card per skill, in learning order. 8 of 8 cards ready.

Tool use 2/2Agent loops 2/2Memory and context 2/2Safety and evaluation 2/2

In this module

1Tool use2 of 2 cards2Agent loops2 of 2 cards3Memory and context2 of 2 cards4Safety and evaluation2 of 2 cards

Topic 1

Tool use

Tool calling · Structured outputs

▶Open the lessonPractise this topic

60-second card

Tool calling

With tool calling, the model asks your program to run a function (search, calculator, database) and uses the result.

  • You describe each tool: name, purpose and parameters.
  • The model only proposes a call; your code decides whether to run it.
  • Send errors back as results, so the model can recover.
tools = {"add": lambda a, b: a + b, "mul": lambda a, b: a * b}
call = {"name": "mul", "args": {"a": 6, "b": 7}}
print(tools[call["name"]](**call["args"]))

Prints

42

Remember: Clear tool descriptions → correct tool calls.

Common mistake: Running every requested call without checks, including risky ones.

60-second card

Structured outputs

Structured outputs make the model reply in a fixed shape, like JSON with named fields, so code can read it.

  • Give a schema: field names, types and which are required.
  • Validate the reply before using it.
  • On invalid output, retry or report the error.
import json
reply = '{"name": "Asha", "marks": 88}'
data = json.loads(reply)
print(data["marks"] + 2, "marks" in data)

Prints

90 True

Remember: Never act on model output you haven't validated.

Common mistake: Parsing free text with string tricks instead of asking for JSON.

Topic 2

Agent loops

The agent loop · Planning

▶Open the lessonPractise this topic

60-second card

The agent loop

An agent repeats a loop: decide an action, run a tool, look at the result, until the task is done.

  • The model chooses each step from what it has seen so far.
  • Set a step limit and a cost budget.
  • If the steps are always the same, a fixed workflow is cheaper.
steps, done = 0, False
while not done and steps < 5:
    steps += 1
    done = steps == 3
print(steps, done)

Prints

3 True

Remember: Agents suit open-ended tasks; workflows suit known ones.

Common mistake: No step limit, so a confused agent loops and runs up a bill.

60-second card

Planning

Planning breaks a big task into steps, and good agents update the plan when something changes.

  • Write a short plan before acting.
  • ReAct: reason → act → observe, repeated.
  • Small error rates add up over many steps, so check work between steps.
print(f"{0.9 ** 5:.0%}")   # 5 steps, each 90% reliable

Prints

59%

Remember: Re-plan when new information arrives.

Common mistake: Sticking to the first plan after a step shows it was wrong.

Topic 3

Memory and context

Agent memory · Managing context

▶Open the lessonPractise this topic

60-second card

Agent memory

Short-term memory is the current conversation; long-term memory is saved notes the agent looks up later.

  • Long-term memory usually lives in a database, retrieved like RAG.
  • Save useful, accurate facts, like 'prefers Hindi explanations'.
  • Wrong or private memories cause problems in every later session.
memory = ["prefers Hindi explanations", "weak in SQL joins"]
print([m for m in memory if "join" in m])

Prints

['weak in SQL joins']

Remember: Save facts, not whole conversations.

Common mistake: Saving everything, so retrieval brings back noise.

60-second card

Managing context

Context management keeps the most useful information inside the model's context window as a session grows.

  • Summarise older turns; keep recent ones in full.
  • Trim large tool results to the relevant part.
  • Put key instructions where they won't be pushed out.
history = ["t1", "t2", "t3", "t4", "t5", "t6"]
print(["summary of t1-t3"] + history[-3:])

Prints

['summary of t1-t3', 't4', 't5', 't6']

Remember: Every token in the window should earn its place.

Common mistake: Pasting a 50-page log into the context when 20 lines matter.

Topic 4

Safety and evaluation

Guardrails · Evaluating agents

▶Open the lessonPractise this topic

60-second card

Guardrails

Guardrails limit what an agent can do, so mistakes and attacks can't cause real damage.

  • Least privilege: give only the tools and access the task needs.
  • Ask a person to approve risky actions (send, pay, delete).
  • Treat text from web pages and tools as data, never as instructions.
allowed = {"search", "read_file"}
requested = ["search", "delete_file", "read_file"]
print([t for t in requested if t in allowed])

Prints

['search', 'read_file']

Remember: The more an action can't be undone, the more checks it needs.

Common mistake: Giving an agent admin access 'to save time'.

60-second card

Evaluating agents

Evaluate agents on whole tasks: did they succeed, how many steps, what did it cost, and was anything unsafe?

  • Use a fixed set of realistic tasks with clear success checks.
  • Run each task several times, since agents vary between runs.
  • Test in a sandbox before touching real data.
results = [True] * 17 + [False] * 3
print(f"{sum(results) / len(results):.0%}")

Prints

85%

Remember: Same success rate can hide very different costs and risks.

Common mistake: Judging an agent from one lucky demo run.

Log inSign up

Practise a little every day

Five questions a day keep your Sunrise Streak going. Your progress is saved when you sign up.

Sign up free