AD
Boost Your Brand on BlueSky—Exclusive banner space to amplify your reach within the BlueSky community.
BSkyInfo LogoBskyInfo
All ToolsCategoriesCollectionsFeed DirectoryLabeler DirectoryArticlesGuidesGlossaryBluesky SDKsSponsor
Submit
All ToolsCategoriesCollectionsFeed DirectoryLabeler DirectoryGuidesGlossaryArticlesBluesky SDKsSponsorSubmit
  1. SDKs
  2. /Python
  3. /gemini-botsky
symmetricalboy

gemini-botsky

A Python SDK for Bluesky and AT Protocol by symmetricalboy

gemini-botsky is a Python SDK for building applications with Bluesky and AT Protocol.

GitHub Stats

6stars
1forks
1contributors
0open issues

Dates

Created:May 8, 2025
Last updated:June 12, 2025

README

The following content is from gemini-botsky's GitHub repository. All rights reserved by the original author.

🤖 Bluesky AI Bot with Google Gemini Integration

A sophisticated AI-powered bot for the Bluesky social network that uses Google's Gemini, Imagen, and Veo models to provide intelligent responses, image generation, and video creation.

✨ Features

  • Real-time Processing: Monitors Bluesky posts via Jetstream WebSocket API
  • AI-Powered Responses: Uses Google Gemini for intelligent conversation
  • Media Generation: Creates images with Imagen 3 and videos with Veo 2
  • Smart Thread Management: Prevents spam and manages conversation depth
  • Memory Safety: Implements memory monitoring and cleanup
  • Rate Limiting: Built-in API rate limiting for reliability
  • Thread Safety: Concurrent processing with proper locking
  • Google Search Integration: Grounded responses with search capabilities

🔧 Setup

Prerequisites

  • Python 3.8 or higher
  • A Bluesky account with an app password
  • Google Gemini API access
  • Basic knowledge of environment variables

Installation

  1. Clone the repository:

    git clone <your-repo-url>
    cd gemini-botsky
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Configure environment variables:

    cp .env.example .env
    

    Edit .env and fill in your credentials:

    BLUESKY_HANDLE=your-handle.bsky.social
    BLUESKY_PASSWORD=your-app-password
    GEMINI_API_KEY=your-gemini-api-key
    
  4. Run the bot:

    python bot.py
    

🔐 Security & Safety

Gemini Safety Settings

The bot uses BLOCK_NONE safety settings by default. You can adjust these in the code if needed.

Rate Limiting

  • Gemini API: Minimum 1 second between calls
  • Bluesky API: Minimum 0.5 seconds between calls

Memory Management

  • Automatic memory monitoring during media processing
  • Cleanup of downloaded media after processing
  • Cache size limits to prevent memory leaks

📊 Configuration Options

All configuration is done via environment variables. See .env.example for all available options.

Key Settings

VariableDefaultDescription
MAX_CONVERSATION_THREAD_DEPTH50Max posts before bot stops replying
MAX_REPLY_THREAD_DEPTH10Max posts bot will create in one thread
MENTION_CHECK_INTERVAL_SECONDS15How often to check for new mentions
MAX_THREAD_DEPTH_FOR_CONTEXT25How much thread history to include

🚀 Deployment

Cloud Platforms

The bot is designed to work well on various cloud platforms:

  • Heroku: Add environment variables in dashboard
  • Railway: Connect GitHub repo and set environment variables
  • DigitalOcean App Platform: Use the included requirements.txt
  • AWS/GCP/Azure: Deploy as container or serverless function

Environment Setup for Production

  1. Set LOG_LEVEL=WARNING to reduce log verbosity
  2. Consider using external services for persistence
  3. Monitor memory usage and adjust limits as needed

🔍 Monitoring & Debugging

Developer Notifications

The bot automatically sends direct messages to @symm.social for:

  • Critical Errors: Startup failures, API initialization problems
  • Connection Issues: Persistent Jetstream connection problems
  • Startup Notifications: Successful bot initialization with status

Messages are sent via DM when possible, with fallback to public mentions if DMs fail.

Logs

The bot provides comprehensive logging:

  • INFO: General operation and successful actions
  • WARNING: Non-critical issues and fallbacks
  • ERROR: Failed operations and exceptions
  • DEBUG: Detailed execution information

Memory Monitoring

Built-in memory monitoring tracks usage during media processing and automatically cleans up resources.

🛠 Customization

Bot Personality

Edit the BOT_SYSTEM_INSTRUCTION in bot.py to customize the bot's personality and behavior.

Media Generation

  • Images: Triggered by "IMAGE_PROMPT:" in responses
  • Videos: Triggered by "VIDEO_PROMPT:" in responses
  • Automatic alt-text generation for accessibility

Thread Management

The bot automatically:

  • Prevents duplicate replies
  • Manages conversation depth
  • Handles user-to-user vs bot conversations appropriately

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

⚠️ Disclaimer

This bot uses AI models that may generate unexpected content. Always monitor its behavior and adjust safety settings as needed for your use case. The bot is provided as-is without warranties.

🆘 Support

For issues, questions, or feature requests:

  1. Check the existing GitHub issues
  2. Create a new issue with detailed information
  3. Include relevant log outputs and configuration (without credentials)

Built with ❤️ by symmetricalboy (@symm.social)

Related SDKs

dannguyendancow-bluesky-fun-api-tool

Just having fun with python and Bluesky's AT Protocol. Trying to build a simple CLI and enough of SDK to easily explore and collect my own Bluesky data

1•Python
TahomaSoftSaxeBlueskyPython

A small python library to post basic text and media to bsky.app via atproto's xrpc API.

1•Python
Gorcenskiskeeter-deleter

A script for auto-deleting Bluesky posts

69•Python
Zetaphorbsky-altometer

A site that measures the current percentage of Bluesky posts missing alt text

7•Python
snarfedbridgy-fed

🌉 A bridge between decentralized social networks

1024•Python
snarfedgranary

💬 The social web translator

487•Python

Resources

GitHub RepositoryProject Website

License

Unknown

Author

symmetricalboy
symmetricalboy

Activity

Last commit: June 12, 2025
Commit frequency: Unknown

Our Sponsors

Your Brand Here!

50K+ engaged viewers every month

Limited spots available!

📧 Contact us via email🦋 Contact us on Bluesky
BSkyInfo LogoBskyInfo

The Most Comprehensive Bluesky Tools Directory

Stay updated with the latest Bluesky tools and ecosystem news 🦋

Bluesky butterfly logo
Quick LinksSubmit a ToolSponsorAboutLegal Information
ToolsFeed DirectoryLabeler DirectorySchedulingAnalyticsAll ToolsCategoriesCollectionsTags
ResourcesArticlesBluesky GuidesBluesky GlossaryBluesky SDKsBluesky ResourcesSkyRaffleMeida Coverage
Our ProductsRaffleBlueAiTeach ToolsLaiewAI affiliate listFirsto

This website may contain affiliate links

© 2025 BskyInfo. All rights reserved.