CrewAICrewAI 1.15 · Python 3.10 to 3.13
Dashboard
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
35 small wins to finish your pathNext lesson →

A support desk in plain Python

The support desk is a program that reads a customer message, finds the order and writes a reply; here it is two plain Python functions, before any agent.

Last updated: 28 Sep, 2026 · CrewAI 1.15

With CrewAI installed, start from the desk as plain Python. Seeing it this way shows what the framework changes later and what it keeps.

The shop keeps its orders in a dictionary. A customer writes a message, and two workers deal with it: a clerk who finds the order, and a writer who answers the customer.

The order book and two workers

python
ORDERS = {"A17": "shipped on 3 March", "C40": "waiting for stock"}


def look_up(message):
    for word in message.replace("?", "").split():
        if word in ORDERS:
            return f"{word} {ORDERS[word]}."
    return "I could not find that order."


def write_reply(finding):
    return f"Dear customer, {finding}"

look_up scans the message for an order id it knows. write_reply turns what the clerk found into a sentence for the customer. The writer never sees the message, only the clerk's finding.

Running the two functions

Example
print(write_reply(look_up("Where is my order A17?")))
Example
print(write_reply(look_up("Where is my order B22?")))

Reading the two replies

  • A17 is in the order book, so look_up returns its status and write_reply wraps it for the customer.
  • B22 is not, so the desk says it cannot find the order rather than guess one.

Where plain rules fall short

Each worker follows exact rules. A message that says "order a17" in lower case, or asks two questions at once, falls through them. The shop also has a rule the code has no place for: a refund needs a manager's approval.

CrewAI keeps the same shape. Each worker becomes an agent with a role, and each job becomes a task; a model reads the words and decides, where this code matches strings. The clerk's dictionary lookup survives as a tool in the tools lesson, and the refund rule arrives in the tool-hooks lesson.

ConcernPlain functionsA CrewAI crew
Decidingmatch a string exactlya model reads the words
New phrasingfalls through the rulesthe model still answers
The refund ruleno place for ita hook, in the tool-hooks lesson

When plain functions are enough

  • The input is fixed and well formed, such as an order id from a form.
  • No judgement is needed; a lookup or a calculation is the whole job.
  • You want the same output every time, with no model in the loop.
Watch out
look_up matches an exact id, so "a17" in lower case falls straight through it. Reading words like that is the change an agent makes, starting in the first-crew lesson.
Try it yourself
  • Call look_up("where is order a17?") and read why it fails.
  • Add B22 to ORDERS with any status and run the second example again.
  • Make write_reply add a closing line and print both replies again.

You understood something today that you didn't yesterday.