← Home · Tutorial 11 · Agents

Agent frameworks and APIs

The four parts every agent stack shares, how the main options differ, and which names are out of date.

Last reviewed 5 October 2026 · Written with AI assistance and reviewed by me

Where this comes from: my notes on the agent lessons in Activeloop's RAG course, rebuilt against current vendor documentation: Anthropic's tool-using agent tutorial, OpenAI's Assistants API deprecation notice, and LlamaIndex's agent guide. The explanations and code are my own.
Who this is for: anyone who understands the agent loop and now has to pick tools to build one. You will learn the four parts every agent stack shares, how the main options differ, and which names are already out of date.

1Purpose first

Why learn the parts before the products.

You have seen that an agent is prompts, logic and memory in a loop (agent basics). To build one you have to choose: write the loop yourself, use a vendor's agent kit, or use a framework. The names change every few months. The parts underneath do not, so learn the parts first.

2The four parts

What every stack shares.

Four parts in every agent stack
Modeldecides what to do
→
Toolsfunctions it may ask for
→
Looprun, feed back, repeat
→
Statewhat is remembered

Every product below is a different way of packaging these four. If you can find them in a new tool within a minute, you can learn that tool quickly.

3Tools are descriptions

What the model really sees.

A tool is an ordinary function plus a description the model can read: a name, a sentence about what it does, and the inputs it takes. Frameworks build that description from your function's docstring and type hints. This snippet does the same by hand:

Python
import inspect, json

def get_order_status(order_id: str) -> str:
    """Look up the shipping status of an order from its id."""
    return "shipped"

def make_spec(fn):
    # what frameworks do for you: turn a function into a tool description
    kinds = {str: "string", int: "integer", float: "number"}
    params = inspect.signature(fn).parameters
    props = {n: {"type": kinds[p.annotation]} for n, p in params.items()}
    return {"name": fn.__name__, "description": inspect.getdoc(fn),
            "input_schema": {"type": "object", "properties": props, "required": list(props)}}

print(json.dumps(make_spec(get_order_status), indent=2))
Output (run to check)
{
  "name": "get_order_status",
  "description": "Look up the shipping status of an order from its id.",
  "input_schema": {
    "type": "object",
    "properties": {
      "order_id": {
        "type": "string"
      }
    },
    "required": [
      "order_id"
    ]
  }
}

The model never sees your code. It sees only this description, so the description is the tool as far as the model is concerned. A vague sentence means the wrong tool gets picked:

Python
# why tool descriptions matter: the model chooses by reading them
tools = {
    "get_order_status": "look up the shipping status of an order from its id",
    "search_policies": "find passages in refund and returns policy documents",
}

def pick(question):
    words = set(question.lower().split())
    scores = {name: len(words & set(desc.split())) for name, desc in tools.items()}
    return max(scores, key=scores.get), scores

for q in ["what is the status of my order", "find the refund policy passages"]:
    print(q, "->", pick(q)[0])
Output (run to check)
what is the status of my order -> get_order_status
find the refund policy passages -> search_policies

This toy picks by word overlap, where a real model reads meaning. The lesson carries over: write each description for a reader who has never seen your system.

4The loop by hand

Twenty lines on a model API.

The lowest level is to run the loop yourself on a model API. The shape below follows Anthropic's documentation, and it is not run here because it needs an API key.

Shape from the docs, not run here
tools = [ ... ]            # descriptions like the one above
messages = [{"role": "user", "content": question}]
response = client.messages.create(model=MODEL_ID_FROM_THE_DOCS, tools=tools, messages=messages)

while response.stop_reason == "tool_use":            # the model asked for a tool
    results = []
    for block in response.content:
        if block.type == "tool_use":                 # name, id and input arguments
            output = run_tool(block.name, block.input)
            results.append({"type": "tool_result", "tool_use_id": block.id, "content": output})
    messages.append({"role": "assistant", "content": response.content})
    messages.append({"role": "user", "content": results})
    response = client.messages.create(model=MODEL_ID_FROM_THE_DOCS, tools=tools, messages=messages)

# stop_reason == "end_turn": response holds the final answer

Two details matter. The result must carry the tool_use_id of the request it answers. And the whole history goes back each time, because the model keeps nothing between calls (see conversation state).

Add a step cap. This loop ends only when the model stops asking for tools. Count iterations and stop at a limit.

5Where the options sit

Four levels of packaging.

LevelExamplesYou ownGood when
Your own loop on a model APIClaude Messages API tool use, OpenAI Responses APIEverything: loop, state, limitsLearning, or you want full control
Vendor agent kitClaude Agent SDK, OpenAI Agents SDKYour tools and prompts; the loop is providedYou want built-in loop, tracing and handoffs
FrameworkLangGraph (a graph of steps sharing state), LlamaIndex FunctionAgent and AgentWorkflowGraph or workflow designBranching, retries, human approval, several agents
Open-weight modelsModels run through a runtime such as OllamaHosting, plus checking tool supportYou need to run it yourself or keep data in-house

Tool calling on open-weight models depends on the model and the runtime, so check the model's own page before you assume it works.

6What is out of date

Names to avoid in new work.

Name you may meetStatusWhat to do
OpenAI Assistants APIShut down 26 Aug 2026Use the Responses API, which OpenAI names as its recommended path
LlamaIndex standalone OpenAIAgent and ReActAgent classes (2023-era courses)SupersededThe current LlamaIndex guide builds agents with FunctionAgent and AgentWorkflow
"Data agent"Old termLlamaIndex's early name for an agent whose tools fetch data. It is just an agent
Net read: the loop and the tool description have not changed. The wrappers around them change often. Check dates on any agent tutorial, including this one.

7How to decide

A sensible order.

  1. Learn on your own loop. It is about twenty lines and you see everything.
  2. Move to a vendor kit when you are rewriting the same plumbing: tracing, retries, handoffs between agents.
  3. Reach for a framework when the path branches or needs a human to approve a step.
Good habit: keep your tool functions plain and separate from any framework. They then move with you when the framework changes.
Risk: an agent that can act can also act wrongly. Limit what each tool may touch, cap steps and spend, and ask a human before anything hard to undo.

8Check yourself

Short questions and one line to remember.

What four parts does every agent stack have?

A model, tools, a loop that runs them and feeds results back, and state that carries information forward.

What does the model actually see of a tool?

Only its name, description and input schema. Never the code.

Why did the Assistants API matter to this topic?

It was a hosted agent-style API. It shut down on 26 August 2026, and OpenAI points to the Responses API instead.

Try it: run the tool description snippet on a function of your own. Then reword its docstring badly and see how the description changes. That one sentence is what decides whether a model picks your tool.
One line to remember: "Every agent stack is a model, tools, a loop and state, so learn those and the product names stop mattering."
Sources: Anthropic tool-using agent tutorial; OpenAI Assistants API deprecation notice; LlamaIndex agent guide. Product names and APIs change quickly, so check the current docs before building. Independent notes, not affiliated with or endorsed by any company or course named here. Examples and wording are my own.