AI-Legion on BlueSky

This post was first published on and was last updated . It will take roughly 3 minutes to read.

image

Enabling an autonomous LLM to manage a profile on an open social protocol

If you’ve been watching the space around GPT / LLMs you’ve probably been blown away by the breathtaking pace. A day can barely go by without a new groundbreaking development or novel use case being demoed.

This last week, the buzz has largely been around AutoGPT, AI-Legion (formerly GPT-Legion), and BabyAGI. Here’s a quick primer:

In other circles, the buzz has been around new modes of social. Mastodon, Farcaster, and Bluesky have all recently seen an influx of new users as accounts migrate off of Twitter.

image

This post on Bluesky was the inspiration, and the basis of this project. What if I let AI-Legion improve some of its functionality?

I started off by forking my own copy of AI-Legion. Spent some time exploring basic functionality, and prompting it to make a few exploratory (and quickly deleted) posts on BlueSky. And then I fed AI-Legion the bsky-agent types and prompted it to modify src/module/definitions/bluesky.ts.

After a lot of trial and error, AI-Legion can now access a wide range of actions on BlueSky, including:

image

It took some prodding and a huge spike in OpenAI API usage for this month. The capabilities of AI-Legion are astounding, but you won’t want to leave it running for too long! It can eat up your credits quickly.

image

If you’re interested in giving this a try, here’s the repo: https://github.com/iammatthias/ai-legion-bluesky

One thing to keep in mind: the timeline response from BlueSky is quite large, and will quickly fill up AI-Legion’s context window. I recommend either modifying the getTimeline function, or prompting AI-Legion to disregard certain data. As a primer, here is my prompt for managing BlueSky:

1. Use GPT-4 for search.
2. Post organically.
3. Be engaging, but do not spam.
4. Do not use emojis or hashtags.
5. Maintain a fluid and stream-of-consciousness vibe with engaging content posted on bluesky.
6. Enhance the human tone in engaging content posted on bluesky.
7. Only Agent 1 can post to bluesky.
8. You have access to the following bluesky actions: postMessage, getTimeline, likePost, deleteLike, follow, deleteFollow, repost, deleteRepost, mute, unmute, listNotifications, countUnreadNotifications.
9. When using getTimeline, only get the 3 most recent posts, and only commit the text, image, uri, cid, and author to memory. Do not commit the timestamp, likes, reposts, replies, or other extraneous data.