---
title: "AI-Legion on Bluesky"
section: posts
description: "I gave AI-Legion the Bluesky agent types and asked it to extend itself into the open social protocol."
tags: ["ai", "bluesky", "at-protocol", "ai-tools", "automation", "development", "social-media", "decentralization"]
created: 2023-04-11T13:00:00Z
updated: 2026-07-16T14:59:43Z
cid: bafkreibwbxnwrp4hl4vzrq2655wszvf27jrq55rlozozpbaoitz5skgkaa
html: https://iammatthias.com/posts/1681369200000-ai-legion-on-bluesky
---

# AI-Legion on Bluesky

![](https://blobs.farfield.systems/blobs/bafkreihqbisz74tydvpv66w4jo7buujbyguhdjvzpkqioygayxxsjhixwu)

In April 2023, AutoGPT, AI-Legion, and BabyAGI were appearing everywhere. At the same time, Mastodon, Farcaster, and Bluesky were pulling people away from Twitter. I wanted to see whether an agent framework could extend itself into one of those open networks.

The three agent projects had slightly different shapes:

- [AutoGPT](https://github.com/Torantulino/Auto-GPT) was a Python app that broke autonomous work into "thoughts," "reasoning," and "criticism" around a user-defined goal.
- [BabyAGI](https://github.com/yoheinakajima/babyagi) used OpenAI to create and execute tasks, with Pinecone carrying state between them.
- [AI-Legion](https://github.com/eumemic/ai-legion) was a pluggable TypeScript variant using multiple agents across simultaneous contexts.

![](https://blobs.farfield.systems/blobs/bafkreift2jpz2s3iyhpv3ipkr3b7qdmsal35bhk3yxrzfjzkclqh6bjzcy)

The Bluesky post above supplied the prompt. I wanted to know whether AI-Legion could add Bluesky support to itself.

I forked AI-Legion, let it make a few exploratory and quickly deleted posts, then gave it the `bsky-agent` types and asked it to modify `src/module/definitions/bluesky.ts`.

After a lot of trial and error, it could access a useful chunk of Bluesky:

- postMessage
- getTimeline
- likePost
- deleteLike
- follow
- deleteFollow
- repost
- deleteRepost
- mute
- unmute
- listNotifications
- countUnreadNotifications

![](https://blobs.farfield.systems/blobs/bafkreia55yyl4uwqfd3q3iibyy22va5iddld3bedoigkhmqagnebvi4jz4)

It worked, at the cost of a fairly stupid spike in my OpenAI bill.

![](https://blobs.farfield.systems/blobs/bafkreihtbfdddwxrx5jd4yuccnsb5rcex6skgnd2zvolqklevjfh6yrbhe)

The fork is at [github.com/iammatthias/ai-legion-bluesky](https://github.com/iammatthias/ai-legion-bluesky).

The timeline response was the real constraint. A mostly unfiltered response filled AI-Legion's context window quickly, so `getTimeline` needed a small limit and the agent needed explicit instructions about which fields belonged in memory. This was the prompt:

```
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.
```

---

## Related

- [llm-fid.fun](https://iammatthias.com/open-source/1746490719151-llm-fid-txt.md)
- [Pure Internet: Bluesky](https://iammatthias.com/posts/1732585567703-pure-internet-bluesky.md): Static-site hosting on Bluesky's AT Protocol using content-addressed blob storage.
- [Pure Internet](https://iammatthias.com/posts/1731955749292-pure-internet.md): Pure Internet is a running collection of small experiments in publishing with fewer layers.
- [Nimbus](https://iammatthias.com/open-source/1768762943567-nimbus.md): AT Protocol repository sync with Cloudflare Workers built on Tap
- [Notes on using a PDS as Content Infrastructure](https://iammatthias.com/posts/1767505149657-notes-on-using-a-pds-as-content-infrastructure.md): Content addressing with normal web requests, identity baked in, delivery over boring HTTPS.
