DEV Community

Cover image for Introducing Composio Tools| Agentic LLMs API Gateway
Kamalabot
Kamalabot

Posted on

Introducing Composio Tools| Agentic LLMs API Gateway

Composio is becoming the go to hub for Tools

The same Tools that you want your Agents to have when work with the LLMs. When I was researching on CrewAI agents, and the flows, the bottleneck was integrating the output from the Agentic LLMs with own applications, file systems and even local scripts. LLMs have the tool_call feature, that allows the agents to call the functions written in native language.

Composio enters at this points with 200+ applications, and countless actions that can be performed on this applications through Composio

Composio Block Diagram

In Composio the External Application are interchangeably called as Apps and Tools. Our focus has to be on the "Actions" that we can perform on these Tools. These actions are the functions (tools) that get called with help of the Agents.

Apps and Actions

Before thinking of writing a Tool, Browse Composio

Today its possible to automate even the most menial task whether it is writing word documents or analysing Excel sheets.

Composio Hub for Tools

We want to the LLMs and its power to be available across the applications that we touch in our every day work and personal life. Tools make this happen. Understanding how Composio organises the Tools, its authentication with different applications, and performs action can be found in composio intro video

There are Many Ways to GTD in Composio

Composio ecosystem is built with the objective of integrating Agents Framework, Applications and the Tools written for them. These tools can be written in different languages, so Python and JS is supported currently.
When it comes to Agents, there is CrewAI, LangChain and Letta to name a few. However all these frameworks have underlying tools which follow the same pattern.

Image description

How to Execute these Tools through Composio

There are two steps involved in execution of Action. There is the Authentication step, and then the collecting the of tools which the LLM will use to execute the function.

Executing Tools

Below is the example response that we get before the tool call is executed using the handle_tool_calls

 ChatCompletion(id='chatcmpl-AdbdykGWgCGWGLBha6hPHBwactSVz', choices=[Ch
oice(finish_reason='tool_calls', index=0, logprobs=None, message=ChatCompletionMessage(conte
nt=None, refusal=None, role='assistant', audio=None, function_call=None, tool_calls=[ChatCom
pletionMessageToolCall(id='call_uPEAReNxd3Uu5nN7l95jifKY', function=Function(arguments='{"ow
ner":"crewAIInc","repo":"crewAI-tools"}', name='GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICAT
ED_USER'), type='function')]))], created=1734002858, model='gpt-4o-mini-2024-07-18', object=
'chat.completion', service_tier=None, system_fingerprint='fp_bba3c8e70b', usage=CompletionUs
age(completion_tokens=34, prompt_tokens=3268, total_tokens=3302, completion_tokens_details=C
ompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rej
ected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_tokens=0, cached
_tokens=0)))
Enter fullscreen mode Exit fullscreen mode

The Function name is the name of the Action inside the Composio hub. This name is part of the "App Enum". These ENUMs are unique to each of the actions, and triggers. We will dive into triggers another day. The handle_tool_calls will take this "function name", and execute it "Inside Composio Server" and then return the results to you.

The Action is Executed in the Composio server
So that means the data will flow to the composio server, and even get logged there and stored for 5 days minimum. Understanding this will help you visualise how things are

Conclusion:

Actions are API calls to the end applications, wrapped inside Composio. Composio is providing the ability to use the APIs by everyone. Not just the people who know to code.

Image description

The Agents make it easy to trigger the API. At the same time, AGENTS are becoming the new front-ends. Think about the below picture, on how this transition is happening.

Top comments (0)