This is a starter repo for building agents with Composio and Lyzr you can use this to update and build your own dynamic agents...
We are doing the following in this repository:
- Using composio to get slack messages
- Using Lyzr to build two agents 1 for researching on the topic and 2nd for writing a detailed analysis on the topic
- And then again using composio to write the detailed report in Notion sending a confirmation message to slack
Here is a diagram to better explain to you how it works
Below is the basic setup you can do to run the repository
- Add .env file and add your OPENAI_API_KEY
cp .env.sample .env && code .env
Note: There's no need to add TRIGGER_ID
and CHANNEL_ID
in the .env file right now, we'll get to that in the next steps.
- Run setup script
chmod +x setup.sh && ./setup.sh
and add your ngrok authentication key
ngrok config add-authtoken < your auth token >
For the auth management and integrations, let's use Composio
- Use Composio CLI
poetry run composio-cli add notion
poetry run composio-cli add slack
Go through the flow to notion, and complete the authorization flow. this will lead to a web page where you first give access to the notion pages you want permissions to be in and then slack where you can just click on allow
You need to either create a public server or tunnel to setup webhook to get messages from composio.
- To tunnel to setup webhook to get messages from composio, you can use ngrok.
ngrok http http://0.0.0.0:2000
- Add your trigger callback URL - URL of your server where your agent will recieve all the update
poetry run composio-cli set global-trigger-callback "<ngrok-url>"
This will setup the callback url to get messages from composio.
- Enable slack recieve trigger
poetry run composio-cli enable-trigger slack_receive_message
This will enable the trigger to get messages from slack when a message is sent.
- Now edit the .env file again, and update
TRIGGER_ID
andCHANNEL_ID
you can get the channel id
code .env
Instructions:
- You'll get the
TRIGGER_ID
when you run step (6) - To get
CHANNEL_ID
go to slack channel settings and you'll see it at the end of about settings
Public setup doesn't require ngrok and you can directly set global-trigger-callback to the public url and enable the trigger.
To kickstart your Lyzr of AI agents and begin task execution, run this from the root folder of your project:
poetry run python main.py
This command initializes the Lyzr, assembling the agents and assigning them tasks as defined in your configuration.
This example, unmodified, will run the create a report.md
file with the output of a research on LLMs in the root folser
You can use this repository as as starting repository to write your other agent systems to perform various other tasks you would need to follow the following things
- Add your desired apps to authenticate and use
- Change the
main.py
file along withsrc/lyzer/Lyzr.py
for your newer functions - You may need to change any other envs that you are now using
For support, questions, or feedback regarding Composio or composio_lyzr
- Visit our documentation
- Reach out to us through our GitHub repository
- Joing our Discord