Getting Started with Xircuits
Welcome to Xircuits! This tutorial will walk you through installing Xircuits, starting it, opening and modifying a workflow, and finally running it in JupyterLab.
Installation
Before you begin, ensure you have Python 3.8 or later installed on your machine. It's recommended to use a virtual environment to keep your dependencies isolated. Follow these steps to install Xircuits:
-
Set up your virtual environment: Open your terminal and create a virtual environment. You can do this with the following commands:
python -m venv venvsource venv/bin/activate # On Windows, use `venv\Scripts\activate` -
Install Xircuits: With your virtual environment activated, install Xircuits using pip:
pip install xircuits
This command will download and install all the necessary packages for Xircuits.
Launching Xircuits
After installing Xircuits, you need to launch it to start building workflows.
-
Start Xircuits: Run the following command in your terminal:
xircuits
This command will launch the Xircuits interface, where you can build and manage your workflows.
Running a Xircuits Workflow
In Xircuits, you'll be working with pipelines that we call workflows. They are files with the .xircuits extension.
Open an Example File
To get started with a simple workflow, let's open a pre-existing example file:
- Navigate to Examples: In the Xircuits interface, use the file browser to navigate to the
xai_components/xai_template/directory. - Select an Example: Open the
HelloTutorial.xircuitsfile. This simple workflow demonstrates how to concatenate strings and print the result.
Some component libraries have default examples for you to start with. You can open them using the ... context menu when you expand a library, then selecting Show Example.
Understand the Workflow Logic
Once you open a .xircuits file, you will see a visual representation of your workflow. Here's what you need to know:
-
Workflow Sequence: A typical workflow progresses from the
Startnode to theFinishnode. You can have an infinite number of nodes between Start and Finish, which are connected by a blue flowing link which indicates the sequence of execution. -
Nodes and Links: Nodes represent components within your workflow and are connected by links. There are two common types of nodes:
-
Component Nodes: These nodes perform actions or tasks within your workflow. They have flow ports at the top to manage the execution flow, with at least one flow inPort and outPort. The flow links connecting these ports are blue and flowing, indicating the execution sequence of the workflow.
Preview

Component Nodes -
Parameter Nodes: These nodes supply values to the component nodes, influencing their behavior. They do not have icons and are connected to the component nodes via solid gray links. You can edit the values of parameter nodes by double-clicking on them.
Preview

Parameter Nodes
-
-
HelloTutorial Workflow: In this example, you'll see four main components:
Start: The beginning of the workflowConcatString: Combines two stringsPrint: Outputs the resultFinish: Marks the end of the workflow
There are also two Literal components connected to ConcatString, providing the strings "Hello " and "Xircuits!" to be concatenated.