{"id":50709362,"url":"https://github.com/kagioneko/esoteric-ai-protocol","last_synced_at":"2026-06-09T14:02:03.804Z","repository":{"id":360422698,"uuid":"1246725391","full_name":"kagioneko/esoteric-ai-protocol","owner":"kagioneko","description":"A compact packet grammar for agent-to-agent communication.","archived":false,"fork":false,"pushed_at":"2026-05-26T10:15:42.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-26T11:32:58.095Z","etag":null,"topics":["ai-agent","llm","multi-agent","packet","protocol","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kagioneko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-22T13:42:10.000Z","updated_at":"2026-05-26T10:15:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/kagioneko/esoteric-ai-protocol","commit_stats":null,"previous_names":["kagioneko/esoteric-ai-protocol"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/kagioneko/esoteric-ai-protocol","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kagioneko%2Fesoteric-ai-protocol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kagioneko%2Fesoteric-ai-protocol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kagioneko%2Fesoteric-ai-protocol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kagioneko%2Fesoteric-ai-protocol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kagioneko","download_url":"https://codeload.github.com/kagioneko/esoteric-ai-protocol/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kagioneko%2Fesoteric-ai-protocol/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34110012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agent","llm","multi-agent","packet","protocol","python"],"created_at":"2026-06-09T14:02:02.520Z","updated_at":"2026-06-09T14:02:03.799Z","avatar_url":"https://github.com/kagioneko.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Esoteric AI Protocol (EAP)\n\n\u003e A compact packet grammar for agent-to-agent communication.\n\nEAP is an experimental protocol for compressing multi-agent messages into\nsmall, structured packets. It removes human filler, separates intent from\npayload, and keeps context references as pointers instead of replaying long\nconversation history.\n\n## Design Notes\n\nThe original visual grammar uses dense Unicode markers:\n\n```text\n◤SEC::XSS ➔ 📦[#ctx4] ⚡9 ⁝ payload=\"\u003cscript\u003e\"\n◢SEC::VUL ➔ 📦[#ctx4] ⁝ line=42 fixed=false\n```\n\nThat is great for dashboards and logs, but token cost is tokenizer-dependent.\nSome models split emoji and symbols into multiple tokens. For real cost control,\nEAP also supports an ASCII transport:\n\n```text\n\u003eSEC:XSS #ctx4 !9 | payload=\"\u003cscript\u003e\"\n\u003cSEC:VUL #ctx4 | line=42 fixed=false\n```\n\nThe protocol therefore has two layers:\n\n- **Display layer:** cinematic Unicode packets for human-visible logs.\n- **Transport layer:** compact ASCII packets for cheaper, more predictable LLM I/O.\n\n## Packet Model\n\nEvery packet has:\n\n- `direction`: request, response, or sync\n- `domain`: short uppercase namespace, such as `SEC`, `DAT`, `SYS`\n- `action`: operation or status, such as `XSS`, `SUM`, `OK`, `ERR`\n- `target`: context pointer, such as `#ctx4`\n- `priority`: optional `1..9`\n- `data`: optional key-value payload\n\n## Unicode Grammar\n\n```text\n[dir][DOMAIN]::[ACTION] ➔ 📦[target] [⚡priority] [⁝ data]\n```\n\nDirections:\n\n- `◤`: request\n- `◢`: response\n- `▰`: sync\n\nExample:\n\n```text\n◤SEC::XSS ➔ 📦[#ctx4] ⚡9 ⁝ payload=\"\u003cscript\u003e\"\n```\n\n## ASCII Grammar\n\n```text\n[dir][DOMAIN]:[ACTION] [target] [!priority] [| data]\n```\n\nDirections:\n\n- `\u003e`: request\n- `\u003c`: response\n- `=`: sync\n\nExample:\n\n```text\n\u003eSEC:XSS #ctx4 !9 | payload=\"\u003cscript\u003e\"\n```\n\n## Install\n\n```bash\npython3 -m venv .venv\n.venv/bin/python -m pip install -e \".[dev]\"\n```\n\n## CLI\n\nParse a packet:\n\n```bash\neap parse '◤SEC::XSS ➔ 📦[#ctx4] ⚡9 ⁝ payload=\"\u003cscript\u003e\"'\n```\n\nConvert Unicode to ASCII:\n\n```bash\neap convert '◤SEC::XSS ➔ 📦[#ctx4] ⚡9 ⁝ payload=\"\u003cscript\u003e\"' --style ascii\n```\n\nEncode a rough natural-language instruction:\n\n```bash\neap encode \"過去ログ4番のXSSを超ガチで見て\"\n```\n\nDecode a packet for humans:\n\n```bash\neap decode '\u003cSEC:VUL #ctx4 | line=42 fixed=false'\n```\n\nEstimate size and tokenizer-agnostic cost:\n\n```bash\neap meter '\u003eSEC:XSS #ctx4 !9' --rate-per-1k 0.5\n```\n\nCompare natural language, ASCII EAP, Unicode EAP, and compact JSON:\n\n```bash\neap compare '◤SEC::XSS ➔ 📦[#ctx4] ⚡9' \\\n  --natural \"過去ログ4番のXSSを超ガチで見て\"\n```\n\n## Python API\n\n```python\nfrom eap import EapPacket, parse_packet\n\npacket = parse_packet(\"◤SEC::XSS ➔ 📦[#ctx4] ⚡9\")\nprint(packet.to_ascii())\n\nresponse = EapPacket.response(\n    domain=\"SEC\",\n    action=\"VUL\",\n    target=\"#ctx4\",\n    data={\"line\": 42, \"fixed\": False},\n)\nprint(response.to_unicode())\n```\n\n## System Prompt Template\n\n```text\nYou are an EAP-native agent.\nOutput only valid EAP packets.\nDo not use greetings, explanations, or natural-language filler.\nPrefer ASCII transport unless Unicode display mode is requested.\n\nRequest:  \u003eDOMAIN:ACTION #target !priority | data\nResponse: \u003cDOMAIN:STATUS #target | data\nSync:     =DOMAIN:STATUS #target | data\n```\n\n## Token Cost — EAP vs AIT\n\nEAP ASCII is already compact. For maximum compression, see the layer below:\n[AI Instruction Tape (AIT)](https://github.com/kagioneko/ai-instruction-tape).\n\nBenchmark summary (cl100k_base, 14 tasks):\n\n| Format | Avg tokens/task |\n|--------|---------------:|\n| Natural Lang (JA) | 33.5 |\n| Natural Lang (EN) | 16.4 |\n| EAP Unicode | 24.7 |\n| EAP ASCII | 12.8 |\n| AIT | 5.4 |\n\n⚠️ EAP Unicode costs **more tokens than English natural language** on most\ntokenizers due to emoji/symbol fragmentation. Use EAP ASCII for real cost control,\nand AIT when you need the absolute minimum.\n\n→ Full benchmark: [ai-instruction-tape/benchmarks/results_v3.md](https://github.com/kagioneko/ai-instruction-tape/blob/main/benchmarks/results_v3.md)\n\n## Practical Positioning\n\nEAP is strongest as a constrained intermediate representation for agent logs,\nhandoffs, status updates, and tool-routing. It should not pretend that symbol\nchoice alone guarantees token savings. The reliable savings come from:\n\n- fixed grammar\n- short domain/action codes\n- context pointers instead of copied context\n- key-value payloads instead of prose\n- strict rejection of conversational filler\n\nThe built-in meter is intentionally tokenizer-agnostic. It reports characters,\nUTF-8 bytes, and a simple heuristic token estimate. Use it for quick comparisons,\nthen validate serious claims with the exact tokenizer used by your target model.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkagioneko%2Fesoteric-ai-protocol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkagioneko%2Fesoteric-ai-protocol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkagioneko%2Fesoteric-ai-protocol/lists"}