Vector-Integrated Binary Extension - Semantic
Ultra-lightweight 24-bit protocol for machine-to-machine communication with semantic context.
VIBE-S is a compact binary protocol designed to provide semantic context in machine-to-machine communication while maintaining an extremely small footprint of just 24 bits (3 bytes).
[MODE:1][SRC:3][TYPE:3][INTENT:3][DOMAIN:4][SEC:2][PRIORITY:3][ACTION_HINT:3][RSV:2] = 24 bits
| Field | Bits | Position | Description |
|---|---|---|---|
| MODE | 1 | 23 | Core (0) or Extended (1) mode |
| SRC | 3 | 22-20 | Source of the message |
| TYPE | 3 | 19-17 | Message type |
| INTENT | 3 | 16-14 | Sender's intent |
| DOMAIN | 4 | 13-10 | Application domain |
| SEC | 2 | 9-8 | Security level |
| PRIORITY | 3 | 7-5 | Message priority |
| ACTION_HINT | 3 | 4-2 | Expected action from receiver |
| RSV | 2 | 1-0 | Reserved for future use |
0- Core Mode1- Extended Mode
000- Human001- AI Model010- System011- Sensor100- Hybrid101- External110- Unknown111- Reserved
000- Query001- Request010- Info011- Alert100- Command101- Comment110- Plan111- Emotion
000- Learn001- Request Action010- Command011- Warn100- Discuss101- Solve110- Inform111- Confirm
0000- General0001- Finance0010- Health0011- IoT0100- Software0101- AI0110- Education0111- Social1000- Legal1001- Security1010- Logistics1011- Energy1100- Commerce1101- Media1110- Science1111- Extended
00- Safe01- Suspicious10- Verified11- Unknown
000- None001- Low010- Normal011- High100- Urgent101- Critical110- Emergency111- Reserved
000- Info Only001- Interpretable010- Processing Required011- Response Expected100- Decision Required101- Action Required110- Urgent Action111- Reserved
No external dependencies required. Simply copy vibe_s.py to your project.
# Clone or download the repository
git clone <repository-url>
cd vibe-s
# Run tests
python test_vibe_s.pyfrom vibe_s import encode_vibe_s, Mode, Source, Type, Intent, Domain, Security, Priority, ActionHint
# Encode a message header
header = encode_vibe_s(
mode=Mode.CORE,
src=Source.AI_MODEL,
type_=Type.COMMAND,
intent=Intent.COMMAND,
domain=Domain.FINANCE,
sec=Security.SAFE,
priority=Priority.HIGH,
action_hint=ActionHint.ACTION_REQUIRED
)
print(f"Encoded header: {header}") # Integer valuefrom vibe_s import decode_vibe_s
# Decode a header
decoded = decode_vibe_s(header)
print(f"Source: {decoded['src_name']}")
print(f"Type: {decoded['type_name']}")
print(f"Domain: {decoded['domain_name']}")
print(f"Priority: {decoded['priority_name']}")from vibe_s import to_binary_string, to_hex, format_header
# Convert to binary string (24 chars)
binary = to_binary_string(header)
print(f"Binary: {binary}")
# Convert to hexadecimal
hex_value = to_hex(header)
print(f"Hex: {hex_value}")
# Format with field boundaries
formatted = format_header(header)
print(f"Formatted: {formatted}")from vibe_s import print_header_info
# Print complete header analysis
print_header_info(header, "Financial Transfer Command")Message: "Transfer 500 USD to account X"
Context: AI Model executing a financial transaction
header = encode_vibe_s(
mode=Mode.CORE,
src=Source.AI_MODEL, # AI Model
type_=Type.COMMAND, # Command
intent=Intent.COMMAND, # Command
domain=Domain.FINANCE, # Finance
sec=Security.SAFE, # Safe
priority=Priority.HIGH, # High
action_hint=ActionHint.ACTION_REQUIRED # Action Required
)Output:
- Header (int): 2253680
- Header (hex): 0x225F70
- Binary:
001000100101111101110000
Message: "Temperature is 28°C"
Context: Temperature sensor reporting current reading
header = encode_vibe_s(
mode=Mode.CORE,
src=Source.SENSOR, # Sensor
type_=Type.INFO, # Info
intent=Intent.INFORM, # Inform
domain=Domain.IOT, # IoT
sec=Security.SAFE, # Safe
priority=Priority.NORMAL, # Normal
action_hint=ActionHint.PROCESSING_REQUIRED # Processing Required
)Output: Output:
- Header (int): 1875544
- Header (hex): 0x1C9E48
- Binary:
000111001001111001001000
Message: "Click here for free money"
Context: Unknown source sending potentially malicious content
header = encode_vibe_s(
mode=Mode.CORE,
src=Source.UNKNOWN, # Unknown
type_=Type.REQUEST, # Request
intent=Intent.REQUEST_ACTION, # Request Action
domain=Domain.SOCIAL, # Social
sec=Security.SUSPICIOUS, # Suspicious
priority=Priority.LOW, # Low
action_hint=ActionHint.INFO_ONLY # Info Only
)Output:
- Header (int): 3195456
- Header (hex): 0x30C340
- Binary:
001100001100001101000000
The test suite includes unit tests and scenario demonstrations:
# Run all tests with detailed output
python test_vibe_s.py
# Run only unit tests
python -m unittest test_vibe_s.TestVibesProtocolFor a step-by-step demonstration that shows exactly what gets encoded and decoded, run the detailed demo:
# Run detailed demonstration
python demo_vibe_s.pyThis demonstration provides:
- Complete encode/decode visualization for each scenario
- Step-by-step breakdown of what happens during encoding
- Binary field mapping showing which bits represent which fields
- Verification that decode recovers the exact same values
- Turkish language explanations for better understanding
Perfect for presentations, documentation, or learning how the protocol works internally!
Encode VIBE-S protocol header to 24-bit integer.
Parameters:
mode: Core (0) or Extended (1) modesrc: Source type (0-7)type_: Message type (0-7)intent: Intent type (0-7)domain: Domain category (0-15)sec: Security level (0-3)priority: Priority level (0-7)action_hint: Action hint type (0-7)rsv: Reserved bits (default: 0)
Returns: 24-bit integer
Decode 24-bit VIBE-S header to dictionary.
Parameters:
header: 24-bit integer header
Returns: Dictionary with decoded fields and their names
Convert 24-bit header to binary string representation.
Returns: 24-character binary string
Convert 24-bit header to hexadecimal string.
Returns: 6-character hex string (with 0x prefix)
Format header with field boundaries for visualization.
Returns: Formatted binary string with field separators
Print detailed header information including all decoded fields.
- Ultra-Compact: Only 24 bits (3 bytes) overhead
- Semantic Rich: Provides context about source, intent, domain, and required action
- Security Aware: Built-in security level classification
- Priority Support: 8 priority levels from None to Emergency
- Machine Readable: Easy to parse and process by machines
- Human Understandable: Clear field names and values
- IoT Communication: Efficient sensor data transmission with context
- AI Systems: Inter-AI communication with intent and domain information
- Microservices: Lightweight service-to-service messaging
- Edge Computing: Minimal overhead for resource-constrained devices
- Security Systems: Built-in security classification for threat detection
- Real-time Systems: Priority-based message handling
- Bandwidth Efficient: Only 3 bytes per message header
- Low Latency: Fast encoding/decoding operations
- Context Aware: Rich semantic information for intelligent routing
- Security Classification: Immediate identification of suspicious content
- Priority Routing: Support for priority-based message queuing
- Extensible: Reserved bits and extended mode for future enhancements
- Extended mode implementation for additional fields
- Network protocol integration (TCP/IP, UDP, MQTT)
- Hardware implementations for embedded systems
- Compression algorithms for bulk transmission
- Machine learning integration for automatic classification
MIT License
Copyright (c) 2025 Uğur Kandemiş
Permission is hereby granted, free of charge, to any person obtaining a copy...
Contributions are welcome! Please feel free to submit pull requests or open issues.
Uğur KANDEMİŞ ugurkandemis@aof.anadolu.edu.tr ugurkandemis@gmail.com
Version: 1.0.0 Last Updated: 2026-01-22