<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/put-the-agent-inside-the-workflow-022vuzi3m" -->

---
title: Put the Agent Inside the Workflow | daily.dev
description: A hybrid LLM application pattern is presented that combines predefined workflow stages with embedded agent behavior. Using hyperparameter tuning as a case...
canonical: https://daily.dev/posts/put-the-agent-inside-the-workflow-022vuzi3m
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Put the Agent Inside the Workflow | daily.dev
og:description: A hybrid LLM application pattern is presented that combines predefined workflow stages with embedded agent behavior. Using hyperparameter tuning as a case...
og:url: https://daily.dev/posts/put-the-agent-inside-the-workflow-022vuzi3m
og:image: https://api.daily.dev/og/posts/022VUZI3M.png
og:image:alt: Put the Agent Inside the Workflow
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Put the Agent Inside the Workflow

**[Towards Data Science](https://daily.dev/sources/tds)** · 9 min read · 1 upvotes · 0 comments

## Summary

A hybrid LLM application pattern is presented that combines predefined workflow stages with embedded agent behavior. Using hyperparameter tuning as a case study, the approach breaks an application into three stages: structured LLM calls for known operations (experiment preparation and report summarization) and an autonomous agent for the exploratory middle stage (model selection). The agent uses scikit-learn tools to run experiments adaptively, with parallel tool calls enabled. The pattern's key insight is to ask not 'workflow or agent?' for the whole app, but rather 'where does the app need autonomy?' and place agents only at those stages.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://towardsdatascience.com/put-the-agent-inside-the-workflow>

## Questions this post answers

### Should I build my LLM application as a full agent or as a fixed workflow?

Neither exclusively; use a hybrid pattern where most stages follow a predefined workflow and an agent is placed only in the stage where the next useful action depends on intermediate results. For example, in a hyperparameter tuning application, a structured LLM call handles experiment preparation and reporting, while an autonomous agent handles the exploratory model-experimentation stage.

_daily.dev surfaces practical patterns like this for developers weighing agent versus workflow design._

### How can I let an OpenAI agent run scikit-learn cross-validation experiments as a tool?

Wrap a function that calls scikit-learn's cross_val_score in the @function_tool decorator from the openai-agents SDK, passing the classifier name and hyperparameters as JSON so the agent can select from scikit-learn's classifier registry and evaluate configurations, appending each result to a shared trial history list for later reporting.

_developers building agentic ML tooling can track approaches like this via daily.dev._

## Similar posts on daily.dev

- [Building an internal agent: Code-driven vs LLM-driven workflows](https://daily.dev/posts/building-an-internal-agent-code-driven-vs-llm-driven-workflows-vu4f4aban) · Irrational Exuberance · 2 upvotes · 0 comments
- [Agent or Workflow? A Practical Test for Knowing When You Actually Need an AI Agent](https://daily.dev/posts/agent-or-workflow-a-practical-test-for-knowing-when-you-actually-need-an-ai-agent-ypwzoebar) · Machine Learning Mastery · 1 upvotes · 0 comments
- [You Probably Don’t Need an Agent Framework](https://daily.dev/posts/you-probably-don-t-need-an-agent-framework-rquhwxpsr) · Towards Data Science · 2 upvotes · 0 comments
- [The Agent Loop: How AI Goes From Answering Questions to Doing Things](https://daily.dev/posts/the-agent-loop-how-ai-goes-from-answering-questions-to-doing-things-5vyyqtwve) · ByteByteGo · 2 upvotes · 0 comments

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#openai](https://daily.dev/tags/openai), [#scikit](https://daily.dev/tags/scikit), [#pydantic](https://daily.dev/tags/pydantic)

[View this post on daily.dev](https://daily.dev/posts/put-the-agent-inside-the-workflow-022vuzi3m)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Put the Agent Inside the Workflow","url":"https://daily.dev/posts/put-the-agent-inside-the-workflow-022vuzi3m","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/put-the-agent-inside-the-workflow-022vuzi3m"},"datePublished":"2026-08-01T13:58:59.935Z","dateModified":"2026-09-13T21:07:38.198Z","description":"A hybrid LLM application pattern is presented that combines predefined workflow stages with embedded agent behavior. Using hyperparameter tuning as a case...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/2014871a5eb868b28190d407d8e75699?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/2014871a5eb868b28190d407d8e75699?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Towards Data Science","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Towards Data Science","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/tds","url":"https://daily.dev/sources/tds"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/put-the-agent-inside-the-workflow-022vuzi3m","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai-agents,openai,scikit,pydantic","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Towards Data Science","item":"https://daily.dev/sources/tds"},{"@type":"ListItem","position":3,"name":"Put the Agent Inside the Workflow"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/put-the-agent-inside-the-workflow-022vuzi3m#faq","mainEntity":[{"@type":"Question","name":"Should I build my LLM application as a full agent or as a fixed workflow?","acceptedAnswer":{"@type":"Answer","text":"Neither exclusively; use a hybrid pattern where most stages follow a predefined workflow and an agent is placed only in the stage where the next useful action depends on intermediate results. For example, in a hyperparameter tuning application, a structured LLM call handles experiment preparation and reporting, while an autonomous agent handles the exploratory model-experimentation stage. daily.dev surfaces practical patterns like this for developers weighing agent versus workflow design."}},{"@type":"Question","name":"How can I let an OpenAI agent run scikit-learn cross-validation experiments as a tool?","acceptedAnswer":{"@type":"Answer","text":"Wrap a function that calls scikit-learn's cross_val_score in the @function_tool decorator from the openai-agents SDK, passing the classifier name and hyperparameters as JSON so the agent can select from scikit-learn's classifier registry and evaluate configurations, appending each result to a shared trial history list for later reporting. developers building agentic ML tooling can track approaches like this via daily.dev."}}]}
```

