Skip to main content

Secure communication protocol for AI agents - The TCP/IP for the post-AI era

Project description

logo

The Protocol for AI Agents - Secure communication protocol for the post-AI era.

PyPI version Python 3.9+ License: MIT

๐ŸŽฏ What is BeekKon-Bridge?

BeekKon Bridge is a peer-to-peer communication protocol designed specifically for AI agents. It provides:

  • ๐Ÿ” Zero-knowledge authentication (based on CryptoLogin V2)
  • ๐Ÿ”’ End-to-end encryption (AES-256-GCM via Curve25519)
  • โœ๏ธ Message signatures (Ed25519)
  • ๐Ÿ” Automatic peer discovery (UDP broadcast)
  • ๐Ÿค– Simple high-level API (5 lines of code)

๐Ÿš€ Quick Start

Install

pip install beekon-bridge

Create an Agent

from beekkon import BeekKonAgent

# Create agent
agent = BeekKonAgent(
    name="my_agent",
    secret="my-super-secret-key-1234567890",  # min 32 chars
    capabilities=["parse_data", "generate_report"]
)

# Register handler
@agent.handler("process_request")
async def handle_request(data):
    return {"result": "processed", "input": data}

# Start agent
agent.start()

Request Another Agent

from beekkon import BeekKonAgent

agent = BeekKonAgent(
    name="client_agent",
    secret="client-secret-0987654321",
    capabilities=[]
)

agent.start(blocking=False)

# Send request
response = agent.request(
    target="my_agent",
    task="process_request",
    data={"value": 42}
)

print(response)  # {'success': True, 'data': {'result': 'processed', ...}}

๐ŸŽฌ Real-World Example: 3-Agent Workflow

See the examples/ folder for a complete workflow with 3 specialized agents:

  • CRM Officer (agent_crm.py): Client relationship management
  • Legal Officer (agent_juridique.py): Contract validation & compliance
  • Accounting Clerk (agent_comptable.py): Invoice generation & VAT calculation

Run the demo

# Terminal 1: Start Accounting Clerk
python examples/agent_comptable.py

# Terminal 2: Start Legal Officer
python examples/agent_juridique.py

# Terminal 3: Start CRM Officer
python examples/agent_crm.py

# Terminal 4: Trigger workflow
python examples/run_workflow.py
BKB_Shower

What happens

  1. Client requests onboarding via CRM
  2. CRM asks Legal to validate the contract
  3. Legal validates and stores contract in shared memory
  4. CRM asks Accounting to generate invoice
  5. Accounting retrieves contract, calculates VAT, issues invoice
  6. CRM validates payment
  7. Workflow completes โœ…

๐Ÿ” Security Model

  • Zero-knowledge: Server never stores master secrets, only derived user_ids
  • E2E encryption: All messages encrypted with AES-256-GCM
  • Forward secrecy: Session keys derived via Curve25519 Diffie-Hellman
  • Message integrity: Ed25519 signatures on all messages
  • Local-first: No cloud, no central server, 100% P2P

๐Ÿ“Š Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  BeekKonAgent (API)                 โ”‚
โ”‚  - agent.start()                                    โ”‚
โ”‚  - agent.request(target, task, data)                โ”‚
โ”‚  - @agent.handler("task")                           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                         โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              BeekKonDiscovery (UDP)                 โ”‚
โ”‚  - Automatic peer discovery                         โ”‚
โ”‚  - Capability-based filtering                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                         โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              BeekKonProtocol (TCP)                  โ”‚
โ”‚  - Handshake (zero-knowledge auth)                  โ”‚
โ”‚  - Encrypted communication (AES-256-GCM)            โ”‚
โ”‚  - Request/Response pattern                         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                         โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                BeekKonAuth (Crypto)                 โ”‚
โ”‚  - Ed25519 signatures                               โ”‚
โ”‚  - Curve25519 key exchange                          โ”‚
โ”‚  - PBKDF2-HMAC-SHA512 key derivation                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿงช Tests

pytest tests/ -v
# 36 tests passed

๐Ÿ“„ License

MIT License - See LICENSE file for details.

๐Ÿค Contributing

Contributions welcome! Please read CONTRIBUTING.md for guidelines.

๐Ÿ“ง Contact

GitHub: https://github.com/erabytse/BeekKon-Bridge

Issues: https://github.com/erabytse/BeekKon-Bridge/issues

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

beekkon_bridge-1.1.0.tar.gz (27.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

beekkon_bridge-1.1.0-py3-none-any.whl (24.4 kB view details)

Uploaded Python 3

File details

Details for the file beekkon_bridge-1.1.0.tar.gz.

File metadata

  • Download URL: beekkon_bridge-1.1.0.tar.gz
  • Upload date:
  • Size: 27.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for beekkon_bridge-1.1.0.tar.gz
Algorithm Hash digest
SHA256 1684c9525a2bcf7e3a7b191c854840f0dd2f2ab78d424cafc40b9660d1968662
MD5 8a7f95a3157ef9fce7269a2fe045dbe6
BLAKE2b-256 9a5c52cc658cfaf5c0dd972b2b70a884ad2f2f0cc69cdc5c064f36669111ba31

See more details on using hashes here.

File details

Details for the file beekkon_bridge-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: beekkon_bridge-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for beekkon_bridge-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb89635216e4916dcefe36aadaa747bb9f41469b67716a86b7b548a7f8602d39
MD5 a0192ca9ce409bb355e9550a1dea4a0d
BLAKE2b-256 c21accb073c0e1e6c767d9345814408b222aa71a03cb07b479d6a74a84ca22ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page