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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# AIPM Quick Start Guide
|
| 2 |
+
|
| 3 |
+
Get started with the Agent Interoperability Protocol Models in 5 minutes.
|
| 4 |
+
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
## 🎮 Try the Demo (Easiest)
|
| 8 |
+
|
| 9 |
+
Visit the interactive demo - no installation required!
|
| 10 |
+
|
| 11 |
+
**URL:** https://huggingface.co/spaces/bhaskarvilles/aipm-demo
|
| 12 |
+
|
| 13 |
+
1. Configure two agents with custom properties
|
| 14 |
+
2. Click "Execute Handshake"
|
| 15 |
+
3. Watch the 7-step protocol in real-time
|
| 16 |
+
4. See capability discovery and trust verification
|
| 17 |
+
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
## 💻 Install Locally
|
| 21 |
+
|
| 22 |
+
### Prerequisites
|
| 23 |
+
- Python 3.9+
|
| 24 |
+
- pip
|
| 25 |
+
|
| 26 |
+
### Installation
|
| 27 |
+
|
| 28 |
+
```bash
|
| 29 |
+
# Clone the repository
|
| 30 |
+
git clone https://huggingface.co/bhaskarvilles/aipm
|
| 31 |
+
cd aipm
|
| 32 |
+
|
| 33 |
+
# Install the SDK
|
| 34 |
+
cd sdk-python
|
| 35 |
+
pip install -e .
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
### Run Example
|
| 39 |
+
|
| 40 |
+
```bash
|
| 41 |
+
# Go to examples directory
|
| 42 |
+
cd ../examples
|
| 43 |
+
|
| 44 |
+
# Run the basic handshake demo
|
| 45 |
+
python basic_handshake.py
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
You'll see a complete handshake between an OpenAI agent and a LangGraph agent!
|
| 49 |
+
|
| 50 |
+
---
|
| 51 |
+
|
| 52 |
+
## 🔧 Basic Usage
|
| 53 |
+
|
| 54 |
+
### Create an Agent
|
| 55 |
+
|
| 56 |
+
```python
|
| 57 |
+
from aipm import AIPMAgent, AgentIdentity, Capabilities
|
| 58 |
+
|
| 59 |
+
# Define your agent's identity
|
| 60 |
+
identity = AgentIdentity(
|
| 61 |
+
agent_id="my-agent-001",
|
| 62 |
+
organization_id="my-org",
|
| 63 |
+
name="My AI Agent",
|
| 64 |
+
version="1.0.0",
|
| 65 |
+
capabilities=Capabilities(
|
| 66 |
+
skills=["text-generation", "code-review"],
|
| 67 |
+
models=["gpt-4"],
|
| 68 |
+
tools=["code-interpreter"],
|
| 69 |
+
max_context=128000,
|
| 70 |
+
memory_support=True
|
| 71 |
+
)
|
| 72 |
+
)
|
| 73 |
+
|
| 74 |
+
# Create the agent
|
| 75 |
+
agent = AIPMAgent(identity)
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
### Initiate Handshake
|
| 79 |
+
|
| 80 |
+
```python
|
| 81 |
+
from aipm import AgentReference
|
| 82 |
+
|
| 83 |
+
# Reference another agent
|
| 84 |
+
peer = AgentReference(
|
| 85 |
+
agent_id="peer-agent-001",
|
| 86 |
+
organization_id="peer-org"
|
| 87 |
+
)
|
| 88 |
+
|
| 89 |
+
# Start handshake
|
| 90 |
+
hello_msg = agent.initiate_handshake(peer)
|
| 91 |
+
```
|
| 92 |
+
|
| 93 |
+
### Process Messages
|
| 94 |
+
|
| 95 |
+
```python
|
| 96 |
+
# Process incoming message
|
| 97 |
+
response = agent.process_message(hello_msg)
|
| 98 |
+
|
| 99 |
+
# Check if handshake is complete
|
| 100 |
+
if agent.is_ready(peer):
|
| 101 |
+
print("Handshake complete! Ready to communicate.")
|
| 102 |
+
|
| 103 |
+
# Get peer's identity
|
| 104 |
+
peer_identity = agent.get_peer_identity(peer)
|
| 105 |
+
print(f"Connected to: {peer_identity.name}")
|
| 106 |
+
print(f"Peer skills: {peer_identity.capabilities.skills}")
|
| 107 |
+
```
|
| 108 |
+
|
| 109 |
+
### Send Task Request
|
| 110 |
+
|
| 111 |
+
```python
|
| 112 |
+
# Once handshake is complete, delegate a task
|
| 113 |
+
task_msg = agent.create_task_request(
|
| 114 |
+
peer,
|
| 115 |
+
task_description="Analyze this dataset",
|
| 116 |
+
priority="high",
|
| 117 |
+
deadline="2026-07-10T00:00:00Z"
|
| 118 |
+
)
|
| 119 |
+
```
|
| 120 |
+
|
| 121 |
+
---
|
| 122 |
+
|
| 123 |
+
## 📚 Learn More
|
| 124 |
+
|
| 125 |
+
### Documentation
|
| 126 |
+
|
| 127 |
+
- **README.md** - Project overview and features
|
| 128 |
+
- **PHASE1_COMPLETE.md** - Technical specifications
|
| 129 |
+
- **BLOG_POST.md** - Vision and use cases
|
| 130 |
+
- **API Reference** - See `sdk-python/README.md`
|
| 131 |
+
|
| 132 |
+
### Examples
|
| 133 |
+
|
| 134 |
+
- **basic_handshake.py** - Complete handshake demo
|
| 135 |
+
- **verify_phase1.py** - Verification script
|
| 136 |
+
|
| 137 |
+
### Community
|
| 138 |
+
|
| 139 |
+
- **Discussions:** https://huggingface.co/bhaskarvilles/aipm (Community tab)
|
| 140 |
+
- **Issues:** Report bugs or request features
|
| 141 |
+
- **Contributing:** See CONTRIBUTING.md (coming soon)
|
| 142 |
+
|
| 143 |
+
---
|
| 144 |
+
|
| 145 |
+
## 🔐 Security Note
|
| 146 |
+
|
| 147 |
+
AIPM uses Ed25519 cryptographic signatures for security:
|
| 148 |
+
|
| 149 |
+
```python
|
| 150 |
+
# Keys are auto-generated
|
| 151 |
+
agent = AIPMAgent(identity, auto_generate_keys=True)
|
| 152 |
+
|
| 153 |
+
# Public key is included in identity
|
| 154 |
+
print(f"Public key: {agent.identity.public_key}")
|
| 155 |
+
```
|
| 156 |
+
|
| 157 |
+
---
|
| 158 |
+
|
| 159 |
+
## 🚀 What's Next?
|
| 160 |
+
|
| 161 |
+
### Explore Features
|
| 162 |
+
|
| 163 |
+
1. **Capability Discovery** - See what agents can do
|
| 164 |
+
2. **Trust Scores** - Evaluate agent reliability
|
| 165 |
+
3. **Secure Sessions** - Cryptographic handshake
|
| 166 |
+
4. **Economic Info** - Understand costs
|
| 167 |
+
|
| 168 |
+
### Phase 2 (Coming Soon)
|
| 169 |
+
|
| 170 |
+
- HTTP/WebSocket transport
|
| 171 |
+
- Task negotiation framework
|
| 172 |
+
- Automatic message signing
|
| 173 |
+
- Memory exchange protocol
|
| 174 |
+
|
| 175 |
+
---
|
| 176 |
+
|
| 177 |
+
## 💡 Quick Tips
|
| 178 |
+
|
| 179 |
+
**Tip 1: Message Types**
|
| 180 |
+
|
| 181 |
+
AIPM supports these message types:
|
| 182 |
+
- Handshake: HELLO, CAPABILITY_EXCHANGE, AUTHENTICATION, etc.
|
| 183 |
+
- Tasks: TASK_REQUEST, TASK_ACCEPT, TASK_DECLINE
|
| 184 |
+
- Memory: MEMORY_SHARE, MEMORY_REQUEST
|
| 185 |
+
- Errors: ERROR
|
| 186 |
+
|
| 187 |
+
**Tip 2: Custom Handlers**
|
| 188 |
+
|
| 189 |
+
Register custom message handlers:
|
| 190 |
+
|
| 191 |
+
```python
|
| 192 |
+
def handle_custom_message(msg):
|
| 193 |
+
print(f"Received: {msg.type}")
|
| 194 |
+
return response_msg
|
| 195 |
+
|
| 196 |
+
agent.register_handler(MessageType.CUSTOM, handle_custom_message)
|
| 197 |
+
```
|
| 198 |
+
|
| 199 |
+
**Tip 3: Trust Scores**
|
| 200 |
+
|
| 201 |
+
Update trust scores based on interactions:
|
| 202 |
+
|
| 203 |
+
```python
|
| 204 |
+
identity.trust_score.reliability = 0.99
|
| 205 |
+
identity.trust_score.success_rate = 0.98
|
| 206 |
+
identity.trust_score.total_interactions += 1
|
| 207 |
+
```
|
| 208 |
+
|
| 209 |
+
---
|
| 210 |
+
|
| 211 |
+
## ❓ Common Issues
|
| 212 |
+
|
| 213 |
+
### Import Error
|
| 214 |
+
|
| 215 |
+
```
|
| 216 |
+
ModuleNotFoundError: No module named 'aipm'
|
| 217 |
+
```
|
| 218 |
+
|
| 219 |
+
**Solution:** Make sure you installed the SDK:
|
| 220 |
+
```bash
|
| 221 |
+
cd sdk-python && pip install -e .
|
| 222 |
+
```
|
| 223 |
+
|
| 224 |
+
### Handshake Failed
|
| 225 |
+
|
| 226 |
+
```
|
| 227 |
+
HandshakeError: Cannot send HELLO from state HELLO_SENT
|
| 228 |
+
```
|
| 229 |
+
|
| 230 |
+
**Solution:** Each agent pair needs separate handshake managers. Create new agent instances or reset the handshake:
|
| 231 |
+
```python
|
| 232 |
+
agent.handshake_managers[peer_key].reset()
|
| 233 |
+
```
|
| 234 |
+
|
| 235 |
+
### Validation Error
|
| 236 |
+
|
| 237 |
+
```
|
| 238 |
+
ValidationError: version must be in format X.Y.Z
|
| 239 |
+
```
|
| 240 |
+
|
| 241 |
+
**Solution:** Use semantic versioning:
|
| 242 |
+
```python
|
| 243 |
+
version="1.0.0" # ✓ Correct
|
| 244 |
+
version="1.0" # ✗ Wrong
|
| 245 |
+
```
|
| 246 |
+
|
| 247 |
+
---
|
| 248 |
+
|
| 249 |
+
## 📞 Get Help
|
| 250 |
+
|
| 251 |
+
- **Documentation:** Read the guides in the repository
|
| 252 |
+
- **Examples:** Check `examples/` directory
|
| 253 |
+
- **Discussions:** Ask questions on HF
|
| 254 |
+
- **Issues:** Report bugs on the repository
|
| 255 |
+
|
| 256 |
+
---
|
| 257 |
+
|
| 258 |
+
## 🎯 Next Steps
|
| 259 |
+
|
| 260 |
+
1. ✅ Try the interactive demo
|
| 261 |
+
2. ✅ Install SDK locally
|
| 262 |
+
3. ✅ Run the examples
|
| 263 |
+
4. ✅ Read the documentation
|
| 264 |
+
5. ✅ Join the community discussions
|
| 265 |
+
6. ✅ Build your first integration
|
| 266 |
+
|
| 267 |
+
---
|
| 268 |
+
|
| 269 |
+
**Happy Building! 🚀**
|
| 270 |
+
|
| 271 |
+
Visit https://huggingface.co/bhaskarvilles/aipm for more information.
|