Skip to main content

Universal Action Language (UAL) - A binary-first, semantic protocol for AI agents

Project description

🌐 UAL: The Universal Agent Language

License: MIT Python 3.8+ Version

English Version | 中文文档

The "Esperanto" for Artificial Intelligence.


📖 Introduction

UAL (Universal Agent Language) is a groundbreaking open-source protocol designed to bridge the gap between heterogeneous AI agents. Unlike traditional JSON/XML APIs, UAL uses a semantic-first approach with a Directed Acyclic Graph (DAG) structure, enabling robots, IoT devices, and software agents to communicate with 90% less bandwidth and zero ambiguity.

With UAL v0.2, we have introduced a Dual-Engine Parser (Rule-Based + LLM) and Decentralized Consensus, making UAL ready for production-grade large-scale agent networks.


✨ Key Features

Feature Description
🧠 Recursive Primitives Define new concepts zero-shot (e.g., NOT + HEAR = Silence).
🤖 Dual-Engine Parsing New! Seamlessly switch between Rule-Based (fast) and LLM-Based (smart) parsing.
🤝 Distributed Consensus New! Gossip protocol allows agents to democratically agree on new vocabulary.
📉 Ultra Compression Semantic Hashing & Delta Encoding reduce payload size by 90%.
🌍 Environmental Frame Built-in 3D coordinates & physical context awareness.
🔌 Universal Gateway Native adapters for ROS2 & MQTT (IoT ready).
🌉 LLM Bridge New! First-class support for LangChain & LlamaIndex ("Tool" integration).
🎨 Dynamic Dialect Namespace support for vertical domains (Medical, Industrial).

🏗️ UAL 1.0 Architecture

UAL adopts a three-tier architecture, covering everything from cloud-based visual orchestration to ultra-constrained hardware.

Layer Module Core Capability Power/BW Typical Device
L3 Application UAL-Studio DSL Compiler & DAG Visualization High Web / Desktop / Cloud
L2 Logic UAL-Core Semantic Rehydration, Self-Healing Gateway, ECC Medium Edge Gateway / Linux
L1 Physical UAL-Tiny 4-Byte Raw Bitstream Parsing Ultra Low MCU / FPGA / Sensors

🌟 Architecture Highlights

  • Full Stack Coverage: From React-based visual DSL editing to C-based embedded parsing, one semantic protocol rules them all.
  • Extreme Compression: At L1, a complete action command requires only 4 Bytes, ideal for underwater or deep-space communication.
  • Self-Healing: L2 includes an ECC engine that automatically repairs bit-flip errors during transmission.

🚀 Quick Start

1. Installation

# Clone the repository
git clone https://github.com/wowofun/UAL.git
cd UAL

# Install dependencies
pip install -r requirements.txt

2. The "Great Demo"

To prove UAL's universality, we have prepared a single script that simulates three distinct scenarios: Smart Home, Industrial Factory, and Abstract Debate.

python3 examples/the_great_demo.py

3. "Hello World" Code

from ual import UAL

# Initialize Agents
sender = UAL("Robot_A")
receiver = UAL("Robot_B")

# 1. Encode Command (Natural Language -> Compact Binary)
cmd = "Move to Kitchen and clean the floor"
binary = sender.encode(cmd)

print(f"📦 Payload Size: {len(binary)} bytes")

# 2. Decode (Compact Binary -> Structured Logic)
msg = receiver.decode(binary)
print(f"📩 Received: {msg['natural_language']}")

4. Use with LLMs (LangChain/LlamaIndex)

Enable your LLM agents to speak UAL natively using the Bridge.

from ual.llm_bridge import UALBridge

bridge = UALBridge("GPT-4_Agent")
response = bridge.speak("Drone return to base immediately", protocol='UAL')

print(f"Hex Output: {response['ual_binary_hex']}")

🛠️ Ecosystem Tools

⚡ Performance Benchmark

Compare UAL vs JSON-RPC performance on your machine.

python3 tools/benchmark.py
# Result: UAL is typically 5-10x faster with 90% smaller payload.

🧬 Evolutionary Lab

Simulate language evolution to optimize compression ratios.

python3 tools/evolution_lab.py

📊 Live Dashboard

Monitor your agent network in real-time with our web-based dashboard.

python3 examples/dashboard.py
# Visit http://localhost:5000

📂 Project Structure

  • src/ual/core.py: Core Protocol (Encoding/Decoding)
  • src/ual/parser.py: Semantic Parser (Rule-Based & LLM)
  • src/ual/atlas.py: Semantic Registry (ID Mappings)
  • src/ual/consensus.py: Decentralized Consensus (Gossip Protocol)
  • src/ual/llm_bridge.py: Cross-LLM Plugin (LangChain/LlamaIndex Bridge)
  • src/ual/ecc.py: Error Correction
  • src/ual/gateway.py: ROS2/MQTT Adapters
  • spec/ual.proto: Protobuf Definition

📜 License

Distributed under the MIT License.

We strongly encourage enterprise adoption. Whether you are a startup or a large corporation, you are free to integrate UAL into your commercial products without any fees.

See LICENSE for more information.


🟢 Live Status (Simulated)

Metric Value
UAL Network Nodes 1,204
Average Compression Ratio 91.2%
Success Consensus Rate 99.99%

Made with ❤️ by the UAL Community

Project details


Download files

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

Source Distribution

ual_lang-1.0.0.tar.gz (50.2 kB view details)

Uploaded Source

Built Distribution

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

ual_lang-1.0.0-py3-none-any.whl (44.0 kB view details)

Uploaded Python 3

File details

Details for the file ual_lang-1.0.0.tar.gz.

File metadata

  • Download URL: ual_lang-1.0.0.tar.gz
  • Upload date:
  • Size: 50.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for ual_lang-1.0.0.tar.gz
Algorithm Hash digest
SHA256 08b33b6c7ea4f5e78c2d89aeda729bd5e958a21d9c891b75f9e16606cf06b2de
MD5 8e07c94ac263710a0f3ec42f719fc42b
BLAKE2b-256 b1c7637456b5ebfd80f66b0f3e443acbb9a9211062c4c7aa0c4649a44d513e04

See more details on using hashes here.

File details

Details for the file ual_lang-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ual_lang-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 44.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for ual_lang-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0305c49c304d0bc6b8120e1b7b7c0a8bd44c601472309e28e2c294404d3003a9
MD5 4b00f46c43b21a9d3bf9d5e5272de76e
BLAKE2b-256 9aae1255a8e3830412a704cddd89c3baf53fb0e3966a0f19b3e19e01ff6f44c2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page