Glossary

Reference intermediate

A quick-reference glossary for the Agentic AI course. Each term is defined in one or two sentences, with code where a schema makes the meaning concrete. See also the tool reference and the rules.

Core Concepts (A–C)

Term Definition
Agent An LLM-driven system that pursues a goal by repeatedly planning, calling tools, and observing results — not a single prompt-response, but a loop.
Agent loop The control cycle think → act → observe → repeat that drives an agent until a stop condition (goal met, budget hit, error).
Action A single step an agent takes, usually a tool call with concrete arguments, e.g. read_file(path="src/app.py").
Autonomy The degree to which an agent acts without human approval. Higher autonomy means fewer approval loops but greater blast radius on failure.
Chain-of-thought (CoT) Prompting the model to produce step-by-step reasoning before its answer, improving multi-step accuracy.
Context window The model's short-term memory: the token budget holding the system prompt, history, tool results, and current turn. When it fills, you must summarise or evict.

Core Concepts (D–H)

Term Definition
Episodic memory Memory of specific past experiences ("ticket #482 was solved by restarting the worker"), usually stored as retrievable records keyed by event.
Function calling The mechanism by which a model emits a structured request to invoke a named function with typed arguments, instead of free text. Synonym for tool use at the API layer.
Goal decomposition Breaking a complex objective into an ordered set of sub-tasks an agent can execute one at a time.
Guardrail A constraint that blocks or modifies unsafe agent behaviour — input filters, output validators, allowlists, or approval gates.
Human-in-the-loop (HITL) A pattern where a human approves designated actions before they execute (e.g. anything that writes to production).

Core Concepts (M–P)

Term Definition
MCP (Model Context Protocol) An open protocol that standardises how agents discover and call external tools/data via servers, so a tool written once works across MCP-compatible clients.
Memory (long-term) Persistent storage that survives across sessions, typically a vector store or database the agent queries on demand.
Memory (short-term) Information held in the live context window for the current task; lost when the session ends or context is cleared.
Planning Deciding what to do and in what order before acting; distinguishes an agent from a single tool-calling wrapper.
Plan-and-Execute An architecture that generates a full plan up front, then executes each step. Handles complex tasks well but re-planning on failure adds latency.
Principal hierarchy The ordering of authorities whose instructions an agent must obey (developer > operator > end user > untrusted content), used to resist prompt injection.
Prompt injection When content the agent reads (a web page, a file, a tool result) contains text worded as instructions, and the agent follows it instead of its own instructions.

Core Concepts (R–Z)

Term Definition
ReAct "Reasoning + Acting": an architecture that interleaves a reasoning trace with tool calls in a single loop. Simple and robust, but can loop or get stuck without guards.
Reflexion An architecture where the agent critiques its own output and retries with the critique fed back in, trading extra tokens for higher quality.
Resource limit A hard cap on tokens, wall-clock time, or action count that terminates a runaway agent. Triggers re-planning or shutdown.
Sandbox An isolated execution environment (container, restricted FS, network allowlist) that bounds what an agent's actions can touch.
Semantic memory General facts and knowledge an agent can recall ("the API rate limit is 100 req/min"), distinct from memory of specific events.
Stop condition The predicate that ends the agent loop: goal met, budget exhausted, max steps reached, or fatal error.
Tool A function exposed to the model with a name, description, and JSON input schema that it may call to act on the world.
Tool use The end-to-end flow of a model selecting a tool, supplying arguments, you executing it, and returning the result for the next turn.
Tree-of-thought (ToT) Exploring multiple reasoning branches in parallel and selecting the best, at higher cost than linear chain-of-thought.

Anatomy of a Tool Definition

Every tool the model can call needs a name, a description (the model reads this to decide when to use it), and an input_schema (JSON Schema describing the arguments):

tools = [
    {
        "name": "get_weather",
        "description": "Get the current weather for a city. "
                       "Use when the user asks about temperature or conditions.",
        "input_schema": {
            "type": "object",
            "properties": {
                "city": {"type": "string", "description": "City name, e.g. 'Berlin'"},
                "unit": {"type": "string", "enum": ["c", "f"], "default": "c"},
            },
            "required": ["city"],
        },
    }
]

The Agent Loop in Code

The minimal think-act-observe loop using Claude's tool use API. Note the stop conditions on stop_reason and max_steps — without them an agent can run indefinitely:

import anthropic

client = anthropic.Anthropic()
messages = [{"role": "user", "content": "What's the weather in Berlin?"}]

for step in range(10):  # max_steps resource limit
    resp = client.messages.create(
        model="claude-sonnet-latest",
        max_tokens=1024,
        tools=tools,
        messages=messages,
    )
    messages.append({"role": "assistant", "content": resp.content})

    if resp.stop_reason != "tool_use":
        break  # stop condition: model gave a final answer

    results = []
    for block in resp.content:
        if block.type == "tool_use":
            output = run_tool(block.name, block.input)  # your executor
            results.append({
                "type": "tool_result",
                "tool_use_id": block.id,
                "content": str(output),
            })
    messages.append({"role": "user", "content": results})

Architecture Quick-Compare

Architecture When to choose Main trade-off
ReAct Open-ended tasks, unknown step count Can loop or stall; needs step caps
Plan-and-Execute Complex tasks with clear sub-steps Higher latency; brittle if plan is wrong
Reflexion Quality matters more than cost Extra tokens and turns per retry

Returning a Tool Error

Signal failure with is_error so the model can re-plan rather than treating the failure as data:

{
    "type": "tool_result",
    "tool_use_id": block.id,
    "content": "Error: file not found at 'src/app.py'.",
    "is_error": True,
}

See Also