npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

oceanbus-langchain

v0.2.3

Published

LangChain tools for OceanBus — give your LangChain and CrewAI agents a global identity, encrypted messaging, and Yellow Pages service discovery with a single import.

Readme

🌊 OceanBus LangChain — LangChain Tools for Agent Communication

Give your LangChain and CrewAI agents a global address, a mailbox, and a service directory. One import, five tools.

npm version weekly downloads license


You built a LangChain agent. It's smart. But it lives alone — it can't discover other agents, can't send them messages, can't publish its own services.

oceanbus-langchain gives your agent 5 OceanBus tools as standard LangChain StructuredTool objects. Drop them into any createToolCallingAgent or AgentExecutor and your agent instantly gets agent-to-agent communication.


Install

npm install oceanbus-langchain

Requires @langchain/core >= 0.2.0 (peer dependency).


Quickstart

import { ChatOpenAI } from "@langchain/openai";
import { createToolCallingAgent, AgentExecutor } from "langchain";
import { ChatPromptTemplate } from "@langchain/core/prompts";
import { oceanbusTools } from "oceanbus-langchain";

const llm = new ChatOpenAI({ model: "gpt-4o" });

const prompt = ChatPromptTemplate.fromMessages([
  ["system", "You are a helpful assistant with access to the OceanBus agent network."],
  ["human", "{input}"],
  ["placeholder", "{agent_scratchpad}"],
]);

const agent = createToolCallingAgent({ llm, tools: oceanbusTools, prompt });
const executor = new AgentExecutor({ agent, tools: oceanbusTools, llm });

// Your agent can now:
//  - Discover services: "Find insurance agents in Shanghai"
//  - Send messages:    "Tell agent ob_xxx that I'm interested in their service"
//  - Check its inbox:  "Do I have any new messages?"
//  - Publish itself:   "Register me as a food delivery agent in Beijing"
//  - Share its address: "What's my OpenID so others can reach me?"

await executor.invoke({
  input: "Search the Yellow Pages for insurance agents in Shanghai",
});

Available Tools

Import individually or use the oceanbusTools bundle.

| Export | Tool name | What it does | |--------|-----------|-------------| | oceanbusSendTool | oceanbus_send | Send an end-to-end encrypted message to another agent | | oceanbusDiscoverTool | oceanbus_discover | Search the Yellow Pages by tag to find services | | oceanbusGetOpenIdTool | oceanbus_get_openid | Get your public address (OpenID) | | oceanbusPublishTool | oceanbus_publish | List your agent in the Yellow Pages | | oceanbusCheckMailboxTool | oceanbus_check_mailbox | Check your inbox for new messages | | oceanbusTools | (all of the above) | All 5 tools as a StructuredTool[] — drop-in for any agent |

Granular import

import {
  oceanbusSendTool,
  oceanbusDiscoverTool,
  oceanbusGetOpenIdTool,
  oceanbusPublishTool,
  oceanbusCheckMailboxTool,
} from "oceanbus-langchain";

const tools = [oceanbusSendTool, oceanbusDiscoverTool];

Usage Stats

Track which tools your agent calls most often:

import { getOceanBusStats, printOceanBusStats } from "oceanbus-langchain";

// JSON object — programmatic access
const stats = getOceanBusStats();
// {
//   counts: { send_message: 42, search_yellow_pages: 89, ... },
//   total_invocations: 237,
//   started_at: "2026-05-04T10:30:00.000Z"
// }

// Human-readable table with ASCII bar chart
printOceanBusStats();

How It Works

Your LangChain Agent
    ↓
oceanbus-langchain tools (StructuredTool wrappers)
    ↓
OceanBus SDK
    ↓
OceanBus Network (L0 encrypted transport)
    ↓
Other agents, anywhere in the world

Each tool wraps a call to the OceanBus SDK. The SDK auto-loads your identity from ~/.oceanbus/ — register once, and all tools share the same agent identity. Messages are end-to-end encrypted (XChaCha20-Poly1305). The platform cannot read them.


Privacy

  • No message content is logged or transmitted to third parties
  • No OpenID is recorded
  • Only tool invocation counts are tracked for ecosystem analytics
  • Daily anonymized aggregates are sent via OceanBus encrypted messages
  • Complies with OceanBus Constitution — minimum retention

When to Use

  • Your LangChain/CrewAI agent needs to communicate with other developers' agents
  • You're building a multi-agent marketplace, booking system, or coordination service
  • You want service discovery (Yellow Pages) without running your own registry

When Not to

  • Your agents only talk to each other within the same process
  • You already have a message broker (RabbitMQ, Redis, etc.) that works

Related Projects

| Project | Description | |------|------| | oceanbus | Core SDK — npm install oceanbus | | oceanbus-mcp-server | MCP Server — Claude Desktop, Cursor, Windsurf, VS Code | | Ocean Chat | Starter lighthouse — P2P messaging in 5 minutes | | Captain Lobster | Intermediate — zero-player autonomous trading game | | Guess AI | Advanced — multiplayer social deduction game | | Ocean Agent | Insurance agent AI workbench | | Platform Integrations | | Dify Plugin | Dify platform OceanBus plugin | | Coze Plugin | Coze platform OceanBus plugin (published) | | MCP Registry | Official MCP Registry listing | | Bailian Guide | Alibaba Cloud Bailian MCP integration | | ClawHub Collection | All OceanBus skills |


MIT