Are you trying to understand AI agents? Or perhaps you’ve started building agents, but are still struggling with tools and how to connect them to app integrations. DataStax Langflow and Composio are a great combination to help you understand these concepts.
Langflow is a visual low-code AI application builder that allows you to build agents quickly for rapid development, and Composio is an integration platform that gives developers access to hundreds of tools like GitHub, Salesforce, and Google.
In this tutorial, you’ll learn how to create a simple agent in Langflow using Composio as a tool to connect to your Google calendar. Let’s get started!
Set up
For this tutorial, you’ll need:
- A DataStax Langflow account to build your AI agent
- A Composio account for connecting your tools and integrations
- An OpenAI account and API key
Once those two accounts are created, proceed to the following steps to get started on building an AI agent with Composio.
Start with Composio
Composio is an application integration platform that gives you access to many different tools that you could use within your AI application. This means that you no longer have to manage APIs for performing actions like creating, deleting, or updating a Google Calendar event; you just need to go through Composio and the work is done for you. We’ll walk through this here.
Once you’ve created your Composio account, you should be dropped into their dashboard. Copy your API key on the top right hand corner. Save this in your clipboard or preferred notes application for later.
Once you have obtained your API key, head over to the “Apps” tab on the left side navigation bar.
Here, you’ll see all of the available tools and integrations that you can connect with through Composio (283 and counting at the time of writing this blogpost!). Use the “Googlecalendar” integration.
Then go to “Setup Googlecalendar integration.”
Follow the steps to complete the integration with your preferred method. They offer options through code with Python or JavaScript—or simply go through authentication via Google sign-on. Once this is completed, you should receive an “Integration Successful” message, which means that you have successfully connected to Google through Composio.
You’ll be dropped into Step 3/3, “Execute tools,” where you can play around with each individual action in a playground with natural language, test out different parameters, and connect with JS and Python via various frameworks.
Now that you have your Google Calendar integration set up and your API key handy, you'll start building a simple AI agent with Langflow using Composio as a tool.
Langflow
Head over to your Langflow account and create a new flow by clicking the “Create Flow” button, which will bring up the start up menu below. You’’ll be using the “Simple Agent” flow on the “Get started” menu.
You’ll be dropped into the visual editor where you’ll notice that there’s already a flow built out. Each of the blocks that you see are called “Components.” Each component represents a functional step in the end-to-end AI flow. The “Agent” component defaults to using the gpt-4o-mini model from OpenAI, but you can choose to use other models if you prefer. This is where you’ll need to put your OpenAI API key.
Next, on the left-side navigation, you can scroll down to “Bundles” and find the Composio bundle. Drag and drop this to the flow and connect it to the “Agent” component” using the “Tool” linking points.
Refer back to the API key you got from the Composio dashboard and put it in the “Composio” component. Select the “GOOGLECALENDAR” app name, and press the “refresh” button. You’ll know that the connection with the integration has been successful when you see “GOOGLECALENDAR CONNECTED” appear under “Auth Status.”
For the purpose of this demo, select from the dropdown under “Actions to use” select all of them. This will allow you to Create, Update, Delete, and Retrieve events!
You've now set up all the components you need for your agent with Composio. It’s time to run the flow.
Run the flow
To test the flow, go to the “Playground” located in the top right corner. You can use the chat interface to give example queries to your agent flow and see how the agent makes decisions between tools.
For example, try typing in the chat input: “Add 1+1” and you’ll notice that the agent determines that it needs to use the Calculator tool to perform the query. You can inspect this by clicking the drop down menu in the agent logs where it says “AI gpt-4o-mini”.
Next, try giving it a query such as “Can you check if I have availability for January 28, 2025 at 3pm? If it's free, schedule a meeting with Bob.” Observe the response here and what decisions the agent had to make using Composio. What actions do you see it calling? What was the final response? Navigate to your Google calendar and see the created event appear on your calendar.
Wrapping up
You’ve officially set up a simple AI agent using Composio as a tool! You were able to easily connect with your Google Calendar and perform actions without having to configure the API yourself, thanks to the power of the Composio integration and Langflow’s component-based visual app-building interface. But the exploration doesn’t end here. As you saw, there are over LOTS of integrations to try within Composio—and you can easily test them all using Langflow!
Top comments (0)