Prev Next

AI / CrewAI Interview Questions

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

@tool decoratorSubclassing BaseTool
Quick way to turn a plain function into a usable toolMore explicit, structured class-based approach
Minimal boilerplate for simple toolsBetter suited for tools needing more complex internal state or logic
Good fit for straightforward, single-purpose utilitiesGood fit for tools that need finer control over validation or behavior

Both approaches produce a tool an agent can call, the choice mainly comes down to how much structure and control a given tool actually needs, a decorator for something simple, a full class for something with more moving parts.

Which approach is quicker for a simple, single-purpose tool?
Which approach better suits tools needing complex internal state?

Invest now in Acorns!!! 🚀 Join Acorns and get your $5 bonus!
Acorns Logo

Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!

Earn passively and while sleeping

Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.

Robinhood Logo

Invest now!!! Get Free equity stock (US, UK only)!

Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.

The Robinhood app makes it easy to trade stocks, crypto and more.


Webull Logo

Webull! Receive free stock by signing up using the link: Webull signup.

More Related questions...

What is CrewAI? What are the four core primitives in CrewAI's mental model? What is an Agent in CrewAI? What is a Task in CrewAI? What is a Crew in CrewAI? What is a Tool in CrewAI? What is a Flow in CrewAI? What are the Process types supported by CrewAI? Define the Sequential process in CrewAI? Define the Hierarchical process in CrewAI? What is the TaskOutput class in CrewAI? What are the memory types supported by CrewAI? What is Short-Term Memory in CrewAI? What is Long-Term Memory in CrewAI? What is Entity Memory in CrewAI? What is External Memory in CrewAI? Describe the role, goal, and backstory properties of a CrewAI Agent? What is the @CrewBase decorator used for? What are the @agent, @task, and @crew annotations? What is YAML configuration used for in a CrewAI project? What is the @start decorator in CrewAI Flows? What is the @listen decorator in CrewAI Flows? What is the @router decorator in CrewAI Flows? What is the @persist decorator in CrewAI Flows? What is the @human_feedback decorator in CrewAI Flows? Define Flow state in CrewAI? What built-in tools does CrewAI provide? What is allow_delegation in a CrewAI Agent? How do you kick off a Crew? What is the difference between a Crew and a Flow in CrewAI? What is the difference between the Sequential and Hierarchical processes? How does context passing work between dependent Tasks in CrewAI? Why does CrewAI recommend YAML configuration over direct instantiation for new projects? What is the difference between structured and unstructured Flow state? How do the or_ and and_ logical operators work with @listen and @router? Why does LongTermMemory not use an embedder configuration? What is the difference between building a custom tool with @tool vs subclassing BaseTool? How does the Hierarchical process assign tasks without an explicitly named agent? Why would you choose CrewAI over LangGraph for a given project? How does the @persist decorator enable state recovery across Flow executions? What is the difference between memory=True and providing explicit memory instances? Why is bounded delegation considered a guardrail in CrewAI systems? How does the @human_feedback decorator support approval workflows? What is the difference between a Crew's kickoff() and kickoff_async()? Why does CrewAI pair well with observability tools like AgentOps or LangFuse? Explain the lifecycle of a Task's execution from assignment to TaskOutput? Explain the execution flow of a CrewAI Flow using @start, @listen, and @router together? Explain the internal working of the Hierarchical process's manager agent? How can you optimize a CrewAI Crew to reduce iteration loops and cost overruns? How do you troubleshoot a Crew stuck in a delegation loop between agents?
Show more question and Answers...

CrewAI Interview Questions II

Comments & Discussions