Hello World Example
View the full source code on GitHub
Prerequisites
Install Pipecat Flows and Pipecat with the services used in this example:Define the Nodes
A flow is a graph of nodes. Each node gives the LLM a task and the functions it needs. This example has two nodes: one to ask a question and one to end the conversation.Initial Node
The initial node sets the bot’s personality viarole_message, gives it a task via task_messages, and provides a function the LLM will call when the user answers:
End Node
The end node thanks the user and ends the conversation via theend_conversation post-action:
Write the Function Handler
When the LLM calls the function, the handler processes the result and returns the next node:(result, next_node). The result is provided to the LLM as context, and the next node is where the conversation transitions to.
Build the Pipeline and FlowManager
Set up a standard Pipecat pipeline, then create aFlowManager and initialize it when a client connects:
See the full source
code
for the complete runnable example.
Next Steps
Nodes & Messages
Learn about node configuration and message types
Functions
Understand node functions, edge functions, and direct functions
Examples
Explore more complex examples
API Reference
Complete technical reference