Skip to content

๐Ÿง  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 grapheme
  • role โ€“ category / domain role
  • meaning โ€“ authoritative definition
  • allowedContext โ€“ HUMAN / LLM / TOOL
  • usage โ€“ REQUIRED / OPTIONAL / CONDITIONAL
  • conflictsWith โ€“ mutually exclusive symbols
  • example โ€“ canonical example usage

Whatโ€™s in this repo?

SCE ships with a complete โ€œstackโ€:

  • ๐Ÿงฌ Core ontology โ€“ ontology.ts is 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 text
  • sce_validate_ontology โ€“ validate ontology structure & conflicts
  • sce_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 โ†’ JSON
  • pretty โ€“ human output (optionally colored)
  • json โ€“ machine-first, strict JSON text
  • hybrid โ€“ pretty summary + JSON block

Learn more


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.