The same agent, written five ways

Every agent needs a model, instructions, and an input and output contract; tools, memory, and a coordination flow are optional; guardrails and evaluations are what production adds. A framework moves each of those decisions into code, configuration, or Markdown rather than removing it.

Map an agent from design to implementation

Most agent systems make the same core decisions. Frameworks differ in how those decisions are expressed and which runtime features they provide.

Pick a framework to see an illustrative implementation shape. Core parts are required for a runnable agent. Optional parts depend on the job. Production controls become important when the agent can affect real systems or people.
Framework

Python · You write Python. Pure Python with types. You define the agent and its tools as typed Python functions.

The same agent in Pydantic AIillustrative shape, not a full program
from pydantic_ai import Agent, RunContext
from pydantic import BaseModel

class Deps(BaseModel):            # ← inputs (typed)
    user_goal: str

agent = Agent(
    "openai:gpt-4o",             # ← model & provider
    deps_type=Deps,
    system_prompt="You are…",    # ← system prompt
)

@agent.tool                      # ← tools: YOU WRITE PYTHON
def read_context(ctx: RunContext[Deps], q: str) -> str:
    return load_context(q)       #   your Python here

result = agent.run_sync("…", deps=Deps(user_goal="…"))
Defined asPythonJavaScriptConfigMarkdown
Model & provider corePython · one arg

The model that interprets the request and produces the next response or action.

Goes in A model identifier, provider, and generation settings.

System instructions corePython · string

The role, authority, constraints, and completion criteria.

Goes in Plain-language instructions that state what the agent may do and when the job is complete.

Tools & skills optionalPython · @agent.tool fn

Callable functions or loadable instructions that let the model act beyond text generation.

Goes in A distinct name, input schema, output schema, permissions, and error behavior for each tool.

Inputs & outputs corePython · Pydantic model

The data contract the agent receives and returns.

Goes in Named and typed inputs and outputs, plus required evidence or error states.

Memory optionalPython · deps / context

Working, session, or persistent information that can be recalled later.

Goes in Memory scope, retention rules, storage, retrieval policy, and user controls.

Guardrails & permissions productionPython · validators

Controls that bound authority and require approval for sensitive effects.

Goes in A permission tier per tool, denied actions, validation gates, and human approval points.

Coordination flow optionalPython · code flow

The sequence or graph that connects model calls, tools, agents, and decisions.

Goes in Nodes, transitions, stop conditions, retry limits, and state passed between steps.

Evaluations productionPython · pytest

Repeatable cases that measure whether the system meets its contract.

Goes in Inputs, expected outputs or scoring rules, thresholds, and regression cases.