Course Content
CrewAI Multi-Agents
9 sections · 53 lessons
How do roles, goals, and backstories influence agent behavior?
What you need to know
What each field does
role— a job title, not a sentence: "Technical Editor", "B2B Account Researcher". It frames the model's expertise, and it is the address used by the delegation tools.goal— what success looks like for this agent in every task. A vague goal ("write good content") gives vague, long output; a specific goal ("cut drafts to under 400 words without losing any claim") gives focused output.backstory— the context that shapes judgement: experience, standards, what it must never do.
Weak vs strong
Weak
- role: "Writer"
- goal: "Write good content"
- backstory: "You are a creative and passionate writer who loves words and always does amazing work."
Strong
- role: "Technical Editor"
- goal: "Cut each draft to under 400 words without losing any claim or citation"
- backstory: "You edit developer docs. You never add facts that are not in the source."
The strong version gives the model a job, a measurable target and a hard rule. The weak version only adds adjectives, which change tone but not behaviour.
Placeholders and YAML
Fields can include {placeholders} filled at kickoff(inputs=...), so the same agent can be "Senior {industry} Analyst" for different clients. In a project made with crewai create crew --classic, they live in config/agents.yaml:
1editor:2 role: >3 {brand} Content Editor4 goal: >5 Make every draft accurate, on-brand and under {word_limit} words6 backstory: >7 You have edited for {brand} for five years. You check every8 fact against the research notes and never add new claims.Why short matters
These fields are sent with every LLM call the agent makes. An agent that takes 8 steps on a task sends its backstory 8 times. A 600-word backstory across three agents and 25 steps is thousands of wasted tokens per run, and the important rule gets lost among flattering words.
A real-life example
A content team crew (researcher, writer, editor) writes posts for a fintech brand. The editor's first backstory was "You are a world-class editor with a passion for excellence". Across 30 test posts, the editor added new statistics in 9 of them — some invented.
The team rewrote it:
- goal: "Return the draft with factual errors fixed and tone matched to the style guide; change nothing else"
- backstory: "You check every number against the research notes. If a number is not in the notes, you remove it and say so."
On the same 30 posts, invented additions dropped to 1. Nothing else in the crew changed. The interview point: persona text is an instruction, so write it like one.
Follow-up questions to expect
- "Where should output format rules go — backstory or task?" — In the task's
expected_output, enforced withoutput_pydanticor a guardrail. The backstory is for standing behaviour. - "Does the role name matter technically?" — Yes: delegation matches on the role string, and it appears in logs, so keep roles short and distinct.
- "Should the backstory be written in second person?" — It is a common and clear style ("You check every fact..."), but the content matters much more than the grammar.