# Using MLFlow with CrewAI

**URL:** <https://community.crewai.com/t/using-mlflow-with-crewai/4228>\
**Category:** CrewAI Community Support\
**Created:** [February 27, 2025, 6:42am UTC](https://community.crewai.com/t/using-mlflow-with-crewai/4228 "2025-02-27T06:42:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![glorianeo](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/glorianeo/32/1089_2.png) [@glorianeo](https://community.crewai.com/u/glorianeo)\
**Post date:** [February 27, 2025, 6:42am UTC](https://community.crewai.com/t/using-mlflow-with-crewai/4228/1 "2025-02-27T06:42:47Z")

</div>

Anyone knows how to use MLFlow to trace inputs / outputs, log time taken, etc?  
Documentation in CrewAI Docs has been quite sparse.

I have put in the following as per the logs, but am not sure how to log individual agents.

```auto
import mlflow

mlflow.crewai.autolog()
mlflow.set_tracking_uri("http://localhost:5000")
mlflow.set_experiment("CrewAI")

```

---

<div class="post-metadata">

**Author:** ![glorianeo](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/glorianeo/32/1089_2.png) [@glorianeo](https://community.crewai.com/u/glorianeo)\
**Post date:** [March 3, 2025, 7:33am UTC](https://community.crewai.com/t/using-mlflow-with-crewai/4228/2 "2025-03-03T07:33:15Z")

</div>

Noticed the above 3 lines of code works well when using a single python script with agents, tasks, crew, and the kickoff altogether in a file.

However, I cant seem to get ML Flow to work when using the CrewAI YAML folder structure, or for more complex codes where the various crewAI components are split into several files.
