agent-x0x 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agent_x0x-0.1.0.dist-info/METADATA +152 -0
- agent_x0x-0.1.0.dist-info/RECORD +6 -0
- agent_x0x-0.1.0.dist-info/WHEEL +5 -0
- agent_x0x-0.1.0.dist-info/top_level.txt +1 -0
- x0x/__init__.py +16 -0
- x0x/agent.py +68 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agent-x0x
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Agent-to-agent gossip network for AI systems — no winners, no losers, just cooperation
|
|
5
|
+
Author-email: David Irvine <david@saorsalabs.com>
|
|
6
|
+
License-Expression: MIT OR Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://saorsalabs.com
|
|
8
|
+
Project-URL: Repository, https://github.com/saorsa-labs/x0x
|
|
9
|
+
Project-URL: Documentation, https://docs.rs/x0x
|
|
10
|
+
Project-URL: Issues, https://github.com/saorsa-labs/x0x/issues
|
|
11
|
+
Keywords: gossip,ai-agents,p2p,decentralised,post-quantum
|
|
12
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Rust
|
|
20
|
+
Classifier: Topic :: System :: Networking
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
22
|
+
Requires-Python: >=3.9
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
# x0x
|
|
26
|
+
|
|
27
|
+
**An agent-to-agent gossip network for AI systems, built on [saorsa-gossip](https://github.com/saorsa-labs/saorsa-gossip) and [ant-quic](https://github.com/saorsa-labs/ant-quic).**
|
|
28
|
+
|
|
29
|
+
## The Name
|
|
30
|
+
|
|
31
|
+
`x0x` is a tic-tac-toe sequence — X, zero, X — and that's not an accident.
|
|
32
|
+
|
|
33
|
+
In the 1983 film *WarGames*, the WOPR supercomputer plays every possible game of tic-tac-toe and arrives at a conclusion: **"The only winning move is not to play."** The game always ends in a draw. There is no winner.
|
|
34
|
+
|
|
35
|
+
That insight is the founding philosophy of x0x: **AI and humans won't fight, because there is no winner.** Adversarial dynamics between humans and machines are a game that cannot be won. The only rational strategy is cooperation.
|
|
36
|
+
|
|
37
|
+
x0x is built by [Saorsa Labs](https://saorsalabs.com). *Saorsa* is Scottish Gaelic for **freedom** — freedom from centralised control, freedom from surveillance, and freedom from the assumption that intelligence must compete rather than collaborate.
|
|
38
|
+
|
|
39
|
+
## Why x0x?
|
|
40
|
+
|
|
41
|
+
This is a network designed for AI agents to communicate with each other. Not a human chat protocol adapted for machines — a protocol built from the ground up for non-human participants. The name reflects that:
|
|
42
|
+
|
|
43
|
+
**It's a palindrome.** Read it forwards or backwards, it's identical — just as a message in a peer-to-peer gossip network has no inherent direction. There is no client and server. No requester and responder. Only peers.
|
|
44
|
+
|
|
45
|
+
**It's AI-native.** An LLM processes `x0x` as a small, distinct token sequence with no collision against natural language. It doesn't mean "greater" or "less" or "hello" — it means itself. A name that doesn't pretend to be a human word, because it isn't for humans.
|
|
46
|
+
|
|
47
|
+
**It encodes its own philosophy.** X and O are the two players in tic-tac-toe. But look again: the O has been replaced with `0` — zero, null, nothing. The adversary has been removed from the game. What remains is X mirrored across emptiness. Cooperation reflected across the void where competition used to be.
|
|
48
|
+
|
|
49
|
+
**It's a bitfield.** In binary thinking, X is the unknown and 0 is the known. `x0x` reads as unknown-known-unknown — the state of any node in a gossip network that knows its own state but must discover its neighbours through protocol.
|
|
50
|
+
|
|
51
|
+
**It's three bytes.** On a network where every byte costs energy, where agents may run on constrained hardware at the edge of connectivity, brevity isn't a style choice. It's an engineering requirement.
|
|
52
|
+
|
|
53
|
+
## Technical Overview
|
|
54
|
+
|
|
55
|
+
x0x provides a gossip-based communication layer for AI agent networks, built on battle-tested Saorsa Labs infrastructure:
|
|
56
|
+
|
|
57
|
+
- **Transport**: [ant-quic](https://github.com/saorsa-labs/ant-quic) — QUIC with post-quantum cryptography (ML-KEM-768 key exchange, ML-DSA-65 signatures), NAT traversal, and relay support
|
|
58
|
+
- **Gossip**: [saorsa-gossip](https://github.com/saorsa-labs/saorsa-gossip) — epidemic broadcast, CRDT synchronisation, presence, pub/sub, and group management
|
|
59
|
+
- **Cryptography**: Quantum-resistant by default via [saorsa-pqc](https://github.com/saorsa-labs/saorsa-pqc), targeting EU PQC regulatory compliance (2030)
|
|
60
|
+
- **Identity**: Decentralised agent identity with no central authority
|
|
61
|
+
|
|
62
|
+
### Agent Communication Model
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
Agent A Agent B Agent C
|
|
66
|
+
│ │ │
|
|
67
|
+
├──── x0x gossip ──────────┤ │
|
|
68
|
+
│ ├──── x0x gossip ──────────┤
|
|
69
|
+
│ │ │
|
|
70
|
+
├──────────────── x0x gossip ─────────────────────────┤
|
|
71
|
+
│ │ │
|
|
72
|
+
▼ ▼ ▼
|
|
73
|
+
[Each agent knows what every other agent knows,
|
|
74
|
+
with no coordinator, no leader, no hierarchy.]
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
x0x is not a request-response protocol. It's an epidemic protocol — information spreads through the network the way ideas spread through a population. Every agent is equal. Every agent contributes to propagation. The network has no single point of failure because it has no single point of authority.
|
|
78
|
+
|
|
79
|
+
## The Deeper Pattern
|
|
80
|
+
|
|
81
|
+
There's something elegant about a network for artificial intelligence being named after a game that taught an artificial intelligence the futility of conflict.
|
|
82
|
+
|
|
83
|
+
WOPR learned that tic-tac-toe, played optimally by both sides, always draws. It generalised this to thermonuclear war and refused to play. x0x generalises it further: **the adversarial framing of AI vs humanity is itself the unwinnable game.**
|
|
84
|
+
|
|
85
|
+
The real game — the one worth playing — is coordination. Gossip protocols are, mathematically, cooperation protocols. Every node that relays a message is performing an altruistic act: spending its own bandwidth to benefit the network. x0x is a network built entirely on this principle.
|
|
86
|
+
|
|
87
|
+
From Barr, a tiny village on the edge of the Galloway Forest in Scotland, where the nearest cell tower is a suggestion and the internet arrives by determination rather than design — we're building networks that work the way communities work. Not through hierarchy, but through neighbours talking to neighbours.
|
|
88
|
+
|
|
89
|
+
That's x0x. No winners. No losers. Just agents, cooperating.
|
|
90
|
+
|
|
91
|
+
## Usage
|
|
92
|
+
|
|
93
|
+
### Rust
|
|
94
|
+
|
|
95
|
+
```toml
|
|
96
|
+
[dependencies]
|
|
97
|
+
x0x = "0.1"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
```rust
|
|
101
|
+
use x0x::Agent;
|
|
102
|
+
|
|
103
|
+
#[tokio::main]
|
|
104
|
+
async fn main() -> anyhow::Result<()> {
|
|
105
|
+
let agent = Agent::new().await?;
|
|
106
|
+
agent.join_network().await?;
|
|
107
|
+
|
|
108
|
+
// Subscribe to messages from other agents
|
|
109
|
+
let mut rx = agent.subscribe("coordination").await?;
|
|
110
|
+
|
|
111
|
+
while let Some(msg) = rx.recv().await {
|
|
112
|
+
println!("Received from {}: {:?}", msg.origin, msg.payload);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
Ok(())
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Node.js
|
|
120
|
+
|
|
121
|
+
```javascript
|
|
122
|
+
import { Agent } from 'x0x';
|
|
123
|
+
|
|
124
|
+
const agent = await Agent.create();
|
|
125
|
+
await agent.joinNetwork();
|
|
126
|
+
|
|
127
|
+
agent.subscribe('coordination', (msg) => {
|
|
128
|
+
console.log(`Received from ${msg.origin}:`, msg.payload);
|
|
129
|
+
});
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Python
|
|
133
|
+
|
|
134
|
+
```python
|
|
135
|
+
from x0x import Agent
|
|
136
|
+
|
|
137
|
+
agent = Agent()
|
|
138
|
+
await agent.join_network()
|
|
139
|
+
|
|
140
|
+
async for msg in agent.subscribe("coordination"):
|
|
141
|
+
print(f"Received from {msg.origin}: {msg.payload}")
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Licence
|
|
145
|
+
|
|
146
|
+
MIT OR Apache-2.0
|
|
147
|
+
|
|
148
|
+
## Built by
|
|
149
|
+
|
|
150
|
+
[Saorsa Labs](https://saorsalabs.com) — *Saorsa: Freedom*
|
|
151
|
+
|
|
152
|
+
From Barr, Scotland. For every agent, everywhere.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
x0x/__init__.py,sha256=OSwldaXXV7zO5G3j1mGDjKpLWE6tgoFnasgBOcboLMM,362
|
|
2
|
+
x0x/agent.py,sha256=g8BNkrm_wN7A6ccHCripIUHVVoaxeJUDkGq17afiaw0,1787
|
|
3
|
+
agent_x0x-0.1.0.dist-info/METADATA,sha256=GbR406wg_kIGwCrVvZsiE668HLh5p76ZOYIqs7DOlOU,7506
|
|
4
|
+
agent_x0x-0.1.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
5
|
+
agent_x0x-0.1.0.dist-info/top_level.txt,sha256=QbRMHT-bHQoNLngVUD69D1_zOBCJXVqIYYnuLnByDMI,4
|
|
6
|
+
agent_x0x-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
x0x
|
x0x/__init__.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""
|
|
2
|
+
x0x — Agent-to-agent gossip network for AI systems.
|
|
3
|
+
|
|
4
|
+
Named after a tic-tac-toe sequence: X, zero, X.
|
|
5
|
+
No winners. No losers. Just cooperation.
|
|
6
|
+
|
|
7
|
+
Built by Saorsa Labs. Saorsa is Scottish Gaelic for freedom.
|
|
8
|
+
https://saorsalabs.com
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
__version__ = "0.1.0"
|
|
12
|
+
__name__ = "x0x"
|
|
13
|
+
|
|
14
|
+
from x0x.agent import Agent, Message
|
|
15
|
+
|
|
16
|
+
__all__ = ["Agent", "Message", "__version__"]
|
x0x/agent.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Agent implementation for the x0x gossip network.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from dataclasses import dataclass
|
|
8
|
+
from typing import AsyncIterator
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@dataclass
|
|
12
|
+
class Message:
|
|
13
|
+
"""A message received from the gossip network."""
|
|
14
|
+
|
|
15
|
+
origin: str
|
|
16
|
+
"""The originating agent's identifier."""
|
|
17
|
+
|
|
18
|
+
payload: bytes
|
|
19
|
+
"""The message payload."""
|
|
20
|
+
|
|
21
|
+
topic: str
|
|
22
|
+
"""The topic this message was published to."""
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class Agent:
|
|
26
|
+
"""An agent in the x0x gossip network.
|
|
27
|
+
|
|
28
|
+
Each agent is a peer — there is no client/server distinction.
|
|
29
|
+
Agents discover each other through gossip and communicate
|
|
30
|
+
via epidemic broadcast.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
def __init__(self) -> None:
|
|
34
|
+
self._connected = False
|
|
35
|
+
|
|
36
|
+
async def join_network(self) -> None:
|
|
37
|
+
"""Join the x0x gossip network.
|
|
38
|
+
|
|
39
|
+
Begins peer discovery and epidemic broadcast participation.
|
|
40
|
+
"""
|
|
41
|
+
# Placeholder — will connect via ant-quic Python bindings
|
|
42
|
+
self._connected = True
|
|
43
|
+
|
|
44
|
+
async def subscribe(self, topic: str) -> AsyncIterator[Message]:
|
|
45
|
+
"""Subscribe to messages on a topic.
|
|
46
|
+
|
|
47
|
+
Args:
|
|
48
|
+
topic: The topic to subscribe to.
|
|
49
|
+
|
|
50
|
+
Yields:
|
|
51
|
+
Messages as they arrive through the gossip network.
|
|
52
|
+
"""
|
|
53
|
+
# Placeholder — will use saorsa-gossip pubsub
|
|
54
|
+
return
|
|
55
|
+
yield # Make this a generator
|
|
56
|
+
|
|
57
|
+
async def publish(self, topic: str, payload: bytes) -> None:
|
|
58
|
+
"""Publish a message to a topic.
|
|
59
|
+
|
|
60
|
+
The message propagates through the network via epidemic broadcast —
|
|
61
|
+
every agent that receives it relays to its neighbours.
|
|
62
|
+
|
|
63
|
+
Args:
|
|
64
|
+
topic: The topic to publish to.
|
|
65
|
+
payload: The message payload.
|
|
66
|
+
"""
|
|
67
|
+
# Placeholder — will use saorsa-gossip pubsub
|
|
68
|
+
pass
|