Universal Action Language (UAL) - A binary-first, semantic protocol for AI agents
Project description
🌐 UAL: The Universal Agent Language
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). |
🚀 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 Correctionsrc/ual/gateway.py: ROS2/MQTT Adaptersspec/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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ual_lang-0.1.0.tar.gz.
File metadata
- Download URL: ual_lang-0.1.0.tar.gz
- Upload date:
- Size: 45.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a831eabe1d7f272918000af467e379ad4a510610a202bf27d26640d01159d41
|
|
| MD5 |
1f1be548c4cb27c3b2f33f6f7f3ecc05
|
|
| BLAKE2b-256 |
118575f77f892ab518ccb4f064600188cbbfe5eea379c1a1e984ea7f9bc8e1b1
|
File details
Details for the file ual_lang-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ual_lang-0.1.0-py3-none-any.whl
- Upload date:
- Size: 40.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2908f48984e5a4d4fa7cf19a5d8dc07dbba3565f70e35d88ae11746591153988
|
|
| MD5 |
568acada1ac1e046783f717466bc004e
|
|
| BLAKE2b-256 |
3952c5cc891d639855e573fdeef0aa179a2b18816bd3324725e8be5677f839a6
|