Skip to main content

Babelagent

PyPI Docs DOI License: MIT

The Babel that lets AI agents understand each other. One shared tongue for agents that were never meant to talk.

Every agent framework has its own idea of what an agent is. LangChain has Runnables with .invoke, CrewAI has Crews with .kickoff, AutoGen has agents with .generate_reply, an LLM has messages.create, a microservice has an HTTP route. None of them agree on a shape, so connecting any two means writing glue.

Babelagent is the neutral layer in between. You bring your own agents, whatever they are (a callable, an HTTP/OpenAPI endpoint, an MCP tool, a framework agent, or an LLM), and it wraps each one in a single shared interface so they can exchange messages and collaborate on a task, agent-to-agent (A2A). The value is not any single adapter. It is that once something is adapted, it works with everything else you have adapted.

The headline is adapt(): hand Babelagent almost anything and it builds the connector on the fly.

import asyncio
from babelagent import Graph

async def main():
    graph = (
        Graph()
        .node("clean",   str.strip)
        .node("shout",   str.upper)
        .node("exclaim", lambda s: s + "!")
    )
    result = await graph.run("  hello  ")
    print(result.output)   # "HELLO!"

asyncio.run(main())

Let different agents work in parallel and hand their results to each other, with barrier policies on the join:

from babelagent import Graph, adapt

g = Graph()
g.node("src",     lambda text: text)
g.node("summary", adapt(langchain_agent), after=["src"])   # a LangChain agent
g.node("labels",  adapt("https://api.example.com/classify"), after=["src"])  # an HTTP service
# merge receives {"summary": ..., "labels": ...} keyed by node name (>=2 upstreams)
g.join("merge", after=["summary", "labels"], agent=combine, barrier="all")
result = await g.run(document)

Concepts

Concept What it is
Graph Builds the network of agents (linear chaining and a DAG API)
CompiledGraph The validated, runnable graph; await graph.run(payload)
Node One participant: an agent plus an optional quality check/gate
Agent The uniform async run(message, ctx) -> message interface
adapt() Turns any brought object into an Agent, inferring the adapter
Message / Result The envelope agents exchange / the final output + run trace
Barrier Fan-in join policy: all · k_of_n · optional

Install

pip install babelagent                 # light base (callables + HTTP)
pip install "babelagent[mcp]"          # MCP tools
pip install "babelagent[cloud]"        # Anthropic / OpenAI
pip install "babelagent[ollama]"       # local models
pip install "babelagent[frameworks]"   # LangChain (CrewAI/AutoGen detected if installed)
pip install "babelagent[serve]"        # REST service
pip install "babelagent[all]"

Try it (no API key)

babelagent demo      # a broken agent (gated FAIL) then a fixed one (PASS)
babelagent doctor    # which adapter families are available
babelagent inspect   # print a graph's topology as JSON

Cite

If you use Babelagent, please cite it (concept DOI, always resolves to the latest version):

Amit Patole. Babelagent. https://doi.org/10.5281/zenodo.22129957

A machine-readable CITATION.cff is in the repo.

Status

Alpha, in active development. MIT licensed.

— amitpatole

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

babelagent-0.1.1.tar.gz (69.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

babelagent-0.1.1-py3-none-any.whl (43.2 kB view details)

Uploaded Python 3

File details

Details for the file babelagent-0.1.1.tar.gz.

File metadata

  • Download URL: babelagent-0.1.1.tar.gz
  • Upload date:
  • Size: 69.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for babelagent-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e86502a6753074d3dc69de3600405758fb3fb44e1dd22607ebf675cf64045c2b
MD5 9754da012d1ae2d62479659d42dcdcb9
BLAKE2b-256 d1c35d1b442615f9a73f64b555f00d5df3d998a3a4e25f11afbe0b19a861eb6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for babelagent-0.1.1.tar.gz:

Publisher: publish.yml on amitpatole/babelagent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file babelagent-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: babelagent-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 43.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for babelagent-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f6ac77fcc8c93a519bc81f1f9b8731fc7351bd7fa5493aae90c13b42082e70b3
MD5 4dfbccc71103ac0b12478e1725d1171c
BLAKE2b-256 2dc29075c4ed16ee9e08aceb0dbdf7a43acbb666d657700f38e18f322e1afcf5

See more details on using hashes here.

Provenance

The following attestation bundles were made for babelagent-0.1.1-py3-none-any.whl:

Publisher: publish.yml on amitpatole/babelagent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.3

2 files

0.1.2

2 files

This release

0.1.1 This release

2 files

0.1.0

2 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