๐ง Semantic Communication Encoding ยท DRAFT v1
Semantic Communication Encoding (SCE)¶
๐ง A small, governed emoji ontology for humans, tools, and LLMs.
Semantic Communication Encoding (SCE) is a way to use Unicode emoji as semantic operators โ a compact, standardized โmini-languageโ that both humans and machines can understand.
Instead of long, fragile instructions like:
โThis is a non-negotiable fact that must not be contradictedโฆโ
you can write:
๐ Student was first enrolled on 2024-11-06.
โฆand everyone knows that:
๐means pinned, non-negotiable fact- it belongs to the structure domain
- its behavior and conflicts are defined in a formal ontology
SCE is designed for:
- ๐งญ LLM prompts & tools โ structure, control flow, and state
- โ๏ธ Compliance & legal workflows โ Title IX, FERPA, data access, audit trails
- ๐งโ๐ป Agent frameworks โ shared symbolic โvocabularyโ across tools
- ๐ Human collaboration โ readable, skimmable, explainable annotations
Why SCE?¶
Modern systems mix:
- Narrative context
- Legal / policy constraints
- Workflow & task state
- Roles and actors
- Privacy & access rules
SCE gives you a small, opinionated, governed vocabulary for those concepts.
The key benefit? Replace verbose natural language with precise semantic symbols:
Before: "This is a non-negotiable fact that must remain true..." (28 tokens)
After: ๐ Student was injured on 11/06/24 (2 tokens for the symbol)
Result: ~93% token reduction while increasing semantic precision.
See the Prompting Guide for detailed examples and token savings analysis.
| Domain | Example symbols | Purpose |
|---|---|---|
| structure | ๐๏ธ ๐ ๐ | Sections, pinned facts, references |
| legalPolicy | โ๏ธ ๐ ๐งพ ๐๏ธ | Law, citation, evidence, authority |
| reasoning | ๐ ๐ง ๐ต๏ธ | Analysis, insight, investigation |
| tasks | ๐ โ โ๏ธ โ ๐ | Actions, task state |
| privacy | ๐ ๐๏ธ ๐ | Restricted / authorized / open |
| actors | ๐ค ๐งโ๐ ๐งโ๐ซ ๐งโโ๏ธ ๐ข | People & institutions |
| state | โณ โ โ ๏ธ โ | Pending, unknown, warning, prohibited |
| control | ๐ โญ๏ธ โฎ๏ธ | Decision points, next, back |
Each symbol has a machine-readable definition with:
emojiโ the actual Unicode graphemeroleโ category / domain rolemeaningโ authoritative definitionallowedContextโ HUMAN / LLM / TOOLusageโ REQUIRED / OPTIONAL / CONDITIONALconflictsWithโ mutually exclusive symbolsexampleโ canonical example usage
Whatโs in this repo?¶
SCE ships with a complete โstackโ:
- ๐งฌ Core ontology โ
ontology.tsis the normative symbol set - ๐ Interpreter โ emoji โ JSON symbol definitions
- โ Validator โ checks for conflicts, duplicates, structural issues
- ๐งฐ TypeScript API โ drop-in library for your own tools
- ๐ฅ๏ธ CLI โ inspect symbols and validate the ontology from the terminal
- ๐ MCP server โ stdio Model Context Protocol server exposing SCE tools
Quick start¶
1. Install¶
# once published
npm install semanticencoding
# or from a cloned repo
npm install .
2. Interpret symbols in text¶
import { getDefinitionsFromText } from "semanticencoding";
const text =
"๐ First report was on 2024-11-06. โณ Investigation is still pending. โ ๏ธ Parent has raised safety concerns.";
const defs = getDefinitionsFromText(text);
console.log(defs[0]);
/*
{
emoji: "๐",
role: "STRUCTURE",
meaning: "Pinned fact or non-negotiable constraint",
allowedContext: ["HUMAN", "LLM"],
usage: "REQUIRED",
conflictsWith: ["๐", "๐ง "],
example: "๐ Timeline is determined by first reported contact (11/06/24)."
}
*/
3. Validate the ontology¶
import { validateOntology } from "semanticencoding";
const issues = validateOntology();
if (issues.length > 0) {
console.error("Ontology has issues:", issues);
process.exit(1);
}
MCP integration¶
SCE includes a stdio MCP server with three tools:
sce_explainโ extract & explain SCE symbols from textsce_validate_ontologyโ validate ontology structure & conflictssce_suggest_symbolsโ suggest SCE symbols for freeform text
Run the server¶
npm run build
node dist/sce-mcp-server.js
# or, if mapped in package.json:
sce-mcp
Each tool supports a structured format override:
{
"format": {
"type": "auto | pretty | json | hybrid",
"color": true
}
}
auto(default) โ TTY โ pretty, non-TTY โ JSONprettyโ human output (optionally colored)jsonโ machine-first, strict JSON texthybridโ pretty summary + JSON block
Learn more¶
- ๐ Getting started โ install, basic usage, examples
- ๐ฏ Prompting Guide โ token reduction & clarity benefits โญ
- ๐ฅ๏ธ CLI Reference โ command-line usage and workflows
- ๐ MCP Integration โ using SCE with LLM clients and agents
- ๐งฌ Ontology & API โ core symbol set & TypeScript types
- ๐ Specification โ SCE standard v1 (draft)
- ๐ค Contributing & Governance โ RFCs, symbol proposals, ethics
- ๐ฃ๏ธ Roadmap - Where we're going next
- Repository - Where we are right now
Status¶
๐ท๏ธ SCE ยท v0.1: Draft
SCE is stable enough for:
- real prompt engineering
- compliance / legal workflows
- MCP / agent framework integrations
โฆbut will continue to evolve based on practical usage and contributor feedback.