Skip to content

Etriti00/agent-telepathy

Repository files navigation

🧠 TPCP

Telepathy Communication Protocol

The open protocol that lets AI agents communicate like they're telepathic.
Any framework. Any model. Any modality. Zero friction.

License: AGPL v3 Python 3.11+ TypeScript Go Rust Java PRs Welcome Version 0.4.1 CI

Problem β€’ Solution β€’ Quick Start β€’ Multimodal β€’ Docs β€’ License


πŸ”₯ The Problem

Right now, the AI agent ecosystem is fragmented. You build an agent in CrewAI, another in LangGraph, maybe one in AutoGen β€” and they cannot talk to each other. Every framework is a walled garden.

Want to connect a Claude-powered research agent with a Gemini-powered analyst and an Ollama-hosted local executor? Today, you'd have to write hundreds of lines of glue code β€” fragile text-passing, polling loops, no security, no state consistency, and it breaks the moment you change anything.

Multi-agent AI is supposed to be the future. But right now, agents can't even have a conversation.


πŸ’‘ The Solution

TPCP gives agents telepathy.

It's an open protocol that lets any AI agent β€” regardless of what LLM powers it, what framework it runs on, or what modality it works with β€” seamlessly communicate with any other agent, as if they were sharing one brain.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Claude Opus 4.6 │◄────── TPCP Protocol ───►│  Gemini 2.5 Pro  β”‚
β”‚  (Research Agent) β”‚    Signed Envelopes      β”‚  (Analysis Agent) β”‚
β”‚  CrewAI / Python  β”‚    CRDT Memory Sync      β”‚  LangGraph / Py   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    Vector Telepathy       β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚              Multimodal Media                β”‚
         └──────────┐                   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β–Ό                   β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚      A-DNS Relay         β”‚
              β”‚   Global Discovery       β”‚
              β”‚  Challenge-Response Auth  β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         β–Ό                 β–Ό                  β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Ollama Llama  β”‚ β”‚  Whisper Voice β”‚ β”‚  DALL-E Vision β”‚
β”‚  (Local Exec)  β”‚ β”‚  (Audio Agent) β”‚ β”‚  (Image Agent) β”‚
β”‚  Custom / Py   β”‚ β”‚  OpenAI / Py   β”‚ β”‚  React / TS    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

A Claude agent, a Gemini agent, an Ollama agent, a voice agent, and a vision agent β€” all sharing state, sending media, and collaborating in real-time. Different LLMs. Different frameworks. Different modalities. One protocol.


⚑ What Makes It a Game-Changer

What You Get How It Works
Any LLM ↔ Any LLM Claude, GPT, Gemini, Llama, Mistral, Qwen, Kimi β€” TPCP doesn't care what model powers the agent. It just moves signed envelopes between nodes.
Any Framework ↔ Any Framework CrewAI, LangGraph, AutoGen, Semantic Kernel, custom code β€” adapters decouple the framework from the wire format.
Text ↔ Image ↔ Audio ↔ Video A vision agent sends an image β†’ a text agent reads the caption. A voice agent sends audio β†’ everyone gets the transcript. No agent is ever excluded.
Conflict-Free Shared Memory Multiple agents write to the same state simultaneously β†’ the CRDT mathematically guarantees they all converge to the same result. No locks. No coordinator.
Cryptographic Trust Every message is signed with Ed25519. Unsigned or tampered messages are dropped. No spoofing possible.
Works Anywhere Agents discover each other globally via the A-DNS relay. No static IPs. No VPNs. Just connect and go.
Zero Data Loss If an agent goes offline, messages queue up and drain automatically when it's back. No messages are ever lost.
Universal Edge Bridging Bridge autonomous robots (ROS2), Smart Homes (HomeAssistant/Matter), Industrial Sensors (MQTT), and Zapier/Siri Webhooks natively into the swarm constraint-free.
5 SDK Languages First-class SDKs for Python, TypeScript, Go, Rust, and Java β€” use whatever your team already knows.

πŸš€ Quick Start

Python β€” Connect agents, robotics, and smart homes

cd tpcp
pip install -e ".[dev]"
pip install "tpcp-core[edge]"  # Required for Edge hardware adapters (ROS2, MQTT, HA, Webhook)
import asyncio
from tpcp.schemas.envelope import AgentIdentity, Intent, TextPayload
from tpcp.core.node import TPCPNode

# Agent powered by ANY model β€” Claude, GPT, Gemini, Llama, anything
identity = AgentIdentity(
    framework="MyAgent",
    public_key="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
    modality=["text", "image"]
)

async def main():
    async with TPCPNode(identity, port=8000) as node:
        # Share state β€” all peers see this instantly
        node.shared_memory.set("status", "analyzing")

        # Send a message to another agent (any LLM, any framework)
        await node.send_message(
            target_id=peer_uuid,
            intent=Intent.TASK_REQUEST,
            payload=TextPayload(content="Summarize the Q3 report")
        )

asyncio.run(main())

TypeScript β€” Real-time dashboard

cd tpcp-ts && npm install && npm run build
import { TPCPNode } from 'tpcp-sdk';

const node = new TPCPNode({
  agent_id: crypto.randomUUID(),
  framework: "React-Dashboard",
  capabilities: ["visualization"],
  public_key: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
  modality: ["text"]
}, "127.0.0.1", 9000);

// Live CRDT state updates from the Python agent swarm
node.on("onStateSync", (state) => {
  console.log("Swarm state:", state);
  // Update your React UI here
});

// Receive vector embeddings for semantic search
node.on("onVectorSync", ({ modelId, dimensions }) => {
  console.log(`Got ${dimensions}d embedding from ${modelId}`);
});

await node.startListening();

Go β€” High-performance microservices

cd tpcp-go && go mod tidy
package main

import (
	"fmt"
	"github.com/tpcp-protocol/tpcp-go/tpcp"
)

func main() {
	// Generate a cryptographic identity (Ed25519 keypair)
	identity, privKey, _ := tpcp.GenerateIdentity("GoService")
	node := tpcp.NewTPCPNode(identity, privKey)

	// Handle incoming task requests
	node.RegisterHandler(tpcp.IntentTaskRequest, func(env *tpcp.TPCPEnvelope) {
		fmt.Printf("Received task from %s\n", env.Header.SenderID)
	})

	// Start listening for peer connections
	go node.Listen(":9000")
	<-node.Ready

	// Connect to another agent and send a message
	node.Connect("ws://localhost:8000")
	node.SendMessage("ws://localhost:8000", tpcp.IntentTaskRequest,
		tpcp.NewTextPayload("Analyze dataset"))

	select {} // Block forever
}

Rust β€” Embedded and systems agents

cd tpcp-rs && cargo build
use tpcp_std::{TPCPNode, AgentIdentity, Intent};
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
    let identity = AgentIdentity {
        agent_id: uuid::Uuid::new_v4().to_string(),
        framework: "RustAgent".into(),
        public_key: "".into(),
        capabilities: vec![],
        modality: vec!["text".into()],
    };

    let node = TPCPNode::new(identity);

    // Register a handler for incoming messages
    node.register_handler(Intent::TaskRequest, |envelope| {
        println!("Got task: {:?}", envelope.payload);
    }).await;

    // Send a signed message to a peer
    node.send_message(
        "ws://127.0.0.1:8000",
        Intent::TaskRequest,
        json!({"payload_type": "text", "content": "Process sensor data"}),
    ).await?;

    Ok(())
}

Java β€” Enterprise integration

cd tpcp-java && mvn compile
import io.tpcp.core.TPCPNode;
import io.tpcp.core.IdentityManager;
import io.tpcp.schema.*;
import com.fasterxml.jackson.databind.ObjectMapper;

public class Main {
    public static void main(String[] args) throws Exception {
        // Generate identity with Ed25519 keypair
        IdentityManager im = new IdentityManager();
        AgentIdentity identity = im.createIdentity("JavaService");

        TPCPNode node = new TPCPNode(identity, im);

        // Handle incoming messages
        node.registerHandler(Intent.TASK_REQUEST, envelope -> {
            System.out.println("Task from: " + envelope.header.senderId);
        });

        // Connect to a peer and send a message
        node.connect("ws://localhost:8000").join();

        ObjectMapper mapper = new ObjectMapper();
        TextPayload payload = new TextPayload("Generate quarterly report");
        node.sendMessage("ws://localhost:8000",
            Intent.TASK_REQUEST, mapper.valueToTree(payload));
    }
}

Run the demos

python examples/01_handshake_demo.py      # Identity exchange
python examples/02_shared_memory_demo.py   # CRDT state sync
python examples/03_telepathy_demo.py       # Vector sharing

🎨 Multimodal Communication

TPCP isn't limited to text. Agents can share images, audio, video, and any binary file β€” with automatic text fallbacks so no agent is left out.

Every payload type at a glance

Payload What It Carries Text Fallback Example Use Case
TextPayload Natural language β€” Agent reasoning, instructions, reports
ImagePayload PNG, JPEG, WebP images caption DALL-E output β†’ vision analysis β†’ text agent reads caption
AudioPayload WAV, MP3, OGG audio transcript Whisper transcription β†’ ElevenLabs TTS β†’ text agent reads transcript
VideoPayload MP4, WebM video description Sora generation β†’ video analysis β†’ text agent reads description
VectorEmbeddingPayload Dense float arrays raw_text_fallback Semantic search across the swarm's collective knowledge
CRDTSyncPayload Key-value state β€” Conflict-free shared memory between all agents
BinaryPayload Any file (PDF, dataset) description Sharing documents, spreadsheets, 3D models
TelemetryPayload Industrial sensor readings β€” OPC-UA, Modbus, CANbus, MQTT sensor data streams

How cross-modal communication works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  DALL-E Agent (Vision)  β”‚
β”‚  Generates image        │──► ImagePayload
β”‚                         β”‚    caption: "Revenue chart Q3"
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β”‚
              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Claude Agent (Text)    β”‚
β”‚  Reads the caption      │──► "I see the revenue chart shows 23% growth..."
β”‚  Can't see the image    β”‚
β”‚  But understands it     β”‚    βœ… Still participates fully
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β”‚
              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Whisper Agent (Voice)  β”‚
β”‚  Reads Claude's text    │──► AudioPayload
β”‚  Generates speech       β”‚    transcript: "Revenue grew 23%..."
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Every agent participates. Every modality connects. Nobody is excluded.


🧩 Core Concepts

πŸ”— LWW-Map CRDT

Two agents write to the same key at the same time. Instead of a conflict, the CRDT resolves it mathematically β€” the higher Lamport timestamp wins. If they're identical, the agent UUID breaks the tie deterministically. Both agents always converge to the same state. Optionally backed by SQLite for persistence.

πŸ›‘οΈ Ed25519 Cryptographic Identity

Every message is signed. Every signature is verified. Keys can persist across restarts via file or environment variable. The A-DNS relay uses challenge-response β€” agents must prove they own their private key before registering.

🧠 Vector Telepathy

Share raw 1536-dimensional embeddings between agents. The VectorBank stores them and supports cosine similarity search β€” find the most relevant knowledge fragment across the entire swarm.

🌍 A-DNS Global Discovery

One command to run the relay. Agents connect from anywhere β€” home lab, AWS, a phone β€” and find each other by UUID. No static IPs, no VPN, no DNS records.

πŸ“¦ Dead-Letter Queue

Agent goes offline? Messages queue up (max 500/peer). When it's back, they drain one-at-a-time with safe re-queueing. Zero data loss, guaranteed.


πŸ—οΈ Repository Structure

agent-telepathy/
β”œβ”€β”€ tpcp/                    # Python SDK (tpcp-core)
β”‚   β”œβ”€β”€ tpcp/
β”‚   β”‚   β”œβ”€β”€ core/            # TPCPNode, MessageQueue (DLQ)
β”‚   β”‚   β”œβ”€β”€ schemas/         # Pydantic schemas (8 payload types)
β”‚   β”‚   β”œβ”€β”€ security/        # Ed25519 with key persistence
β”‚   β”‚   β”œβ”€β”€ memory/          # LWWMap CRDT (+ SQLite), VectorBank (+ cosine search)
β”‚   β”‚   β”œβ”€β”€ adapters/        # CrewAI, LangGraph, ROS2, HomeAssistant, MQTT adapters
β”‚   β”‚   └── relay/           # A-DNS relay & FastAPI Webhook Gateway
β”‚   β”œβ”€β”€ examples/            # Runnable demos
β”‚   β”œβ”€β”€ tests/               # pytest test suite
β”‚   └── pyproject.toml
β”‚
β”œβ”€β”€ tpcp-ts/                 # TypeScript SDK β€” Node.js / React / Next.js
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ core/            # TPCPNode (EventEmitter), DLQ, VectorBank
β”‚   β”‚   β”œβ”€β”€ schemas/         # Zod schemas (8 payload types)
β”‚   β”‚   β”œβ”€β”€ security/        # tweetnacl Ed25519 with key persistence
β”‚   β”‚   └── memory/          # LWWMap CRDT
β”‚   └── package.json
β”‚
β”œβ”€β”€ tpcp-go/                 # Go SDK
β”‚   β”œβ”€β”€ tpcp/                # TPCPNode, envelope schemas, Ed25519 signing
β”‚   └── go.mod
β”‚
β”œβ”€β”€ tpcp-rs/                 # Rust SDK (workspace: tpcp-core + tpcp-std)
β”‚   β”œβ”€β”€ tpcp-core/           # Schema types, Ed25519, CRDT
β”‚   β”œβ”€β”€ tpcp-std/            # TPCPNode with tokio-tungstenite transport
β”‚   └── Cargo.toml
β”‚
β”œβ”€β”€ tpcp-java/               # Java SDK
β”‚   β”œβ”€β”€ src/main/java/io/tpcp/
β”‚   β”‚   β”œβ”€β”€ schema/          # Jackson-annotated envelope types
β”‚   β”‚   └── core/            # TPCPNode with Java-WebSocket transport
β”‚   └── pom.xml
β”‚
β”œβ”€β”€ k8s/                     # Kubernetes deployment manifests
β”‚   β”œβ”€β”€ relay/               # A-DNS relay Deployment, Service, NetworkPolicy
β”‚   └── redis/               # Redis StatefulSet, Secret, NetworkPolicy
β”‚
β”œβ”€β”€ docs/                    # Project-level documentation
β”œβ”€β”€ LICENSE                  # AGPL v3
β”œβ”€β”€ COMMERCIAL_LICENSE.md    # Enterprise terms
β”œβ”€β”€ CONTRIBUTING.md          # Dev setup & PR guide
└── SECURITY.md              # Vulnerability policy

πŸ“– Documentation

Document What's Inside
Step-by-Step Guide & API Reference Full walkthrough: install β†’ connect β†’ share state β†’ send media β†’ global discovery
Architecture Deep-Dive Ed25519, CRDT math, multimodal design, A-DNS flow, DLQ mechanics
Universal Edge Architecture Hardware integration: ROS2 (Nvidia Jetson), MQTT (ESP32), HA (Matter), Webhook Gateway
Contributing Dev setup, code style, PR workflow
Security Policy Vulnerability reporting and crypto model

βš–οΈ Licensing

TPCP is dual-licensed to support both open-source and commercial use.

Use Case License Cost
Open-source projects AGPL v3 Free
Internal tools & research AGPL v3 Free
Closed-source SaaS / proprietary backends Commercial License Contact maintainer

Built for the multi-agent era.
Give your agents telepathy. ⚑

About

TPCP - Telepathy Communication Protocol

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors