Skip to content

CrewAI Agent

CrewAI Agent is a component that lets you build a virtual helper inside Nappai.
You give it a name, a purpose, and a set of tools, and it will use a language model to think, plan, and act on your behalf.

How it Works

When you drop the CrewAI Agent into your dashboard, the component takes the information you provide and creates an Agent object from the CrewAI library.
The agent is configured with:

  • Role – what the agent is called (e.g., “Data Analyst”).
  • Goal – the main task it should achieve (e.g., “Summarize sales data”).
  • Backstory – optional background that can help the agent make better decisions.
  • Tools – a list of helper functions or services the agent can call (e.g., a spreadsheet reader, a database connector, or a custom script).
  • Model – the language model that powers the agent’s reasoning (you can connect any supported model component).
  • Memory – whether the agent remembers past interactions.
  • Verbose – whether the agent prints detailed logs while working.
  • Allow Delegation – whether the agent can ask other agents to help it.
  • Allow Code Execution – whether the agent can run code snippets it generates.
  • kwargs – any extra keyword arguments you want to pass to the underlying CrewAI Agent constructor.

The component does all of this locally; it does not call external APIs beyond the language model you supply. Once built, the Agent is ready to be used in other parts of your workflow.

Inputs

Input Fields

  • Role: The name or title of the agent. This helps the model understand its identity.
  • Goal: The main objective the agent should try to accomplish.
  • Backstory: A short narrative that gives the agent context about its background or expertise.
  • Model: The language model component that will drive the agent’s reasoning and language generation.
  • Tools: A list of tools or toolkits the agent can use. Each tool can be a single function or a collection of related functions.
  • Allow Code Execution: If checked, the agent can run code it generates. Use this only when you trust the code.
  • Allow Delegation: If checked, the agent can ask other agents to help with parts of the task.
  • Memory: If checked, the agent keeps a short history of the conversation to maintain context.
  • Verbose: If checked, the agent will output detailed logs of its thought process and actions.
  • kwargs: Any additional keyword arguments you want to pass to the underlying Agent constructor (e.g., custom settings or flags).

Outputs

  • Agent: The fully configured CrewAI Agent object. This can be connected to other components that need an agent to perform tasks.

Usage Example

  1. Create a new CrewAI Agent
    Drag the “CrewAI Agent” component onto the canvas.
    Fill in the fields:

    • Role: “Data Summarizer”
    • Goal: “Generate a concise summary of the latest sales report.”
    • Backstory: “You are an experienced data analyst who loves turning numbers into stories.”
    • Model: Connect your preferred language model component.
    • Tools: Add a spreadsheet reader tool so the agent can pull data from the report.
    • Memory: Leave checked to keep context.
    • Verbose: Unchecked for a cleaner run.
    • Allow Delegation: Unchecked (single‑agent task).
    • Allow Code Execution: Unchecked (no code needed).
  2. Connect the Agent to a Task
    Add a “CrewAI Task” component (or any component that accepts an Agent).
    Link the Agent output to the Task’s Agent input.
    Set the Task’s prompt to something like: “Please read the attached spreadsheet and produce a 3‑sentence summary.”

  3. Run the Workflow
    Execute the workflow. The agent will use the spreadsheet tool, apply the language model, and return the summary.

  • CrewAI Task – Use this component to give the agent a specific prompt or instruction to execute.
  • CrewAI Workflow – Combine multiple agents and tasks into a larger automated process.
  • Language Model – Any component that provides a language model (e.g., OpenAI GPT, Anthropic Claude).
  • Toolkits – Collections of reusable tools that can be attached to agents.

Tips and Best Practices

  • Choose the right model: A larger model can understand complex goals better but may cost more.
  • Enable Memory for context‑heavy tasks: If the agent needs to remember earlier steps, keep Memory checked.
  • Use Verbose sparingly: Turn it on only when debugging to see the agent’s internal reasoning.
  • Limit code execution: Only enable Allow Code Execution when you trust the code and have sandboxed the environment.
  • Add useful tools: The more relevant tools you give the agent, the more it can accomplish without external help.
  • Test with simple goals first: Start with a clear, short goal to verify the agent behaves as expected before adding complexity.

Security Considerations

  • Code Execution: Enabling Allow Code Execution lets the agent run arbitrary code. Only enable this if you understand the risks and have proper sandboxing or permission controls in place.
  • Tool Access: Be careful which tools you expose to the agent. A tool that can modify files or databases should be protected or used with caution.
  • Model Data: The language model may send data to external services (e.g., OpenAI). Ensure your data privacy policies allow this.
  • Memory: If the agent stores conversation history, consider how long that data is retained and who can access it.

By following these guidelines, you can safely and effectively create intelligent agents that automate tasks within Nappai.