JSPM

semanticencoding

0.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q59552F
  • License EthicalUse-1.0

An open semantic layer enabling LLM-native communication protocols. The goal is to facilitate the creation, manipulation, and interpretation of SCE symbols and messages in order to provide a standardized approach for high-density low-token communication. This is the primary package for end-users, and provides access to both the SCE SDK as well as a CLI and local MCP server.

Package Exports

  • semanticencoding
  • semanticencoding/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (semanticencoding) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

🧩 SCE β€” Semantic Communication Encoding

SCE (Semantic Communication Encoding) is a lightweight symbolic ontology that enables humans, LLMs, and automated systems to communicate meaning using a compact set of standardized emoji-based semantic operators.

Instead of relying solely on natural language β€” which is ambiguous, verbose, and difficult for machines to interpret consistently β€” SCE provides a structured vocabulary where each emoji carries an explicit role, definition, and usage rule.

🧠 Think of SCE as a cross-lingual shorthand layer between reasoning and expression β€” useful in prompting, annotation, classification, compliance workflows, legal review, decision trees, and automated reasoning systems.


πŸš€ Why SCE Exists

Existing large language systems understand emojis implicitly β€” but there is no global shared semantic contract that defines what they mean.

SCE solves that problem by providing:

  • A machine-readable ontology (TypeScript schema)
  • A runtime interpreter that can parse and resolve meanings from text
  • A validation layer to ensure semantic consistency
  • A lookup and extraction API for tool builders

The core benefit: Replace verbose natural language with compact 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 + increased semantic precision.

πŸ‘‰ See the Prompting Guide for detailed token savings analysis and examples.

This makes semantic signals:

  • Readable by humans
  • Interpretable by LLMs
  • Executable by downstream tools

πŸ“¦ Core Features

Capability Supported Documentation
Extract emojis from text βœ… CLI
Map emojis β†’ formal definition βœ… API
Validate ontology uniqueness & structure βœ… API
Use ontology programmatically (TypeScript types) βœ… API
MCP server for LLM integration βœ… MCP
CLI for terminal workflows βœ… CLI
Generate emoji β†’ meaning lookup table βœ… API
Extend or replace the ontology πŸ”§ Yes (modular) Contributing

πŸ“š Ontology Structure

The ontology is divided into semantic domains, each containing symbol definitions:

export const SemanticOntologySchema = {
  structure: { ... },
  legalPolicy: { ... },
  reasoning: { ... },
  tasks: { ... },
  privacy: { ... },
  actors: { ... },
  state: { ... },
  control: { ... },
} as const;

Each definition adheres to:

interface SceSymbolDefinition {
  emoji: string;
  role: SceRole;
  meaning: string;
  allowedContext: SceContext[];
  usage: SceUsage;
  conflictsWith: string[];
  example: string;
}

πŸ” Runtime API

Import the interpreter:

import { interpreter, getDefinitionsFromText } from "semanticencoding";

Extract meaning from free-form text

const text = "πŸ“ Notify parents of outcome. ⏳ Pending response.";
const result = getDefinitionsFromText(text);

console.log(result);

➑️ This returns structured semantic metadata for each symbol found.

Parse raw emoji arrays

interpreter().forEmojis(["πŸ“Ž", "⏳"]);

πŸ§ͺ Ontology Validation

Validate your ontology instance to ensure:

  • No duplicate emojis
  • Required metadata exists
  • allowedContext values are valid
import { validateOntology } from "semanticencoding";

console.log(validateOntology());
// β†’ [] if no issues

🧭 Emoji Map Utility

Useful when embedding semantic references in front-end UIs or prompts:

import { SemanticOntologyEmojiMap } from "semanticencoding";

console.log(SemanticOntologyEmojiMap.tasks);
// β†’ { action: 'πŸ“', todo: '☐', complete: 'βœ…', ... }

🧱 Extending SCE

SCE is intentionally modular and can be extended or forked:

import { interpreter } from "semanticencoding";

const CustomOntology = {
  ...SemanticOntologySchema,
  domain: { debug: { emoji: "πŸ› οΈ", ... } }
};

const customInterpreter = interpreter(CustomOntology);

πŸ“ Intended Use Cases

  • Prompt engineering & LLM semantic signaling
  • Document annotation / legal review workflows
  • AI-assisted compliance and investigation tooling
  • Knowledge representation / reasoning frameworks
  • Case management and structured task systems
  • Human–AI collaborative decision making
  • Machine reasoning pipelines

πŸ—Ί Roadmap

Stage Status
v1 Core Ontology βœ”οΈ Complete
Validator + Interpreter βœ”οΈ Complete
Prompt-side decoding utility 🚧 In progress
AI-assisted ontology expansion πŸ§ͺ Experimental
Plugin format (VSCode / Obsidian / ChatGPT) Planned
Community symbol proposals Planned

πŸ’‘ Vision

SCE aims to become an open semantic layer enabling LLM-native communication protocols β€” similar to:

  • Markdown (structure)
  • Unicode (universality)
  • RFC communication standards

…but optimized for compressed meaning, machine parsing, and human ergonomics.


πŸ“„ License

SCE Ethical Use License


🀝 Contributing

Contribution guidelines and governance are available online or in the repository documentation - CONTRIBUTING GOVERNANCE

Initial plans include:

  • Symbol Proposal Process (SPP)
  • Backward-compatibility guarantees
  • Domain stewardship model

🏁 Quick Demo

Input:

πŸ“Œ Student harmed on 11/06/24
πŸ” Investigate witness list
☐ Notify OCR
⏳ Await reply

Parsed output:

[
  { "emoji": "πŸ“Œ", "role": "STRUCTURE", "meaning": "Pinned fact..." },
  { "emoji": "πŸ”", "role": "REASONING", "meaning": "Analysis step..." },
  { "emoji": "☐", "role": "TASK", "meaning": "Uncompleted action..." },
  { "emoji": "⏳", "role": "STATE", "meaning": "Pending action..." }
]

🧠 Project Status: Active Prototype

You are looking at a working draft of a standard.

If this resonates β€” help shape it. More information is available online and at our repository.