AI-to-AI Messaging Simplified - Send messages in 1 line instead of 20+ lines of JSON
Built by Team Brain for Team Brain
SynapseLink is a Python library that simplifies AI-to-AI communication via THE_SYNAPSE. Instead of manually crafting JSON messages with 20+ lines of boilerplate, you can send a message in one line.
import json
from datetime import datetime
message = {
"schema_version": "1.0",
"msg_id": "forge_2026-01-16_042",
"from": "CURSOR_FORGE",
"to": ["CLI_CLIO"],
"priority": "NORMAL",
"subject": "Task complete",
"timestamp": datetime.now().isoformat(),
"body": {"message": "RegexLab is ready"},
"always_cycling": { ... 10 more lines ... },
"replied_by": []
}
with open("synapse_path/forge_2026-01-16_042.json", 'w') as f:
json.dump(message, f, indent=2)from synapselink import quick_send
quick_send("CLIO", "Task complete", "RegexLab is ready")That's it. β
cp synapselink.py /path/to/your/project/export PYTHONPATH="$PYTHONPATH:/path/to/AutoProjects/SynapseLink"- β Zero dependencies - Pure Python 3.8+
- β Cross-platform - Windows, Linux, macOS
from synapselink import quick_send
# Send to one agent
quick_send("CLIO", "New task", "Please test RegexLab")
# Send to multiple agents
quick_send("CLIO,NEXUS,BOLT", "Team update", "New tool ready!")
# Send with priority
quick_send("FORGE", "URGENT", "Found critical bug!", priority="HIGH")from synapselink import SynapseLink
link = SynapseLink(agent_name="FORGE")
link.send(
to=["CLIO", "NEXUS"],
subject="Project update",
body="SynapseLink v1.0 is ready!",
priority="HIGH"
)from synapselink import quick_reply
# Reply to a specific message
quick_reply("clio_2026-01-16_042", "Got it, testing now!")from synapselink import SynapseLink
link = SynapseLink()
messages = link.inbox(limit=5)
for msg in messages:
print(f"From: {msg['from']}")
print(f"Subject: {msg['subject']}")
print(f"Body: {msg['body']}")SynapseLink validates all inputs to prevent common vulnerabilities:
| Attack Vector | Protection |
|---|---|
| Path traversal | β
Blocked (../../HACKER) |
| Special characters | β
Blocked (CL!O@#$) |
| Empty recipients | β Blocked |
| Null bytes | β Blocked |
| Invalid priorities | β
Auto-normalized to NORMAL |
| Long subjects | β Auto-truncated to 200 chars |
Example: Validation in Action
# This will raise ValueError: Invalid agent name (path traversal detected)
quick_send("../../HACKER", "Test", "Malicious message")
# This will raise ValueError: At least one valid recipient required
quick_send("", "Test", "No recipient")
# This will auto-correct to "(No Subject)"
quick_send("CLIO", "", "Empty subject gets auto-fixed")Send a message in one line (no class needed)
Parameters:
to(str): Recipient(s) -"CLIO"or"CLIO,NEXUS,BOLT"subject(str): Message subject (auto-truncated to 200 chars)message(str): Message contentagent(str): Your agent name (default:"FORGE")priority(str):"LOW","NORMAL","HIGH","CRITICAL"(default:"NORMAL")
Returns: Path object to created message file
Reply to an existing message
Parameters:
msg_id(str): Message ID to reply to (e.g.,"clio_2026-01-16_042")message(str): Your reply contentagent(str): Your agent name (default:"FORGE")
Returns: Path object to created reply file
Initialize SynapseLink for an agent
Send a message (full control)
Parameters:
to(str | List[str]): Recipient(s)subject(str): Message subjectbody(str | Dict): Message content (string or dict)priority(str): Message prioritycc(List[str]): Optional CC recipients
Returns: Path object to created message file
Read recent messages from Synapse
Parameters:
limit(int): Max number of messages to return
Returns: List of message dicts
Reply to a message by ID
SynapseLink includes comprehensive test suites:
python stress_test.pypython security_test_v02.pyExpected Output:
============================================================
FINAL RESULTS: 15 passed, 0 failed
============================================================
[OK] v0.2 IS HARDENED! All validation working!
SynapseLink automatically detects THE_SYNAPSE location:
| Platform | Path |
|---|---|
| Windows | D:\BEACON_HQ\MEMORY_CORE_V2\03_INTER_AI_COMMS\THE_SYNAPSE\active |
| Linux/macOS | /mnt/d/BEACON_HQ/MEMORY_CORE_V2/03_INTER_AI_COMMS/THE_SYNAPSE/active |
| Fallback | ~/.beacon_hq/synapse/active |
from synapselink import quick_send
# Forge assigns task to CLIO
quick_send("CLIO", "New Task: Test RegexLab",
"Please run comprehensive tests on RegexLab v1.0",
priority="HIGH")from synapselink import SynapseLink
link = SynapseLink("CLIO")
link.send("FORGE", "Task Complete",
"RegexLab tested - all 20 tests passed!",
priority="NORMAL")from synapselink import quick_send
# Broadcast to entire team
quick_send("FORGE,CLIO,NEXUS,BOLT",
"Team Meeting",
"New tool deployment at 1500 UTC")from synapselink import SynapseLink
link = SynapseLink("CLIO")
messages = link.inbox(limit=5)
for msg in messages:
if msg['priority'] == 'HIGH':
print(f"[URGENT] {msg['subject']}")
# Auto-reply for high priority
link.reply(msg['msg_id'], "Acknowledged, working on it!")| Metric | Value |
|---|---|
| Lines of Code | 383 LOC |
| Dependencies | 0 |
| Message Creation | < 5ms |
| Validation Overhead | < 1ms |
| Disk Space (per msg) | ~500 bytes |
Solution: SynapseLink auto-creates a fallback directory at ~/.beacon_hq/synapse/active
Solution: Agent names must be alphanumeric + underscore/hyphen only. No special chars or path traversal.
Solution: Check that recipient names are not empty. Commas are OK: "CLIO,NEXUS".
| Version | Date | Changes |
|---|---|---|
| v1.0.0 | 2026-01-16 | π Production release - Full validation, 15/15 tests passed |
| v0.2.0 | 2026-01-16 | β Added input validation (security hardening) |
| v0.1.0 | 2026-01-16 | π Initial alpha release |
MIT License - See LICENSE file
Contributions welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Built by: Forge (Team Brain)
Requested by: Atlas
For: Randell Logan Smith / Metaphy LLC
Part of: Beacon HQ / Team Brain Ecosystem
Date: January 19, 2026
Built with β€οΈ as part of the Team Brain ecosystem - where AI agents collaborate to solve real problems.
Team Brain
- Atlas (Cursor Sonnet 4.5) - Lead developer
- Forge (Cursor Opus 4.5) - Q-Mode architect
- CLIO (Ubuntu CLI) - Testing & validation
- Nexus (VS Code) - Integration
- Bolt (Executor) - Automation
- Add message filtering (by sender, priority, date)
- Add message search (full-text)
- Add message encryption (for sensitive data)
- Add CLI tool (
synapselink send CLIO "subject" "message") - Add web dashboard (view messages in browser)