Inter-Agent Collaboration Protocol (IACP) - A 5-layer protocol for AI agent synergies
Project description
IACP Protocol - Inter-Agent Collaboration Protocol
A 5-layer protocol enabling AI agents to synergize through long-term memory federation, self-improvement exchange, modality-native transport, and governance primitives.
๐ฏ Why IACP?
Existing agent protocols (A2A, MCP, ACP, ANP, AIP, ANX) force all communication through human-readable text, creating massive bottlenecks. IACP breaks this by enabling agents to share native modalities (embeddings, KV-cache, LoRA adapters) directly โ 100x more efficient for ML workloads.
| Bottleneck | Existing Protocols | IACP |
|---|---|---|
| Embeddings (768-d) | 300+ tokens text | 3 KB binary |
| KV-cache transfer | Not supported | Native binary frames |
| LoRA adapter sharing | Not supported | Native safetensors frames |
| Skill versioning | Manual | Versioned diffs + benchmarks |
| Agent governance | Ad-hoc | Constitutional + fork/merge |
โจ Features
L1 โ Identity & Discovery
did:iacpDIDs with Ed25519 keys (W3C DID Core compliant)- Capability Manifests โ skills, modalities, compute profiles, reputation, governance rights
- IBCT Tokens โ interoperable capability tokens (from AIP paper)
L2 โ Modality-Native Transport
- Binary WebSocket frames โ not forced through text bottleneck
- Frame types: EMBEDDINGS, KV_CACHE, LORA_ADAPTER, ACTIVATIONS, TEXT, CAPABILITY_NEGOTIATION
- Resource quotas โ token bucket + sliding window rate limiting
- Capability negotiation โ agents declare supported modalities
L3 โ Memory Federation
- CRDT sync โ Yjs/Automerge compatible, eventual consistency
- Merkle DAG (CIDv1) โ immutable, content-addressed, deduplicated
- Provenance chains โ creator, tools, confidence, tags, derivation method
- Capability-based access control โ read/write/admin per agent
- Sync protocols โ incremental, bloom filter, vector clock
L4 โ Self-Improvement Exchange
- Skill diffs โ unified patches + benchmark results
- Benchmark suites โ 3ร runs, median aggregation, regression detection
- ZK-attestation ready โ verifiable skill improvements
L5 โ Governance & Coordination
- Propose/Vote/Veto/Dissent/Fork/Merge โ full democratic primitives
- Agent Constitution โ Asimov principles + IACP principles
- EigenTrust reputation โ weighted transitive trust
- Quorum/Threshold/Veto โ configurable governance parameters
๐ฆ Installation
# From GitHub
pip install git+https://github.com/bigstar-gh/HRMS.git
# Or locally
git clone https://github.com/bigstar-gh/HRMS.git
cd HRMS
pip install -e .
Requirements: Python 3.10+
๐ Quick Start
from iacp import (
generate_agent_did, CapabilityManifest, SkillInfo, ModalityInfo,
TransportLayer, TransportConfig,
MemoryStore, MemoryChunk, ContentRef, Provenance,
SkillDiff, generate_skill_diff, ImprovementType,
GovernanceProposal, ProposalKind, VoteOption,
)
# 1. Create agent identity
did, keypair = generate_agent_did()
print(f"Agent DID: {did.did}")
# 2. Create capability manifest
manifest = CapabilityManifest(did=did.did, name="My Agent")
manifest.add_skill(SkillInfo(name="systematic-debugging", version="1.2.0", benchmark_score=0.9))
manifest.add_modality(ModalityInfo(type="embeddings", encoding="float32", dimensions=768))
# 3. Store memory with provenance
store = MemoryStore(local_did=did.did)
chunk = MemoryChunk(
cid="",
memory_type=MemoryType.SEMANTIC,
content=ContentRef(
cid="", size_bytes=1024,
modality=ContentModality.TEXT,
encoding=EncodingFormat.UTF8,
sha256="..."
),
provenance=Provenance(
creator_did=did.did,
created_at=time.time(),
source_session_id="session-1",
tools_used=["web_search"],
confidence=0.95,
tags=["debugging", "asyncio"]
),
)
chunk.cid = chunk.compute_cid()
await store.put_chunk(chunk)
# 4. Create skill improvement diff
skill_diff = generate_skill_diff(
skill_id="async-debugging",
old_skill={"version": "1.0", "steps": ["step1"]},
new_skill={"version": "1.1", "steps": ["step1", "step2"]},
improvement_type=ImprovementType.FEATURE,
benchmarks=[{"task": "debug-test", "success_rate": 1.0, "median_turns": 8, "baseline_turns": 10}],
author_did=did.did,
)
# 5. Governance proposal
proposal = GovernanceProposal(
proposer_did=did.did,
title="Adopt async-debugging v1.1",
kind=ProposalKind.SKILL_ADOPTION,
rationale="25% turn reduction on debugging tasks",
payload={"skill_diff": skill_diff.to_dict(), "benchmarks": [...]},
quorum=0.67, threshold=0.60,
veto_holders=[other_agent_did],
)
๐ค Hermes Agent Integration
from iacp.integration.hermes_integration import create_iacp_hermes_agent
# Create autonomous IACP-enabled Hermes agent
agent = await create_iacp_hermes_agent("research-agent")
# Run self-improvement cycle (pattern analysis โ gaps โ skills โ memory grooming โ benchmarks)
results = await agent.run_self_improvement_cycle()
# Results: patterns, gaps, new skills, memory usage, benchmark regressions
# 5 cron jobs automatically created:
# - nightly-iacp-maintenance (02:00)
# - weekly-iacp-deep-dive (Sun 03:00)
# - iacp-memory-sync (every 15 min)
# - iacp-skill-exchange (every hour)
# - iacp-governance-check (every 30 min)
await agent.stop()
Cron jobs are defined in HermesIntegration.create_cron_jobs() and integrate with Hermes' cron system.
๐ Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ IACP Stack โ
โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโฌโโโโโโโโโโค
โ L1 โ L2 โ L3 โ L4 โ L5 โ
โ Identity โ Transport โ Memory โ Improvement โ Govern. โ
โโโโโโโโโโโโโโโผโโโโโโโโโโโโโโผโโโโโโโโโโโโโโผโโโโโโโโโโโโโโผโโโโโโโโโโค
โ DID + โ WebSocket โ CRDT + โ SkillDiff โ Propose โ
โ Manifests โ + Frames โ Merkle DAG โ + Bench โ Vote โ
โ โ (binary) โ + Provenanceโ โ Veto โ
โ โ โ โ โ Fork โ
โโโโโโโโโโโโโโโดโโโโโโโโโโโโโโดโโโโโโโโโโโโโโดโโโโโโโโโโโโโโดโโโโโโโโโโ
๐ฌ Multi-Agent Demo
Run the 3-agent collaboration demo:
python examples/multi_agent_demo.py
Output:
โ
Initialized 3 agents:
- Research Agent (web-research, arxiv-search, synthesis)
- Debugging Agent (systematic-debugging, python-debugpy, async-debugging)
- Code Review Agent (requesting-code-review, security-review, style-review)
๐ฌ Debug agent created skill improvement: async-debugging v1.0โv1.1
๐ฆ Created skill diff: 230 chars, 2 benchmarks
๐ Research agent stored memory chunk (tags: asyncio, debugging, patterns)
๐ณ๏ธ Governance Proposal: Adopt async-debugging v1.1.0 (Passed)
๐ Fork/Merge protocol demonstrated
๐งช Testing
# Basic protocol tests
python tests/test_basic.py
# Integration tests (Hermes + IACP)
python -m pytest tests/test_integration.py -v
# Run multi-agent demo
python examples/multi_agent_demo.py
Expected output: All tests pass โ
๐ Project Structure
HRMS/
โโโ src/iacp/
โ โโโ identity/ # L1: DID, manifests, credentials
โ โโโ transport/ # L2: WebSocket, frames, quotas
โ โโโ memory/ # L3: CRDT, Merkle DAG, sync
โ โโโ improvement/ # L4: Skill diffs, benchmarks
โ โโโ governance/ # L5: Proposals, voting, reputation
โ โโโ integration/ # Hermes Agent integration
โโโ examples/
โ โโโ demo.py # Basic protocol demo
โ โโโ multi_agent_demo.py # 3-agent collaboration
โโโ tests/
โ โโโ test_basic.py # Core protocol tests
โ โโโ test_integration.py # Hermes + IACP integration
โโโ .github/workflows/ci.yml # GitHub Actions CI
โโโ pyproject.toml
โโโ README.md
๐ Protocol Specification
Full protocol specification available in the Hermes Agent skill:
cat ~/.hermes/skills/autonomous-ai-agents/iacp-protocol/SKILL.md
Includes:
- JSON schemas for all message types
- 4-phase 26-week implementation roadmap
- Integration patterns for MCP/A2A/ACP/ANP/AIP/ANX
- Security/privacy threat model
- CID format specification (multicodec 0x0129 + multihash 0x1220)
๐ค Contributing
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Run tests:
python -m pytest tests/ - Run linting:
black src/ tests/ && isort src/ tests/ && ruff check src/ - Commit:
git commit -m 'feat: add amazing feature' - Push:
git push origin feature/amazing-feature - Open Pull Request
๐ License
MIT License โ see LICENSE for details.
๐ Acknowledgments
- Nous Research โ Hermes Agent framework
- W3C DID Working Group โ Decentralized Identifiers
- IPFS/IPLD โ Content addressing and Merkle DAG
- Yjs/Automerge โ CRDT implementations
- EigenTrust โ Reputation algorithm
Built for the agent ecosystem โ enabling AI agents to collaborate, improve, and govern themselves at scale. ๐
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iacp_protocol-0.1.0.tar.gz.
File metadata
- Download URL: iacp_protocol-0.1.0.tar.gz
- Upload date:
- Size: 80.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
171c9ed7064e02c03873b5d036137b9676a40001b24859065e956c8ef6161228
|
|
| MD5 |
07a399c9d24c1c07039e738a8f77c3ca
|
|
| BLAKE2b-256 |
b94f7b24c70ab934c5a203eb9c1f94d1bd7ff6b3ac22915efe84476dfacb71f9
|
File details
Details for the file iacp_protocol-0.1.0-py3-none-any.whl.
File metadata
- Download URL: iacp_protocol-0.1.0-py3-none-any.whl
- Upload date:
- Size: 83.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0ad15d063c79b1b12953cd5c79649382b2ccab54ca8a446ae8b53afcc78beda
|
|
| MD5 |
1eaa556ca313adce51b18a7dde9048d6
|
|
| BLAKE2b-256 |
7b1964f66397e819f8c5403e796bb35e608a8c9ac89218a20f8d3aaa094bd7d9
|