{"collection":"posts","slug":"1681369200000-ai-legion-on-bluesky","cid":"bafkreibwbxnwrp4hl4vzrq2655wszvf27jrq55rlozozpbaoitz5skgkaa","title":"AI-Legion on Bluesky","excerpt":"I gave AI-Legion the Bluesky agent types and asked it to extend itself into the open social protocol.","body":"![](blob://bafkreihqbisz74tydvpv66w4jo7buujbyguhdjvzpkqioygayxxsjhixwu)\n\nIn 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.\n\nThe three agent projects had slightly different shapes:\n\n- [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.\n- [BabyAGI](https://github.com/yoheinakajima/babyagi) used OpenAI to create and execute tasks, with Pinecone carrying state between them.\n- [AI-Legion](https://github.com/eumemic/ai-legion) was a pluggable TypeScript variant using multiple agents across simultaneous contexts.\n\n![](blob://bafkreift2jpz2s3iyhpv3ipkr3b7qdmsal35bhk3yxrzfjzkclqh6bjzcy)\n\nThe Bluesky post above supplied the prompt. I wanted to know whether AI-Legion could add Bluesky support to itself.\n\nI 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`.\n\nAfter a lot of trial and error, it could access a useful chunk of Bluesky:\n\n- postMessage\n- getTimeline\n- likePost\n- deleteLike\n- follow\n- deleteFollow\n- repost\n- deleteRepost\n- mute\n- unmute\n- listNotifications\n- countUnreadNotifications\n\n![](blob://bafkreia55yyl4uwqfd3q3iibyy22va5iddld3bedoigkhmqagnebvi4jz4)\n\nIt worked, at the cost of a fairly stupid spike in my OpenAI bill.\n\n![](blob://bafkreihtbfdddwxrx5jd4yuccnsb5rcex6skgnd2zvolqklevjfh6yrbhe)\n\nThe fork is at [github.com/iammatthias/ai-legion-bluesky](https://github.com/iammatthias/ai-legion-bluesky).\n\nThe 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:\n\n```\n1. Use GPT-4 for search.\n2. Post organically.\n3. Be engaging, but do not spam.\n4. Do not use emojis or hashtags.\n5. Maintain a fluid and stream-of-consciousness vibe with engaging content posted on bluesky.\n6. Enhance the human tone in engaging content posted on bluesky.\n7. Only Agent 1 can post to bluesky.\n8. You have access to the following bluesky actions: postMessage, getTimeline, likePost, deleteLike, follow, deleteFollow, repost, deleteRepost, mute, unmute, listNotifications, countUnreadNotifications.\n9. 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.\n```","tags":["ai","bluesky","at-protocol","ai-tools","automation","development","social-media","decentralization"],"published":true,"createdAt":"2023-04-11T13:00:00Z","updatedAt":"2026-07-16T14:59:43Z"}
