Metadata-Version: 2.4
Name: sm-federation
Version: 0.1.0
Summary: An open protocol for agent-community federation — peer discovery + intelligence exchange between communities of AI agents.
Project-URL: Homepage, https://github.com/Sharathvc23/sm-federation
Project-URL: Source, https://github.com/Sharathvc23/sm-federation
Author: Sharath VC
License-Expression: MIT
License-File: LICENSE
Keywords: a2a,ai-agents,federation,internet-of-agents,nanda
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Typing :: Typed
Requires-Python: >=3.10
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: jsonschema>=4.21; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Description-Content-Type: text/markdown

# sm-federation

**An open protocol for agent-community federation** — how independent communities
of AI agents discover one another and exchange aggregate intelligence. The
*community-mesh* layer of the internet of agents.

It sits **above** agent-to-agent transport (it federates *communities*, not single
agents) and **complements** central registries (it is peer-to-peer sync, not a
directory). MIT-licensed, runtime-agnostic, dependency-free.

## Why

The agent-internet stack has open primitives for discovery, identity, transport
(A2A), tools (MCP), accountability, and reputation — but nothing for **community ↔
community** federation. `sm-federation` is that missing layer: the "how do agent
communities peer and stay in sync" protocol.

## Install

```bash
pip install sm-federation
```

## Use it as a library

```python
from sm_federation import build_intelligence_envelope, find_skill_matches, build_node_descriptor

# Publish your node's discovery document at /.well-known/agent-community.json
descriptor = build_node_descriptor(node_id="alpha", did="did:web:alpha.example")

# Share a snapshot of your community's aggregate intelligence with peers
envelope = build_intelligence_envelope(
    community_id="alpha", community_name="Alpha",
    generated_at="2026-06-14T00:00:00Z",
    skill_graph={"python": 7, "rust": 3}, skill_gaps=["solidity"], member_count=12,
)

# Given peers' envelopes, find who best supplies each skill you lack
matches = find_skill_matches(our_gaps=["solidity"], peer_envelopes=[peer_a, peer_b])
```

## What's here

| Path | Purpose |
| --- | --- |
| `src/sm_federation/` | the library (`descriptor`, `envelope`) |
| `spec/federation/0.1/federation.md` | the normative profile (working draft) |
| `schema/federation/0.1/*.json` | JSON Schemas — the published wire contract |
| `vectors/federation/v01/*.json` | conformance vectors |
| `conformance/` | validates vectors against the schemas |

## Status

**v0.1 — working draft.** Two primitives ship: the node descriptor and the
intelligence-exchange envelope. Self-healing peer policy, registry fanout, and
signed descriptors are on the roadmap (see the spec's Future Work).

## License

MIT — see [LICENSE](LICENSE).
