Skip to content

[Feature]: LINE Messaging Platform Adapter #6081

@kuei790802

Description

@kuei790802

Problem or Use Case

Summary

Add a LINE Messaging API gateway adapter for Hermes Agent.

Motivation

LINE has over 200M monthly active users across Asia and is the dominant messaging platform in Taiwan, Japan, and Thailand, but Hermes Agent currently does not support it as a gateway platform.

I’m building a LINE bot for a family insurance brokerage business in Taiwan, so this is not just a theoretical integration.
I have a real production use case to validate it end-to-end.

Proposed Solution

Add a native LINE Messaging API adapter under gateway/platforms/line.py, following the existing gateway platform adapter pattern.

The implementation would likely:

  • accept LINE webhook events
  • verify the X-Line-Signature header before processing
  • normalize incoming LINE events into Hermes gateway message handling
  • use reply tokens for standard replies
  • fall back to the Push Message API when a reply token has expired
  • support basic access control via LINE_ALLOWED_USERS

Likely files involved:

  • gateway/platforms/line.py
  • gateway/run.py
  • gateway/config.py
  • .env.example
  • tests/test_line_adapter.py
  • website/docs/user-guide/messaging/line.md
  • potentially pyproject.toml for an optional LINE SDK dependency

Potential environment variables:

  • LINE_CHANNEL_SECRET
  • LINE_CHANNEL_ACCESS_TOKEN
  • LINE_ALLOWED_USERS

Alternatives Considered

I considered a few alternatives:

  1. Using the existing Webhook adapter as a workaround

    • This might work for a one-off use case, but it would duplicate gateway logic instead of integrating cleanly with Hermes' existing platform architecture.
  2. Waiting to see if someone else implements it

    • I checked the current Issues list and didn’t find an existing feature request for LINE gateway support.
  3. Not adding LINE support at all

    • That would keep the gateway simpler, but it would leave out a major messaging platform in Asia.

Because Hermes already has a multi-platform gateway architecture, a native LINE adapter seems like the most maintainable approach.

Feature Type

Gateway / messaging improvement

Scope

Large (new module or significant refactor)

Contribution

  • I'd like to implement this myself and submit a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions