Skip to content

[FR] Add the tools of CrewAI to the mlflow UI#19160

Merged
B-Step62 merged 4 commits intomlflow:masterfrom
Killian-fal:add-tool-to-crewai-integration
Dec 5, 2025
Merged

[FR] Add the tools of CrewAI to the mlflow UI#19160
B-Step62 merged 4 commits intomlflow:masterfrom
Killian-fal:add-tool-to-crewai-integration

Conversation

@Killian-fal
Copy link
Contributor

@Killian-fal Killian-fal commented Dec 2, 2025

🛠 DevTools 🛠

Open in GitHub Codespaces

Install mlflow from this PR

# mlflow
pip install git+https://github.com/mlflow/mlflow.git@refs/pull/19160/merge
# mlflow-skinny
pip install git+https://github.com/mlflow/mlflow.git@refs/pull/19160/merge#subdirectory=libs/skinny

For Databricks, use the following command:

%sh curl -LsSf https://raw.githubusercontent.com/mlflow/mlflow/HEAD/dev/install-skinny.sh | sh -s pull/19160/merge

Related Issues/PRs

Resolve #19159

What changes are proposed in this pull request?

How is this PR tested?

  • Existing unit/integration tests
  • New unit/integration tests
  • Manual tests

Here a result of the feature :
first
inputs
output
timeline

Does this PR require documentation update?

  • No. You can skip the rest of this section.
  • Yes. I've updated:
    • Examples
    • API references
    • Instructions

Release Notes

Is this a user-facing change?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release notes for MLflow users.

Now, when using CrewAI, the tools are displayed in the steps of the tracing section.

What component(s), interfaces, languages, and integrations does this PR affect?

Components

  • area/tracking: Tracking Service, tracking client APIs, autologging
  • area/models: MLmodel format, model serialization/deserialization, flavors
  • area/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registry
  • area/scoring: MLflow Model server, model deployment tools, Spark UDFs
  • area/evaluation: MLflow model evaluation features, evaluation metrics, and evaluation workflows
  • area/gateway: MLflow AI Gateway client APIs, server, and third-party integrations
  • area/prompts: MLflow prompt engineering features, prompt templates, and prompt management
  • area/tracing: MLflow Tracing features, tracing APIs, and LLM tracing functionality
  • area/projects: MLproject format, project running backends
  • area/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev server
  • area/build: Build and test infrastructure for MLflow
  • area/docs: MLflow documentation pages

How should the PR be classified in the release notes? Choose one:

  • rn/none - No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" section
  • rn/breaking-change - The PR will be mentioned in the "Breaking Changes" section
  • rn/feature - A new user-facing feature worth mentioning in the release notes
  • rn/bug-fix - A user-facing bug fix worth mentioning in the release notes
  • rn/documentation - A user-facing documentation change worth mentioning in the release notes

Should this PR be included in the next patch release?

Yes should be selected for bug fixes, documentation updates, and other small changes. No should be selected for new features and larger changes. If you're unsure about the release classification of this PR, leave this unchecked to let the maintainers decide.

What is a minor/patch release?
  • Minor release: a release that increments the second part of the version number (e.g., 1.2.0 -> 1.3.0).
    Bug fixes, doc updates and new features usually go into minor releases.
  • Patch release: a release that increments the third part of the version number (e.g., 1.2.0 -> 1.2.1).
    Bug fixes and doc updates usually go into patch releases.
  • Yes (this PR will be cherry-picked and included in the next patch release)
  • No (this PR will be included in the next minor release)

@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2025

@Killian-fal Thank you for the contribution! Could you fix the following issue(s)?

⚠ DCO check

The DCO check failed. Please sign off your commit(s) by following the instructions here. See https://github.com/mlflow/mlflow/blob/master/CONTRIBUTING.md#sign-your-work for more details.

@github-actions github-actions bot added area/tracking Tracking service, tracking client APIs, autologging rn/none List under Small Changes in Changelogs. labels Dec 2, 2025
@Killian-fal Killian-fal force-pushed the add-tool-to-crewai-integration branch 2 times, most recently from ff6a6c0 to 0a5969d Compare December 2, 2025 10:02
@Killian-fal
Copy link
Contributor Author

I fixed a bug with "config.log_traces". If false, the original function was never called. I added 2 tests to cover these cases

@Killian-fal Killian-fal marked this pull request as draft December 2, 2025 10:06
@Killian-fal Killian-fal marked this pull request as ready for review December 2, 2025 10:21
@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2025

Documentation preview for ba67326 is available at:

More info
  • Ignore this comment if this PR does not change the documentation.
  • The preview is updated when a new commit is pushed to this PR.
  • This comment was created by this workflow run.
  • The documentation was built by this workflow run.

@Killian-fal Killian-fal force-pushed the add-tool-to-crewai-integration branch from 0a5969d to 86f6960 Compare December 3, 2025 14:27
Copilot AI review requested due to automatic review settings December 4, 2025 09:46
@Killian-fal Killian-fal marked this pull request as draft December 4, 2025 09:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds tool calling support to the MLflow UI for CrewAI agents, enabling display of tool execution steps in the tracing section. The implementation introduces patching for standalone module functions to capture tool execution traces.

Key changes:

  • Added patched_standalone_call function to handle tracing for standalone module functions (specifically execute_tool_and_check_finality)
  • Refactored patch application logic in autolog() to use helper functions _apply_patches, _import_module, and _import_class for better code organization
  • Updated tests to verify tool execution traces and behavior when tracing is disabled

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
mlflow/crewai/__init__.py Refactored patch application logic and added standalone method patching for CrewAI >= 0.114.0 tool support
mlflow/crewai/autolog.py Implemented patched_standalone_call and _resolve_standalone_span functions for tool tracing, refactored patched_class_call indentation
tests/crewai/test_crewai_autolog.py Updated tool calling test expectations (7 spans instead of 6) and added tests for disabled trace scenarios

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Killian-fal and others added 3 commits December 5, 2025 11:44
Signed-off-by: Killian <killian.falguiere@gmail.com>
Co-authored-by: Yuki Watanabe <31463517+B-Step62@users.noreply.github.com>
Signed-off-by: Killian <31043822+Killian-fal@users.noreply.github.com>
Co-authored-by: Yuki Watanabe <31463517+B-Step62@users.noreply.github.com>
Signed-off-by: Killian <31043822+Killian-fal@users.noreply.github.com>
@Killian-fal Killian-fal force-pushed the add-tool-to-crewai-integration branch from 24c75a4 to ea47cf3 Compare December 5, 2025 10:44
@Killian-fal Killian-fal marked this pull request as ready for review December 5, 2025 10:44
Signed-off-by: Killian <killian.falguiere@gmail.com>
@Killian-fal Killian-fal force-pushed the add-tool-to-crewai-integration branch from ea47cf3 to ba67326 Compare December 5, 2025 10:46
@Killian-fal Killian-fal requested a review from B-Step62 December 5, 2025 10:47
Copy link
Collaborator

@B-Step62 B-Step62 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@B-Step62 B-Step62 added this pull request to the merge queue Dec 5, 2025
Merged via the queue into mlflow:master with commit 2cdfcbb Dec 5, 2025
49 of 51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tracking Tracking service, tracking client APIs, autologging rn/none List under Small Changes in Changelogs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FR] Add the tools of CrewAI to the mlflow UI

3 participants