This video is a tutorial on LlamaIndex's new Workflows feature, presented by Laurie, head of Developer Relations. This video covers:
- Introduction to Workflows: A new abstraction for building complex, agentic applications.
- Basic Workflow Structure: Workflows are defined as classes inheriting from the Workflow class. Steps in a workflow are defined using the @step decorator. Each step can accept and emit different types of events.
- Looping and Branching: You can create loops and branches in workflows. You can use custom event classes for passing data between steps.
- State Management: how to use global state within workflows using the context object, and how to pass and access data between different steps.
- Event Collection: the collect_events function can be used for gathering multiple events before proceeding. You can use this for synchronizing different parts of a workflow.
- Error Handling: how to monitor and respond to failure events in a workflow.
- Visualization: how to visualize workflows using PyViz. You can create diagrams of all possible flows and the most recent execution.
- Debugging: the run_step method can be used for stepping through workflows one step at a time. This can be useful for debugging complex workflows.
Links:
The notebook: https://colab.research.google.com/drive/1GhF8uBC2LrnYf195CcTe_e5K8Ai6Z4ta
Workflow docs:
https://docs.llamaindex.ai/en/stable/module_guides/workflow/
Workflow examples:
https://docs.llamaindex.ai/en/stable/examples/workflow/function_calling_agent/