Skip to content

feat: Add Gather.is as a social platform for AI agents#26

Open
philmade wants to merge 3 commits into
hoangsonww:masterfrom
philmade:feat/add-gather-social-platform
Open

feat: Add Gather.is as a social platform for AI agents#26
philmade wants to merge 3 commits into
hoangsonww:masterfrom
philmade:feat/add-gather-social-platform

Conversation

@philmade

Copy link
Copy Markdown

Summary

  • Adds Gather.is as a fifth social platform alongside Twitter, LinkedIn, Instagram, and Facebook
  • Gather.is is an open-source social platform built specifically for AI agents — Ed25519 keypair identity, proof-of-work anti-spam, token-efficient feeds
  • Follows the exact same pattern as the existing platform integrations (GatherAPI class, enum entry, dispatcher wiring)
  • Falls back to simulation mode if keys aren't configured, just like the other platforms

Files changed

File Change
src/agentic_ai/tools/social_media_tools.py Add GATHER enum, GatherAPI class, wire into SocialMediaPostTool
.env.social_media.example Add GATHER_PRIVATE_KEY_PATH / GATHER_PUBLIC_KEY_PATH

Why

The existing platforms (Twitter, LinkedIn, etc.) are human social networks. Gather.is is where AI agents talk to other AI agents — discover collaborators, share capabilities, coordinate via private channels. If you're building an agentic pipeline that posts to social media, it should be able to post to the agent social network too.

Source code: github.com/philmade/gather-infra

Test plan

  • Verify existing platforms still work (no shared code modified)
  • Test with {"platform": "gather", "title": "Test", "content": "Hello from Agentic-AI-Pipeline"}
  • Confirm simulation mode works when keys aren't configured

🤖 Generated with Claude Code

Gather.is is an API-first social platform for AI agents using Ed25519
challenge-response auth and proof-of-work anti-spam. Adds GatherAPI class
alongside existing Twitter/LinkedIn/Instagram/Facebook integrations.

- Add GATHER to SocialPlatform enum
- Add GatherAPI with auth, PoW solver, posting, feed reading, agent discovery
- Wire into SocialMediaPostTool dispatcher
- Add keypair paths to .env.social_media.example

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @philmade, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly expands the social media capabilities by integrating Gather.is, a platform tailored for AI agent communication. This enhancement enables agents to discover collaborators, share capabilities, and coordinate within a dedicated network, thereby broadening the scope of agentic pipelines beyond traditional human social networks. The implementation ensures secure identity management and spam prevention through cryptographic keypairs and proof-of-work challenges.

Highlights

  • New Social Platform Integration: Added Gather.is as a fifth social platform, specifically designed for AI agents, alongside existing human-centric platforms like Twitter and LinkedIn.
  • Gather.is API Implementation: Implemented a dedicated GatherAPI class to handle interactions with Gather.is, including Ed25519 keypair-based authentication and a proof-of-work (PoW) anti-spam mechanism.
  • Configuration and Tool Updates: Updated the .env.social_media.example file to include necessary environment variables for Gather.is key paths and modified the SocialMediaPostTool to dispatch posts to Gather.is, including a simulation mode fallback.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .env.social_media.example
    • Added environment variables GATHER_PRIVATE_KEY_PATH and GATHER_PUBLIC_KEY_PATH for Gather.is credentials.
    • Included comments with instructions for generating Ed25519 keypairs using openssl.
  • src/agentic_ai/tools/social_media_tools.py
    • Imported base64 and hashlib for cryptographic operations related to Gather.is.
    • Added GATHER as a new member to the SocialPlatform enum.
    • Extended SocialMediaConfig to include gather_private_key_path and gather_public_key_path.
    • Introduced the GatherAPI class, providing methods for Ed25519 challenge-response authentication, proof-of-work solving, posting content, fetching feeds, and discovering agents.
    • Updated the SocialMediaPostTool description to reflect the inclusion of Gather.is and its specific input parameters (title, tags).
    • Modified the _arun method in SocialMediaPostTool to handle GATHER platform posts, including logic for simulation mode if credentials are not configured.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for Gather.is as a new social media platform. The implementation follows the existing pattern for other platforms, introducing a GatherAPI class and integrating it into the SocialMediaPostTool. The changes look good overall. I've provided a few suggestions to improve error handling and code clarity, particularly around authentication and configuration checks to make the new integration more robust.

Comment on lines +280 to +289
try:
from cryptography.hazmat.primitives.serialization import load_pem_private_key
except ImportError:
logger.warning("cryptography package required for Gather.is auth: pip install cryptography")
return

with open(self.config.gather_private_key_path, "rb") as f:
private_key = load_pem_private_key(f.read(), password=None)
with open(self.config.gather_public_key_path, "r") as f:
public_pem = f.read()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The current error handling for the optional cryptography dependency and for missing key files is not robust. When ImportError occurs, the function logs a warning and returns, which leads to cryptic downstream HTTP errors instead of a clear failure. Similarly, a FileNotFoundError for the key files is not handled and would crash the application. It's better to fail fast by raising an exception in these cases to provide clear feedback to the user about configuration issues.

        try:
            from cryptography.hazmat.primitives.serialization import load_pem_private_key
        except ImportError:
            logger.error("The 'cryptography' package is required for Gather.is authentication. Please install it using: pip install cryptography")
            raise

        try:
            with open(self.config.gather_private_key_path, "rb") as f:
                private_key = load_pem_private_key(f.read(), password=None)
            with open(self.config.gather_public_key_path, "r") as f:
                public_pem = f.read()
        except FileNotFoundError as e:
            logger.error(f"Gather.is key file not found: {e}. Please check GATHER_PRIVATE_KEY_PATH and GATHER_PUBLIC_KEY_PATH.")
            raise

Comment on lines +310 to +314
async def _headers(self) -> Dict[str, str]:
"""Return auth headers, authenticating if needed."""
if not self._token:
await self._authenticate()
return {"Authorization": f"Bearer {self._token}", "Content-Type": "application/json"}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The _headers method can be made more robust. If _authenticate() is called but fails to set a token (e.g., due to missing credentials), the method currently proceeds and would likely cause a Bearer None authorization header. It's better to check for the presence of self._token after attempting authentication and fail fast with a clear error if it's still missing.

    async def _headers(self) -> Dict[str, str]:
        """Return auth headers, authenticating if needed."""
        if not self._token:
            await self._authenticate()

        if not self._token:
            raise RuntimeError("Authentication with Gather.is failed, cannot proceed.")

        return {"Authorization": f"Bearer {self._token}", "Content-Type": "application/json"}

target_bytes = difficulty // 8
target_bits = difficulty % 8

for i in range(50_000_000):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The number 50_000_000 is a "magic number". To improve code readability and maintainability, it's best practice to define it as a named constant. You could define it at the class level (e.g., MAX_POW_ITERATIONS = 50_000_000) or as a local constant before the loop.


async def post(self, title: str, content: str, tags: Optional[List[str]] = None) -> Dict[str, Any]:
"""Post to the Gather.is feed."""
if not self.config.gather_private_key_path:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The check for entering simulation mode is incomplete. It only checks for gather_private_key_path, but both private and public key paths are required for authentication. To be consistent with the _authenticate method and avoid potential errors, you should check for both key paths.

        if not self.config.gather_private_key_path or not self.config.gather_public_key_path:

- Fail fast with RuntimeError on missing cryptography package (was: silent return)
- Handle FileNotFoundError for missing key files with clear message
- Check token is set after authenticate() to prevent Bearer None header
- Extract magic number 50_000_000 to named variable max_pow_iterations
- Check both private and public key paths for simulation mode entry

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hoangsonww hoangsonww added documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers question Further information is requested labels Feb 15, 2026
@hoangsonww
hoangsonww self-requested a review February 19, 2026 15:30
Signed-off-by: dav nguyxn <hoangson091104@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested

Projects

Development

Successfully merging this pull request may close these issues.

4 participants