Skip to main content

converger-agent

Agent SDK for Converger: one Python process serves every conversation routed to a websocket bot channel (WhatsApp, Telegram, the web widget, ...) over a single channel-scoped Protocol v1 socket. Turns come in; text, rich messages, token streams, tool traces, GenUI and interrupts go out. A first-party LangChain / LangGraph adapter is included.

Documentation: https://converger.aimtune.dev/sdk/agent-python.

pip install converger-agent                # core: websockets only
pip install 'converger-agent[langchain]'   # + the LangChain / LangGraph adapter

Python 3.10 or later (LangGraph interrupts need 3.11 or later).

Quick start

import asyncio
from converger_agent import Agent

agent = Agent("https://chat.example.com", channel_secret="...")  # the bot channel's secret, server side only

@agent.on_turn
async def handle(turn, reply):
    if turn.text.lower() == "refund":
        answer = await reply.ask({"title": "Refund 249.90 TRY?"}, ["Yes", "No"])
        await reply.text(f"You said {answer}.")
        return
    async with reply.stream() as s:          # streamed as GenUI text chunks
        for word in ["Hello", " from", " Python"]:
            await s.write(word)

asyncio.run(agent.run())                      # reconnects forever; agent.stop() ends it

LangChain / LangGraph

from converger_agent.langchain import serve

agent = serve(graph, url="https://chat.example.com", channel_secret="...")
asyncio.run(agent.run())

Token deltas become a stream, tool runs become tool_call traces, LangGraph interrupt() becomes an interrupt whose answer resumes the graph (Command(resume=...)), and the thread id is the conversation id. bridge_langserve("https://my-langserve/app") serves a runnable that LangServe already exposes.

Testing your agent

converger_agent.testing.FakeServer is an in-process fake of the channel-scoped endpoint:

from converger_agent.testing import FakeServer

server = await FakeServer().start()
agent = Agent(server.url, token="test")
...
await server.user_text("conv-1", "hi")
await server.wait_frame("run", "conv-1", data__status="finished")

Development

pip install -e '.[test,langchain]'
python -m pytest

The tests validate every frame the agent sends against the protocol JSON Schemas in priv/protocol/v1. The end-to-end test against a real server runs with packages/conformance/integration/run.sh agent-python.

Metadata

Release files for converger-agent 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for converger-agent 0.1.0
File Size Uploaded
converger_agent-0.1.0.tar.gz 34.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for converger-agent 0.1.0
File Interpreter ABI Platform
converger_agent-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 62.1 kB

Release files / converger_agent-0.1.0.tar.gz

Download URL converger_agent-0.1.0.tar.gz
Size 34.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c97f734e0e5652d06bd15a4935fee354a7adf2c07599ccbd6b8c45dfb59acbaa
BLAKE2b-256 checksum
How to use checksums
67238071baf93b5f21290cbe5832e620bc426fab7187a33d4aec72df0b607cae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / converger_agent-0.1.0-py3-none-any.whl

Download URL converger_agent-0.1.0-py3-none-any.whl
Size 28.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e267e699066189745eb0dc91c7815846a0e42127046ae6c4cca8ec74dea79c19
BLAKE2b-256 checksum
How to use checksums
276a5d4c398a35e6fcccd0c18658d2f712723d2a8d6f491ad5fff3ae0821e641
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page