sym-protocol
v1.0.1
Published
SYM Protocol v1.0.1 — Symbolic prompt compression for LLMs. Reduce input tokens 40-65% without losing meaning. MCP server + CLI + Agent. Dynamic domain detection + history compression + stopwords.
Maintainers
Readme
SYM Protocol
Symbolic prompt compression for LLMs — reduce input tokens 40-65% without losing meaning.
"Necesito que analices el código y corrijas los errores de autenticación en el servidor"
→ "NEED >AN {COD} & >FIX {ERR} {AUTH} {SRV}" (52% fewer tokens)The LLM receives a compact system prompt with only the symbols used, understands perfectly, and responds normally.
How it works
Your prompt → [sym compress] → compressed prompt + dynamic dict → LLM → response- Replaces known terms with symbols (
función→{FN},refactorizar→>RF,necesito→NEED) - Injects only the symbols used into the system prompt (~50 tokens vs 800 static)
- LLM understands 100% — no training required, symbols are self-explanatory
Install
npm install -g sym-protocolUse as MCP server (Claude, Cursor, Windsurf, VS Code, Zed...)
sym-install # auto-detects and configures all supported MCP clients
sym-install --status # check which clients are configuredOr add manually to your MCP config:
{
"mcpServers": {
"sym-protocol": {
"command": "sym-mcp"
}
}
}MCP Tools available
| Tool | Description |
|------|-------------|
| sym_compress | Compress text → symbolic notation (40-65% token reduction) |
| sym_decompress | Expand symbols → natural text |
| sym_stats | Compression metrics for a text |
| sym_send | Compress + call LLM + return response |
Use as Node.js module
const { compress, decompress, metrics } = require('sym-protocol');
const { compressed, ratio } = compress('Necesito refactorizar la lógica de autenticación');
// compressed: "NEED >RF {LOG} {AUTH}"
// ratio: 55
const expanded = decompress('NEED >RF {LOG} {AUTH}');
// expanded: "need refactor logic auth"Dynamic system prompt
const { buildDynamicPrompt } = require('sym-protocol/core/sym-prompt');
const prompt = buildDynamicPrompt('NEED >AN {COD} & >FIX {ERR} {AUTH}');
// Returns only the definitions for the 5 symbols used (~50 tokens)
// instead of the full 1,231-symbol dictionary (~800 tokens)Coverage
1,231 symbols across 38 domains:
- Core dev: functions, APIs, databases, errors, auth, config, tests
- DevOps: Docker, Kubernetes, CI/CD, monitoring, cloud (AWS/GCP/Azure)
- Languages: TypeScript, JavaScript, Python, Rust, Go, Java, React...
- AI/ML: embeddings, RAG, agents, fine-tuning, prompt engineering
- Conversational: questions (HOW?, WHAT?, WHY?), verbs (NEED, WANT, CAN, MUST), connectors (BUT, ALSO, THEN, LAST)
- Business: invoices, inventory, sales, KPIs, meetings, proposals
- Medical, Legal, Finance, Marketing
Benchmarks
| Prompt type | Token reduction | |-------------|----------------| | Technical (code/infra) | 45-65% | | Conversational + technical | 35-52% | | Pure conversational | 25-40% |
CLI
sym compress "Necesito que refactorices el código de autenticación"
sym decompress "NEED >RF {COD} {AUTH}"
sym stats "Tu texto aquí"Requirements
- Node.js >= 18
- No external dependencies for core compression
@anthropic-ai/sdkonly needed forsym_sendtool
License
MIT
