Star A Repository on GitHub

In this example, we will use Letta Agent to star a repository on GitHub using Composio Tools

1

Install Packages

pip install letta-client composio_langchain
2

Import Libraries & Configure Client

from letta_client import Letta
from composio_langchain import Action, ComposioToolSet, App

client = Letta(base_url="http://localhost:8283")
3

Connect Your GitHub Account

You need to have an active GitHub Integration. Learn how to do this here
composio login 
composio add github
4

Add GitHub action to Client

Adding tools to the client

tool = client.tools.add_composio_tool(composio_action_name=Action.GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER.name)
5

Create the agent

agent = client.agents.create(
    name="GitHub Agent",
    memory_blocks=[
        {"label": "persona", "value": "I am a helpful assistant"}
    ],
    model="openai/gpt-4o",
    embedding="openai/text-embedding-ada-002", 
    tool_ids=[tool.id]
)
6

Execute the Agent

response = client.agents.messages.create(
    agent_id=agent.id,
    messages=[
        {
            "role": "user",
            "content": "Star the github repo composioHQ/composio/"
        }
    ]
)
for message in response.messages:
    print(message)