OmniBridge is an AI-native binary protocol gateway: it parses known protocols at high speed and learns unknown ones automatically using an LLM, then persists the learned parser for future traffic.
If your data streams are evolving faster than hand-written decoders, OmniBridge gives you a practical way to keep up.
- ⚡ Fast path first: Known signatures route directly to existing parsers via a Trie-based dispatcher.
- 🧠 AI discovery mode: Unknown packets trigger LLM-assisted parser generation with Zero-Config Signature Detection.
- 🔁 Self-healing parsers: If a learned parser fails at runtime, OmniBridge attempts automatic repair by consulting the LLM with the error context.
- 💾 Persistent learning: Generated parsers are cached in-memory and saved in
./storagefor persistence. - 🔌 Provider flexibility: Works with Gemini (cloud) and Ollama (local).
- 🧪 Execution Safety: Dynamic parsers run with 50ms timeout protection and panic recovery to ensure system stability.
- Ingest: Raw bytes are received from simulation or TCP server modes.
- Dispatch: Using a Trie (Prefix Tree), the system performs a longest-prefix match on the incoming data to identify the protocol.
- Parse: If a parser exists, it is executed within the Dynamic Engine.
- Discover: On a cache miss, the AI identifies the signature and generates a Go
Parsefunction. - Cache + Persist: The new parser is compiled (via
yaegi), cached for performance, and saved to disk. - Repair: If a parser throws a runtime error, the Self-Healing Loop triggers an AI-assisted fix.
- Go 1.25+
- One LLM provider:
- Gemini: set
GEMINI_API_KEY - Ollama: local Ollama server running
- Gemini: set
git clone https://github.com/chuanjin/OmniBridge.git
cd OmniBridge
go mod tidyCreate a .env file:
# Needed only for Gemini provider
GEMINI_API_KEY=your_api_key_herego run cmd/server/main.go --provider gemini --model gemini-2.0-flashRun with Ollama:
go run cmd/server/main.go --provider ollama --model deepseek-coder:1.3bgo run cmd/server/main.go --mode server --addr :8080 --provider gemini --model gemini-2.0-flashSend binary data to it from your client; OmniBridge will parse known signatures and discover unknown ones.
Build and run:
docker build -t omnibridge .
docker run --rm -p 8080:8080 --env GEMINI_API_KEY=$GEMINI_API_KEY omnibridgecmd/server/— CLI entrypoint (simulation + TCP server modes)internal/parser/— dispatcher, discovery service, parser manager, dynamic engineinternal/logger/— structured logging setupagents/— system prompt(s) used for parser generationseeds/— built-in parser seeds loaded at startupexamples/— sample protocol datastorage/— learned parsers + manifest (created at runtime)
OmniBridge uses a Prefix Tree (Trie) to manage protocol signatures. This enables efficient routing even with variable-length signatures, ensuring the longest match is always prioritized.
Parsers are implemented as Go code generated by AI. To ensure high performance:
- JIT Compilation: Code is compiled at runtime using the
yaegiinterpreter. - Concurrent Caching: Compiled functions are cached in a thread-safe map, avoiding redundant compilation overhead for future packets.
Running AI-generated code requires guardrails. OmniBridge provides:
- Timeout Protection: Every parser execution is capped at 50ms.
- Panic Recovery: The system traps runtime panics (e.g., out-of-bounds access) and routes them to the repair cycle.
- Restricted Stdlib: Parsers only have access to safe packages like
encoding/binary,math, andbytes.
OmniBridge is actively evolving. High-priority areas include:
- Enhanced Observability: Exporting metrics via Prometheus/OpenTelemetry.
- Hardened Validation: Pre-execution static analysis of AI-generated code.
- Stateful Protocols: Support for protocols requiring sequence tracking or multi-packet assembly.
OmniBridge can run as an MCP Server (Model Context Protocol), exposing its protocol discovery and parsing capabilities to AI applications and agents.
go run cmd/server/main.go --mode mcp --provider gemini --model gemini-2.0-flashprotocol://list- List all known protocols with signaturesprotocol://manifest- Complete manifest mapping
parse_binary- Parse hex-encoded binary datadiscover_protocol- Trigger AI-based protocol discoverylist_protocols- List all available protocols
protocol_discovery- Template for discovering new protocolsparser_repair- Template for fixing broken parsers
{
"mcpServers": {
"omnibridge": {
"command": "go",
"args": ["run", "/path/to/OmniBridge/cmd/server/main.go", "--mode", "mcp", "--provider", "gemini"]
}
}
}Issues and PRs are welcome. If you have a target protocol family (CAN, telemetry, industrial buses, custom IoT frames), open an issue with sample payloads and expected fields.
MIT — see LICENSE.