Prev Next

AI / CrewAI Interview Questions

1. What is CrewAI? 2. What are the four core primitives in CrewAI's mental model? 3. What is an Agent in CrewAI? 4. What is a Task in CrewAI? 5. What is a Crew in CrewAI? 6. What is a Tool in CrewAI? 7. What is a Flow in CrewAI? 8. What are the Process types supported by CrewAI? 9. Define the Sequential process in CrewAI? 10. Define the Hierarchical process in CrewAI? 11. What is the TaskOutput class in CrewAI? 12. What are the memory types supported by CrewAI? 13. What is Short-Term Memory in CrewAI? 14. What is Long-Term Memory in CrewAI? 15. What is Entity Memory in CrewAI? 16. What is External Memory in CrewAI? 17. Describe the role, goal, and backstory properties of a CrewAI Agent? 18. What is the @CrewBase decorator used for? 19. What are the @agent, @task, and @crew annotations? 20. What is YAML configuration used for in a CrewAI project? 21. What is the @start decorator in CrewAI Flows? 22. What is the @listen decorator in CrewAI Flows? 23. What is the @router decorator in CrewAI Flows? 24. What is the @persist decorator in CrewAI Flows? 25. What is the @human_feedback decorator in CrewAI Flows? 26. Define Flow state in CrewAI? 27. What built-in tools does CrewAI provide? 28. What is allow_delegation in a CrewAI Agent? 29. How do you kick off a Crew? 30. What is the difference between a Crew and a Flow in CrewAI? 31. What is the difference between the Sequential and Hierarchical processes? 32. How does context passing work between dependent Tasks in CrewAI? 33. Why does CrewAI recommend YAML configuration over direct instantiation for new projects? 34. What is the difference between structured and unstructured Flow state? 35. How do the or_ and and_ logical operators work with @listen and @router? 36. Why does LongTermMemory not use an embedder configuration? 37. What is the difference between building a custom tool with @tool vs subclassing BaseTool? 38. How does the Hierarchical process assign tasks without an explicitly named agent? 39. Why would you choose CrewAI over LangGraph for a given project? 40. How does the @persist decorator enable state recovery across Flow executions? 41. What is the difference between memory=True and providing explicit memory instances? 42. Why is bounded delegation considered a guardrail in CrewAI systems? 43. How does the @human_feedback decorator support approval workflows? 44. What is the difference between a Crew's kickoff() and kickoff_async()? 45. Why does CrewAI pair well with observability tools like AgentOps or LangFuse? 46. Explain the lifecycle of a Task's execution from assignment to TaskOutput? 47. Explain the execution flow of a CrewAI Flow using @start, @listen, and @router together? 48. Explain the internal working of the Hierarchical process's manager agent? 49. How can you optimize a CrewAI Crew to reduce iteration loops and cost overruns? 50. How do you troubleshoot a Crew stuck in a delegation loop between agents?

1. What is CrewAI?

CrewAI is an open-source Python framework for orchestrating role-playing, autonomous AI agents that collaborate as a team, or crew, to complete complex tasks. It's built independently from scratch rather than as a layer on top of LangChain or other agent libraries, giving it a lightweight footpri...

Read full answer

2. What are the four core primitives in CrewAI's mental model?

CrewAI's mental model is built around a small, consistent set of four primitives. Primitive Role Agent An autonomous entity with a role, goal, and backstory that performs work Task A specific assignment with a description, expected output, and an assigned agent Tool An extension that gives an age...

Read full answer

3. What is an Agent in CrewAI?

An Agent in CrewAI is an autonomous entity with a defined role, goal, and backstory, built to perceive its environment, make decisions, and take actions toward a specific objective. Role : describes what the agent does, like Senior Research Analyst Goal : describes what the agent is optimizing fo...

Read full answer

4. What is a Task in CrewAI?

A Task in CrewAI is a specific assignment completed by an agent, encapsulating everything needed for execution, a description, the responsible agent, any required tools, and the expected output. Can be directly assigned to a named agent, or left for the Hierarchical process's manager to assign dy...

Read full answer

5. What is a Crew in CrewAI?

A Crew is a structured group of agents and tasks that work together to complete a process, coordinating execution the way a team of specialists collaborates on a shared project. Instantiated with a list of agents, a list of tasks, and a process type The Crew's process determines how tasks get dis...

Read full answer

6. What is a Tool in CrewAI?

A Tool in CrewAI is an extension that gives an agent an additional capability beyond generating text, such as searching the web, scraping a website, or reading a file. CrewAI ships with a rich set of built-in tools, including SerperDevTool for web search, ScrapeWebsiteTool, and FileReadTool Custo...

Read full answer

7. What is a Flow in CrewAI?

A Flow is CrewAI's mechanism for event-driven, production-ready orchestration, giving developers precise control over complex automations that go beyond what a single Crew's own process handles. Built from Python methods decorated with @start, @listen, and @router Manages structured state that pe...

Read full answer

8. What are the Process types supported by CrewAI?

The process type governs how a crew's tasks get distributed and executed. Process Description Sequential Runs tasks strictly in the order they were defined, each agent completing its task before the next begins Hierarchical Automatically assigns a manager to the crew, which coordinates planning, ...

Read full answer

9. Define the Sequential process in CrewAI?

The Sequential process runs a crew's tasks strictly in the order they were defined, similar to a straightforward, linear team workflow. Each task completes before the next one starts An earlier task's output can be passed as context into a later task Simpler to reason about than Hierarchical, sin...

Read full answer

10. Define the Hierarchical process in CrewAI?

The Hierarchical process automatically assigns a manager to the crew, coordinating the planning, delegation, and validation of task results across the other agents, rather than running tasks in a fixed sequence. The manager can assign tasks dynamically based on an agent's role and availability, r...

Read full answer

11. What is the TaskOutput class in CrewAI?

TaskOutput is the structured class that encapsulates the result of a completed Task in CrewAI, giving a consistent way to access what an agent produced. Provides the result as raw text by default Can also expose the result as JSON or as a validated Pydantic model, when the task specifies an outpu...

Read full answer

12. What are the memory types supported by CrewAI?

CrewAI provides four memory types that can be configured at the crew level, each serving a different purpose. Memory type Purpose Short-Term Memory (STM) Retains context within a single execution Long-Term Memory (LTM) Persists information across separate runs Entity Memory Tracks specific entiti...

Read full answer

13. What is Short-Term Memory in CrewAI?

Short-Term Memory retains context within a single crew execution, letting agents recall what happened earlier in the same run without needing it repeated. Uses the crew's embedder configuration to store recent interactions as vector embeddings Scoped to just the current execution, it doesn't pers...

Read full answer

14. What is Long-Term Memory in CrewAI?

Long-Term Memory persists information across separate crew runs, letting agents carry forward lessons or facts learned in one execution into future ones. Unlike Short-Term and Entity memory, Long-Term Memory does not use an embedder, so it isn't configured with embedding settings Automatically in...

Read full answer

15. What is Entity Memory in CrewAI?

Entity Memory tracks specific entities, like people, places, or concepts mentioned in a crew's work, along with their attributes, across the course of an execution. Uses the crew's embedder configuration to store and retrieve entity information as embeddings Lets agents keep facts about a specifi...

Read full answer

16. What is External Memory in CrewAI?

External Memory lets a crew connect to a memory storage backend outside CrewAI's default configuration, rather than relying purely on the automatically initialized Short-Term, Long-Term, and Entity memory instances. Useful for teams that already have an established memory or knowledge infrastruct...

Read full answer

17. Describe the role, goal, and backstory properties of a CrewAI Agent?

Every CrewAI Agent is defined with three core descriptive properties that shape how it behaves during execution. Property Purpose Role Defines what the agent does, such as Senior Research Analyst Goal Defines what the agent is optimizing for while completing its tasks Backstory Provides context t...

Read full answer

18. What is the @CrewBase decorator used for?

The @CrewBase decorator provides a declarative, class-based way to define a crew's structure in Python, working alongside YAML configuration files for agents and tasks. Lets a project keep agent and task definitions in clean, maintainable YAML files Paired with @agent, @task, and @crew method ann...

Read full answer

19. What are the @agent, @task, and @crew annotations?

These three method annotations are used inside an @CrewBase-decorated class to declare a crew's building blocks in Python while still drawing their configuration from YAML. @agent : marks a method that returns a configured Agent instance @task : marks a method that returns a configured Task insta...

Read full answer

20. What is YAML configuration used for in a CrewAI project?

YAML configuration lets developers define agents and tasks declaratively in separate configuration files, rather than hardcoding every property directly in Python. Keeps role, goal, backstory, and task descriptions readable and easy to iterate on quickly Recommended by CrewAI's own documentation ...

Read full answer

21. What is the @start decorator in CrewAI Flows?

The @start decorator marks a method as an entry point for a Flow, defining where execution begins. A Flow can have multiple methods decorated with @start All satisfied @start methods execute, often in parallel, when the Flow runs Can accept a callable condition to control exactly when a given sta...

Read full answer

22. What is the @listen decorator in CrewAI Flows?

The @listen decorator marks a method as a listener that runs automatically once a specified earlier method in the Flow completes. Can listen to a method by name, passed as a string, or by referencing the method directly Can listen to multiple methods at once, combined using logical operators like...

Read full answer

23. What is the @router decorator in CrewAI Flows?

The @router decorator marks a method used for conditional routing, letting a Flow branch down different paths depending on the output of a previous step. Evaluates a condition and determines which subsequent path the Flow should follow Can be combined with logical operators like and_ or or_ for m...

Read full answer

24. What is the @persist decorator in CrewAI Flows?

The @persist decorator applied to a Flow class enables automatic state recovery, saving a Flow's state so it can resume rather than restart from scratch if interrupted. Uses SQLite by default, which works well for single-instance deployments Can be configured to use PostgreSQL for multi-instance ...

Read full answer

25. What is the @human_feedback decorator in CrewAI Flows?

The @human_feedback decorator pauses a Flow's execution at a specific point and waits for human input before continuing. Keeps the Flow's state persisted while waiting, rather than losing progress during the pause Supports approval workflows, quality review gates, and exception handling that requ...

Read full answer

26. Define Flow state in CrewAI?

Flow state is the data that persists throughout a Flow's execution, letting different methods share and build on information as the workflow progresses. Can be unstructured, stored as a plain dictionary, for quick and flexible use Can be structured, using Pydantic models, for type safety, schema ...

Read full answer

27. What built-in tools does CrewAI provide?

CrewAI ships with a rich ecosystem of ready-to-use tools that give agents common capabilities without needing to build them from scratch. SerperDevTool : performs web searches ScrapeWebsiteTool : extracts content from a webpage FileReadTool : reads content from local files Many additional tools c...

Read full answer

28. What is allow_delegation in a CrewAI Agent?

allow_delegation is an agent-level setting that controls whether an agent is permitted to hand off part of its work to another agent rather than handling everything itself. When enabled, an agent that decides it needs another specialist's help can trigger the creation of a sub-task for that agent...

Read full answer

29. How do you kick off a Crew?

Running a Crew's workflow starts by calling its kickoff() method, which executes all defined tasks according to the crew's process and returns the final result. CrewAI executes the tasks in the order or structure defined by the process, sequential or hierarchical Passes context between agents and...

Read full answer

30. What is the difference between a Crew and a Flow in CrewAI?

Crew Flow Enables natural, autonomous collaboration between agents Provides event-driven, precise control over execution Best for tasks needing flexible, dynamic decision-making Best for managing detailed execution paths and state Coordinated through a Process, sequential or hierarchical Coordina...

Read full answer

31. What is the difference between the Sequential and Hierarchical processes?

Sequential Hierarchical Runs tasks strictly in the order defined A manager agent dynamically assigns and coordinates tasks Every task typically names its agent upfront Tasks can be assigned based on role and availability at runtime No built-in validation step between tasks Manager validates resul...

Read full answer

32. How does context passing work between dependent Tasks in CrewAI?

When one task's output is needed by a later task, CrewAI lets that later task reference the earlier one so its structured TaskOutput becomes part of the later task's input context. Because TaskOutput can expose results as raw text, JSON, or a Pydantic model, dependent tasks can consume structured...

Read full answer

33. Why does CrewAI recommend YAML configuration over direct instantiation for new projects?

YAML configuration separates the description of agents and tasks, their roles, goals, and expected outputs, from the orchestration logic that assembles and runs them. Makes it fast to iterate on wording, personas, and task descriptions without touching Python code Keeps configuration readable for...

Read full answer

34. What is the difference between structured and unstructured Flow state?

Unstructured state Structured state Stored as a plain dictionary Stored using a Pydantic model More flexible, quicker to set up Provides type safety and schema validation No compile-time guarantee about what keys exist Supports autocompletion and clearer contracts between methods Better suited to...

Read full answer

35. How do the or_ and and_ logical operators work with @listen and @router?

CrewAI Flows support combining multiple trigger conditions using logical operators, letting a single method respond to more complex combinations of prior events. or_ : triggers the listening method when any of the specified conditions are met and_ : triggers the listening method only when all of ...

Read full answer

36. Why does LongTermMemory not use an embedder configuration?

Short-Term Memory and Entity Memory both rely on embeddings to support semantic similarity search over recent or entity-specific information, which is why they accept an embedder configuration. Long-Term Memory is designed around persisting information across runs rather than semantic retrieval w...

Read full answer

37. What is the difference between building a custom tool with @tool vs subclassing BaseTool?

@tool decorator Subclassing BaseTool Quick way to turn a plain function into a usable tool More explicit, structured class-based approach Minimal boilerplate for simple tools Better suited for tools needing more complex internal state or logic Good fit for straightforward, single-purpose utilitie...

Read full answer

38. How does the Hierarchical process assign tasks without an explicitly named agent?

In the Hierarchical process, CrewAI automatically assigns a manager to the crew whose job is to coordinate planning, delegation, and validation across the other agents. Rather than requiring every task to specify its agent upfront, the manager can decide which agent should handle a task based on ...

Read full answer

39. Why would you choose CrewAI over LangGraph for a given project?

CrewAI and LangGraph both support building multi-agent systems, but they sit at different points on the abstraction spectrum. CrewAI is more opinionated, offering clear, ready-made abstractions, agents, tasks, crews, that map naturally onto how teams already think about work LangGraph is lower-le...

Read full answer

40. How does the @persist decorator enable state recovery across Flow executions?

Without persistence, an interrupted Flow, whether from a crash, a restart, or a long-running pause, would simply lose all of its accumulated state and have to start from the beginning. @persist saves the Flow's state, including its unique identifier and any stored data, to a backing store as exec...

Read full answer

41. What is the difference between memory=True and providing explicit memory instances?

memory=True Explicit memory instances Automatically initializes default Short-Term, Long-Term, and Entity memory Developer manually constructs and configures specific memory instances Uses the crew's shared embedder configuration for supported memory types Allows different storage backends or set...

Read full answer

42. Why is bounded delegation considered a guardrail in CrewAI systems?

Delegation lets an agent hand off work to a specialist, which is powerful, but unbounded delegation risks agents endlessly creating sub-tasks for each other without ever converging on a final result. Bounding delegation, limiting how many times or how deep an agent can hand off work, prevents thi...

Read full answer

43. How does the @human_feedback decorator support approval workflows?

The @human_feedback decorator pauses a Flow at a specific point, holding its state until a person provides input, rather than letting execution continue purely on the model's own judgment. Because the Flow's state persists during the pause, no progress is lost while waiting for a response Support...

Read full answer

44. What is the difference between a Crew's kickoff() and kickoff_async()?

Both methods start a crew's execution and return its final result, the difference is purely about whether that execution blocks the calling code while it runs. kickoff() : runs synchronously, blocking further code from executing until the crew finishes kickoff_async() : runs asynchronously, letti...

Read full answer

45. Why does CrewAI pair well with observability tools like AgentOps or LangFuse?

Multi-agent systems can be hard to debug purely from their final output, since a wrong result could stem from a bad tool call, a misassigned task, or a flawed delegation several steps earlier. Observability tools capture traces of what each agent did, which tools it called, and how tasks were del...

Read full answer

46. Explain the lifecycle of a Task's execution from assignment to TaskOutput?

flowchart LR A[Task Defined: description, expected_output, agent/tools] --> B[Assigned to Agent: explicit or manager-delegated] B --> C[Agent Executes using Tools] C --> D[Result Produced] D --> E[Wrapped in TaskOutput: raw/JSON/Pydantic] E --> F[Passed as Context to Dependent Tasks] Definition :...

Read full answer

47. Explain the execution flow of a CrewAI Flow using @start, @listen, and @router together?

sequenceDiagram participant S as Start Method participant L as Listener participant R as Router participant D as Downstream Listener S->>L: Start method completes, listener triggered L->>R: Listener output evaluated by router R->>D: Router selects a branch, downstream listener reacts One or more ...

Read full answer

48. Explain the internal working of the Hierarchical process's manager agent?

flowchart TD A[Task Received] --> B[Manager Evaluates Agent Roles and Availability] B --> C[Task Assigned to Best-Fit Agent] C --> D[Agent Executes, may request Delegation] D --> E[Manager Validates Result] E -->|Accepted| F[Task Complete] E -->|Rejected| C When a task enters the crew, the manage...

Read full answer

49. How can you optimize a CrewAI Crew to reduce iteration loops and cost overruns?

Write precise task descriptions and expected outputs , since vague specifications are a common cause of an agent looping or producing unusable results that trigger re-work Set explicit iteration limits so an agent or delegation chain can't loop indefinitely on a task it's struggling with Bound de...

Read full answer

50. How do you troubleshoot a Crew stuck in a delegation loop between agents?

Check whether allow_delegation is enabled on agents that don't actually need to hand off work, since unnecessary delegation is a common source of loops Review the task descriptions and expected outputs for ambiguity, since an unclear specification can lead an agent to keep deciding it needs more ...

Read full answer

«
»

Comments & Discussions