Skip to content

agent

Repository: github.com/datarobot-community/af-component-agent

Adds an agentic workflow to your recipe. The component scaffolds a single-agent or multi-agent system using your choice of framework: CrewAI, LangGraph, LlamaIndex, or NeMo Agent Toolkit (NAT). It includes a local development server, a command-line interface for testing, a test suite, and Pulumi infrastructure for deployment to DataRobot.

This component is repeatable — apply it multiple times with different agent names to run multiple independent agentic workflows from a single recipe.

Prerequisites

  • Python 3.11+
  • uv and uvx installed
  • dr installed
  • The base component already applied
  • The llm component already applied
  • The datarobot-mcp component already applied

Apply

dr component add https://github.com/datarobot-community/af-component-agent .

Or with copier directly:

uvx copier copy datarobot-community/af-component-agent .

When prompted, choose your agent framework:

Framework When to use
base Minimal scaffold — bring your own agentic logic.
crewai Role-based multi-agent crews.
langgraph Graph-based stateful agent workflows.
llamaindex RAG and document-aware agent workflows.
nat YAML-based NeMo Agent Toolkit.

Component dependencies

Component Required
base Yes
llm Yes
datarobot-mcp Yes

What it adds

agent/
├── agent/myagent.py   # Agent workflow — edit this to customize behavior
├── cli.py             # Command-line interface for local testing
├── dev.py             # Local development server
├── tests/             # Test suite
└── public/            # UI assets
infra/infra/agent.py   # Pulumi deployment resources

Configure

dr dotenv setup

The wizard asks for:

  • Agent port (default: 8842).
  • DataRobot execution environment.
  • Execution environment version ID.
  • Pulumi passphrase.
  • DataRobot default use case (optional).
  • LLM Gateway configuration.

Local development

Start the local server:

dr run dev

Run the agent from another terminal:

uv run python cli.py execute --user_prompt "Write a blog post about AI in healthcare" --show_output

Testing

Run all tests:

task test

Test a specific framework:

task test-AGENT_FRAMEWORK

Test the CLI:

task test-cli

Deploy

dr task deploy

After deployment, the agent is available in the DataRobot workbench under your use case, accessible via the agent playground or the deployment API endpoint.

Customizing agent behavior

Edit agent/agent/myagent.py to:

  • Change agent roles and goals.
  • Modify task descriptions.
  • Add agents to the crew.
  • Integrate MCP tools.

Update

dr component update .datarobot/answers/agent-AGENT_APP_NAME.yml

Or with copier directly:

uvx copier update -a .datarobot/answers/agent-AGENT_APP_NAME.yml -A

End-to-end test

The component includes a full lifecycle end-to-end test (render → build → deploy → test → destroy):

task test-e2e

By default it tests all frameworks. To run a subset:

E2E_AGENT_FRAMEWORKS=base,crewai task test-e2e

Troubleshooting

uvx or dr command not found

Ensure both tools are installed and on your PATH. Run uv --version and dr --version to confirm.

Authentication errors at startup

Verify that DATAROBOT_ENDPOINT and DATAROBOT_API_TOKEN are set correctly and that the token has the required permissions.

Framework import errors

Some frameworks have optional heavy dependencies. Run task test-AGENT_FRAMEWORK to isolate the failing framework and check its dependency group in pyproject.toml.

E2E test failures

Confirm that your DataRobot account has access to the deployment target and that the Pulumi local backend is writable.