Skip to content
Agent

Agents

by vrothenberg

AI Summary

A comprehensive guide for creating and managing autonomous agents in the CrewAI framework, enabling developers to build specialized AI agents with defined roles, capabilities, and collaboration features.

Install

Copy this and paste it into Claude Code, Cursor, or any AI assistant:

I want to set up the "Agents" agent in my project.

Please run this command in my terminal:
# Add AGENTS.md to your project root
curl --retry 3 --retry-delay 2 --retry-all-errors -o AGENTS.md "https://raw.githubusercontent.com/vrothenberg/CrewKB/master/docs/crewai/3_core_concepts/1_agents.md"

Then explain what the agent does and how to invoke it.

Description

> Detailed guide on creating and managing agents within the CrewAI framework.

Overview of an Agent

In the CrewAI framework, an Agent is an autonomous unit that can: • Perform specific tasks • Make decisions based on its role and goal • Use tools to accomplish objectives • Communicate and collaborate with other agents • Maintain memory of interactions • Delegate tasks when allowed <Tip> Think of an agent as a specialized team member with specific skills, expertise, and responsibilities. For example, a Researcher agent might excel at gathering and analyzing information, while a Writer agent might be better at creating content. </Tip> <Note type="info" title="Enterprise Enhancement: Visual Agent Builder"> CrewAI Enterprise includes a Visual Agent Builder that simplifies agent creation and configuration without writing code. Design your agents visually and test them in real-time. !Visual Agent Builder Screenshot The Visual Agent Builder enables: • Intuitive agent configuration with form-based interfaces • Real-time testing and validation • Template library with pre-configured agent types • Easy customization of agent attributes and behaviors </Note>

Agents

> Detailed guide on creating and managing agents within the CrewAI framework.

Agent Attributes

| Attribute | Parameter | Type | Description | | :-------------------------------------- | :----------------------- | :------------------------------------ | :------------------------------------------------------------------------------------------------------- | | Role | role | str | Defines the agent's function and expertise within the crew. | | Goal | goal | str | The individual objective that guides the agent's decision-making. | | Backstory | backstory | str | Provides context and personality to the agent, enriching interactions. | | LLM (optional) | llm | Union[str, LLM, Any] | Language model that powers the agent. Defaults to the model specified in OPENAI_MODEL_NAME or "gpt-4". | | Tools (optional) | tools | List[BaseTool] | Capabilities or functions available to the agent. Defaults to an empty list. | | Function Calling LLM (optional) | function_calling_llm | Optional[Any] | Language model for tool calling, overrides crew's LLM if specified. | | Max Iterations (optional) | max_iter | int | Maximum iterations before the agent must provide its best answer. Default is 20. | | Max RPM (optional) | max_rpm | Optional[int] | Maximum requests per minute to avoid rate limits. | | Max Execution Time (optional) | max_execution_time | Optional[int] | Maximum time (in seconds) for task execution. | | Memory (optional) | memory | bool | Whether the agent should maintain memory of interactions. Default is True. | | Verbose (optional) | verbose | bool | Enable detailed execution logs for debugging. Default is False. | | Allow Delegation (optional) | allow_delegation | bool | Allow the agent to delegate tasks to other agents. Default is False. | | Step Callback (optional) | step_callback | Optional[Any] | Function called after each agent step, overrides crew callback. | | Cache (optional) | cache | bool | Enable caching for tool usage. Default is True. | | System Template (optional) | system_template | Optional[str] | Custom system prompt template for the agent. | | Prompt Template (optional) | prompt_template | Optional[str] | Custom prompt template for the agent. | | Response Template (optional) | response_template | Optional[str] | Custom response template for the agent. | | Allow Code Execution (optional) | allow_code_execution | Optional[bool] | Enable code execution for the agent. Default is False. | | Max Retry Limit (optional) | max_retry_limit | int | Maximum number of retries when an error occurs. Default is 2. | | Respect Context Window (optional) | respect_context_window | bool | Keep messages under context window size by summarizing. Default is True. | | Code Execution Mode (optional) | code_execution_mode | Literal["safe", "unsafe"] | Mode for code execution: 'safe' (using Docker) or 'unsafe' (direct). Default is 'safe'. | | Embedder (optional) | embedder | Optional[Dict[str, Any]] | Configuration for the embedder used by the agent. | | Knowledge Sources (optional) | knowledge_sources | Optional[List[BaseKnowledgeSource]] | Knowledge sources available to the agent. | | Use System Prompt (optional) | use_system_prompt | Optional[bool] | Whether to use system prompt (for o1 model support). Default is True. |

Creating Agents

There are two ways to create agents in CrewAI: using YAML configuration (recommended) or defining them directly in code.

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted 11mo ago
Stale
AdoptionUnder 100 stars
0 ★ · Niche
DocsMissing or thin
Undocumented

GitHub Signals

Issues0
Updated11mo ago
View on GitHub
MIT License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Claude Code
Claude.ai