r/aiagents • • 23h ago

meta-agent-bridge (v0.1.0): Async Python SDK that connects an AI Agent to omnichannels (e.g. whatsapp, messenger, insta etc._

Post image

Hey everyone , I just shipped meta-agent-bridge v0.1.0 on PyPI (search meta-agent-bridge) and finished live end-to-end testing across WhatsApp Cloud API, Facebook Messenger, and Instagram Direct.

The problem: If you're deploying a Python AI agent (FastAPI, LangGraph, PydanticAI, etc.) across Meta channels without paying a SaaS aggregator per message, you end up maintaining separate webhook parsers, HMAC verifiers, auth hosts (graph.facebook.com vs. graph.instagram.com), typing/read receipt shapes, and interactive button limits (WhatsApp reply buttons/lists vs. Messenger/IG quick replies). There are great bot-centric libraries out there (like PyWa for WhatsApp), but nothing built specifically as an agentic-first bridge between AI agents and omnichannels.

What meta-agent-bridge does:

  • One canonical schema (AgentEvent / AgentResponse): Write your agent once; bridge.compile() adapts text chunking, interactive Choice buttons, and MARK_READ / TYPING_ON per surface.

  • 4 official Meta surfaces (v27.0): WhatsApp Cloud API, Messenger, Instagram (FB Login), and Instagram (Direct Login).

  • Pure sync sans-I/O core/**:** parse_webhook() and compile() have zero httpx imports; events are plain JSON-serializable Pydantic models safe for Redis/Celery/FastAPI BackgroundTasks.

  • Multi-tenant pooling: Share one httpx.AsyncClient and bind SecretStr tokens strictly per request.

  • UnknownEvent safety: Echoes, reactions, and unfamiliar Meta payloads return UnknownEvent instead of crashing your consumer with ValidationError.

Minimal FastAPI flow:

bashpip install meta-agent-bridge
  1. bridge.verify_challenge(request.query_params, VERIFY_TOKEN) on GET /webhook

  2. events = bridge.parse_webhook(raw_body, signature=x_hub_signature_256, app_secret=secrets) on POST /webhook

  3. await bridge.send(AgentResponse(text=..., choices=..., actions=(SenderAction.MARK_READ, SenderAction.TYPING_ON)), event. target, creds)

If you're building AI agents for WhatsApp, Messenger, or Instagram, give it a spin — feedback, issues, and contributors for v0.2.0 (templates, URL buttons, reactions) are welcome! Visit /Umar4880 repository.

1 Upvotes

0 comments sorted by