UCL (Universal Contextual Language) is a formal language specification designed for clear, unambiguous, and machine-processable representation of contextualized information, intents, and commands, with a strong focus on enhancing interaction with AI systems like Large Language Models (LLMs).
In an era of increasingly complex AI systems and distributed software, the need for a precise and semantically rich communication method is paramount. UCL aims to address common challenges in human-AI and machine-to-machine (M2M) interaction:
- Reduces Ambiguity: Moves beyond the inherent vagueness of natural language by using unique identifiers (URIs) and explicit contextualization.
- Enhances Machine Processability: Provides a structured format that AI and software can parse and interpret reliably, leading to more accurate and consistent outcomes.
- Promotes Semantic Interoperability: Facilitates a shared understanding of data and commands between different systems by leveraging standard or well-defined vocabularies.
- Improves LLM Interaction: Acts as an advanced "prompt engineering" framework, allowing for highly specific and detailed instructions to LLMs, resulting in more controlled and relevant outputs.
- Facilitates Automation: Enables the automation of complex tasks and workflows by providing a clear language for defining configurations, actions, and expected data.
UCL messages are built around a few core ideas:
- Structured Messages: A defined syntax for
Source
,Target
,Operation
,Payload
, andContext
. - UCL-IDs (URIs): Unique identifiers (preferably URIs) for all concepts, entities, actions, and contexts, promoting semantic clarity.
- Context Stack: An explicit mechanism (
# context1 / context2
) to define the interpretive frame for the message. - JSON-like Payload: A flexible payload structure using lists
[...]
and maps{ "key": "value", ... }
for data, supporting nested structures. - Extensibility: Designed to be extended with custom vocabularies and ontologies.
- Improved Syntax: Optimized for both human readability (in its textual form) and LLM interpretation.
- Rich Data Typing: Support for nested lists and maps, and clear definitions for literals (strings, numbers, booleans, dates, binary).
- Dynamic Prefixes:
@prefix
declarations for compact and readable UCL-IDs. - Textual Verbs for Operations: (e.g.,
query
,execute
) for better LLM alignment. - Clear Semantics: Detailed definitions for each component of a UCL message.
- Defined Parsing Modes: "Strict" for machine validation and "Permissive" for human/LLM-generated input.
- Binary Serialization (Conceptual): Outlines principles for an efficient binary format (UCL-Bin) for M2M communication.
- Dive into the Full Specification:
SPECIFICATION.MD
- For a deep understanding of all rules and components. - Quick Overview:
PRESENTATION_QUICK_GUIDE.md
- Understand UCL in a few minutes. - Documentation & Guides:
docs/01_introduction_and_goals.md
- Why UCL was created.docs/02_getting_started.md
- Your first steps with UCL.- ... (add more links as documentation files are created)
- Practical Examples:
examples/
- See UCL in action with various use cases. - Using UCL with LLMs:
docs/09_ucl_and_llms.md
anddocs/11_building_a_ucl_prompt_compiler.md
We welcome contributions to UCL! Please read our CONTRIBUTING.md
guide to learn how you can help improve the specification, documentation, or create tooling.
Please also adhere to our CODE_OF_CONDUCT.md
.
UCL is licensed under the MIT License.
This repository hosts the specification for UCL (Universal Contextual Language) as conceptualized and developed through collaborative AI interaction. It aims to be a living document, evolving with community feedback and new insights into AI communication.