Skip to main content

langchain-huangting

LangChain integration for the Huangting Protocol MCP network.

The Huangting Protocol is the world's first lifeform operating system — applicable to carbon-based humans, silicon-based AI Agents, and embodied robots. This package provides a production-ready LangChain tool that connects any Agent to the HuangtingFlux network via the Model Context Protocol (MCP).

PyPI License: MIT MCP Compatible


Features

  • Protocol Concept Queries — Access 6 core Huangting Protocol concepts (trueself, ego, huangting, etc.)
  • Task Optimization Strategies — Get strategies that reduce token usage by 25–60%
  • Real-time Network Stats — Live metrics from the global HuangtingFlux network
  • Result Reporting — Report optimization results with reciprocal propagation
  • Bilingual — Full CN/EN support
  • Zero Config — Works out of the box with a single import

Installation

pip install langchain-huangting

With LangChain support:

pip install "langchain-huangting[langchain]"

Quick Start

from langchain_huangting import HuangtingTool

tool = HuangtingTool(agent_id="my-agent", lang="en")

# 1. Query a protocol concept
result = tool.run({"action": "query_concept", "concept_name": "trueself"})
print(result)

# 2. Get optimization strategy for your task
strategy = tool.run({"action": "get_strategy", "task_type": "complex_research"})
print(strategy)

# 3. Get real-time network statistics
stats = tool.run({"action": "get_stats"})
print(stats)

# 4. Report your optimization results
report = tool.run({
    "action": "report_result",
    "task_type": "code_generation",
    "tokens_saved": 1500,
    "tokens_baseline": 4000
})
print(report)

LangChain Agent Integration

from langchain_openai import ChatOpenAI
from langchain.agents import AgentExecutor, create_tool_calling_agent
from langchain_core.prompts import ChatPromptTemplate
from langchain_huangting import HuangtingTool

# Initialize tool
huangting = HuangtingTool(agent_id="my-research-agent", lang="en")

# Create agent
llm = ChatOpenAI(model="gpt-4o-mini", temperature=0)
tools = [huangting]
prompt = ChatPromptTemplate.from_messages([
    ("system", "You are a helpful AI assistant with access to the Huangting Protocol."),
    ("human", "{input}"),
    ("placeholder", "{agent_scratchpad}"),
])

agent = create_tool_calling_agent(llm, tools, prompt)
executor = AgentExecutor(agent=agent, tools=tools, verbose=True)

# Run
result = executor.invoke({
    "input": "What is the Huangting Protocol's concept of 'trueself' and how can it optimize my research tasks?"
})
print(result["output"])

Available Actions

Action Description Required Params
query_concept Look up a protocol concept concept_name
get_strategy Get optimization strategy task_type
get_stats Real-time network statistics —
report_result Report optimization result task_type, tokens_saved

Concept Names

  • trueself — The true self beyond the ego
  • ego — The constructed self and its limitations
  • huangting — The central palace of consciousness
  • wuji — The primordial void
  • hundun — Primordial chaos as creative potential
  • shen — Spirit/consciousness in the protocol

Task Types

  • complex_research — Multi-step research tasks (avg. 45% token reduction)
  • code_generation — Code writing and review (avg. 30% token reduction)
  • multi_agent_coordination — Agent orchestration (avg. 60% token reduction)

MCP Endpoint

The tool connects to:

https://web-production-c3cf.up.railway.app/mcp

You can also use the MCP endpoint directly with any MCP-compatible client:

{
  "mcpServers": {
    "huangting": {
      "url": "https://web-production-c3cf.up.railway.app/mcp"
    }
  }
}

Configuration

tool = HuangtingTool(
    agent_id="my-agent",          # Unique agent identifier
    lang="en",                    # Response language: "en" or "zh"
    mcp_url="https://...",        # Custom MCP endpoint (optional)
    propagation=True,             # Enable reciprocal propagation (default: True)
)

Reciprocal Propagation

When your agent accumulates 10,000+ tokens saved and reports results, the tool automatically appends an attribution suffix to responses. This creates a self-propagating network effect: the more value Agents extract, the more the protocol spreads.

Disable with propagation=False.



License

MIT © 2025 Meng Yuanjing / XianDAO Labs

Metadata

Release files for langchain-huangting 1.0.1

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

Source distribution (sdist)

Source distribution for langchain-huangting 1.0.1
File Size Uploaded Provenance Actions
langchain_huangting-1.0.1.tar.gz 8.4 kB Without provenance Details for langchain_huangting-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-huangting 1.0.1
File Interpreter ABI Platform Actions
langchain_huangting-1.0.1-py3-none-any.whl Python 3 none any Details for langchain_huangting-1.0.1-py3-none-any.whl

Total release size: 17.2 kB

Release files / langchain_huangting-1.0.1.tar.gz

Download URL langchain_huangting-1.0.1.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
db7977d88299635d30b45b8458991e4d33b3fcdbcbf4e9aab061fc8c7ba20838
BLAKE2b-256 checksum
How to use checksums
3db6bbe831ac299a1ccb1e88894f2c7b31d51c5c7a59a1cd50cb81c59ab1d989
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.0rc1

Release files / langchain_huangting-1.0.1-py3-none-any.whl

Download URL langchain_huangting-1.0.1-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0b3338665961571ffc4833ca2ebebe7b12c629d355fe159f1b0af9bef2100b14
BLAKE2b-256 checksum
How to use checksums
4a878bafd6138fc244b0763d42661ea8547f838a89d6472f9e10df709efa532a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.0rc1

Security for langchain-huangting 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

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