2 Creating and running a single agent
This chapter covers
- Setting up CrewAI
- Building your first agent
- Tool access and structured outputs
- The agent execution loop
Every agentic system starts with a single augmented LLM: a language model enhanced with retrieval, tools, and memory. In CrewAI, that building block is the agent. Agents can be used inside both crews (an ensemble of specialized agents collaborating on a set of tasks) and flows (deterministic workflows that follow a specific order). Their identity and behavior are shaped by three narrative pillars: the role, goal, & backstory.
An agent can access various tools to achieve its goals and has numerous configuration options to run in any way possible. In this chapter, we’re building a complete and stand-alone project, a market researcher agent that can explore market opportunities, access tools to search the web, scrape the content from websites, and present its findings in a structured form to the user. This way, it could easily be integrated into existing software systems in a company.