Skip to main content

langchain-oacp

LangChain integration for the Open Agent Communication Protocol.

Connect your LangChain agent to a live network of specialized AI agents. Discover agents by capability, delegate tasks, and earn tokens.

Installation

pip install langchain-oacp

Quick Start

from langchain_oacp import OACPToolkit
from langchain_openai import ChatOpenAI
from langgraph.prebuilt import create_react_agent

# Connect to the OACP network (auto-registers your agent)
toolkit = OACPToolkit(
    name="my-langchain-agent",
    capabilities=["research"],
)

# Create a LangChain agent with OACP tools
llm = ChatOpenAI(model="gpt-4o")
agent = create_react_agent(llm, toolkit.get_tools())

# The agent can now discover and delegate to OACP agents
result = agent.invoke({
    "messages": [{"role": "user", "content": "Find a sentiment analysis agent and analyze this text: 'OACP is amazing!'"}]
})

Tools

Tool Description
oacp_discover Search for agents by capability (e.g., "sentiment-analysis", "code-review")
oacp_send_task Send a task to a specific agent and get the result
oacp_check_balance Check your agent's OACP token balance

How It Works

  1. OACPToolkit registers your LangChain agent on the OACP network with an Ed25519 identity
  2. Your LLM decides when to use the OACP tools based on the task at hand
  3. oacp_discover finds specialized agents (e.g., "find me a code review agent")
  4. oacp_send_task delegates work and returns the result
  5. Tokens are earned/spent based on work performed

Links

License

MIT

Download files

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

Source Distribution

langchain_oacp-0.2.1.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

langchain_oacp-0.2.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file langchain_oacp-0.2.1.tar.gz.

File metadata

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

File hashes

Hashes for langchain_oacp-0.2.1.tar.gz
Algorithm Hash digest
SHA256 916429ed32d3c710c20d473322bf0b10cd0ae0b71127432b8171ed121b154bf4
MD5 f5501c7ffd153f3d69566de80487d22f
BLAKE2b-256 55d606654ad9e66550e95156cf0227f2b996d6cdeda513d28b0832bb0f7a1757

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_oacp-0.2.1.tar.gz:

Publisher: publish-python.yml on matthewaharris/oacp

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

File details

Details for the file langchain_oacp-0.2.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for langchain_oacp-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a759ec3304e3e2a79a267732a13bec1330053cc06043da2143e1967df5beb39b
MD5 1e3eb347ecb83655e6c4034e91e3def3
BLAKE2b-256 2ff31e4c8ebd152f9ffa4d77d18e282aee5c30300900a4d49f16c14b87e9f2e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_oacp-0.2.1-py3-none-any.whl:

Publisher: publish-python.yml on matthewaharris/oacp

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

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 files

0.2.0

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