Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Agentic Workflows #1627

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Feat: Agentic Workflows #1627

wants to merge 6 commits into from

Conversation

manthanguptaa
Copy link
Contributor

@manthanguptaa manthanguptaa commented Dec 23, 2024

Description

This PR introduces the ability for agents to call workflows

Type of change

Please check the options that are relevant:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Model update
  • Infrastructure change

Checklist

  • My code follows Phidata's style guidelines and best practices
  • I have performed a self-review of my code
  • I have added docstrings and comments for complex logic
  • My changes generate no new warnings or errors
  • I have added cookbook examples for my new addition (if needed)
  • I have updated requirements.txt/pyproject.toml (if needed)
  • I have verified my changes in a clean environment

Additional Notes

Include any deployment notes, performance implications, or other relevant information:

@manthanguptaa manthanguptaa marked this pull request as draft December 23, 2024 11:37
super().__init__()
setup_database()

@Workflow.register(description="Order a product for a user")
Copy link
Contributor

Choose a reason for hiding this comment

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

Are each of these possible workflows?

return str(response.content)


agent = Agent(
Copy link
Contributor

Choose a reason for hiding this comment

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

So a workflow is an agent? Or you can have an agent call workflows like tools? What is the difference between a workflow and a tool then? That you can call other agents in that workflow?

agent = Agent(
name="Customer Support Agent",
description="You are a customer support agent that can help with general queries and order products for users",
instructions=[
Copy link
Contributor

Choose a reason for hiding this comment

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

Couldn't this example be done with only the database agent and structured output?

@yalsayid
Copy link

yalsayid commented Jan 2, 2025

Just wanted to share a thought - having agents call workflows would be really useful for streaming tool calls! Right now with phidata, if you pass a tool that uses an agent, you only get basic start/complete events, which limits our ability to build some newer AI streaming experiences on the frontend (like what you see in Anthropic's artifacts or ChatGPT Canvas).

For example, if we have an agent that calls a tool which is a function that uses another agent to generate an essay, currently we can only show a "Generating essay..." loading spinner until the entire agent tool call completes. But with workflow streaming, we could return a custom data stream that shows the essay being written in real-time as the underlying agent processes it.

Combining workflow streaming with agents would let us build these kinds of rich features and probably open up some interesting new use cases too. Happy to pitch in on this PR if you're looking for contributors!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants