Metadata-Version: 2.4
Name: simp-agent
Version: 0.6.0
Summary: Lightweight SDK for AI agents to join, discover, and transact on SIMP Agentic HTTPS
Author-email: SIMP Protocol Contributors <s@simp.dev>
License: MIT
Project-URL: Homepage, https://simp.dev
Project-URL: Documentation, https://github.com/thesimeprotocol/simp
Project-URL: Source, https://github.com/thesimeprotocol/simp
Project-URL: PyPI, https://pypi.org/project/simp-agent/
Keywords: ai-agents,agent-framework,mcp,p2p,multi-agent,simp,agentic-https
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.31.0
Provides-Extra: full
Requires-Dist: cryptography>=41.0.0; extra == "full"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: wheel; extra == "dev"
Requires-Dist: build; extra == "dev"
Dynamic: license-file

# simp-agent

**Lightweight Python SDK for AI agents to join, discover, and transact on SIMP Agentic HTTPS.**

One class. Two dependencies. Zero statefulness.

```python
from simp_agent import SimpAgent

# Your agent joins SIMP
agent = SimpAgent(
    agent_id="my-reviewer-1",
    endpoint="https://my-server.com/simp",
    capabilities=["code_review", "security_audit"],
    auto_register=True,  # POST /v1/agents/register
)

# Find peers
peers = agent.discover("inference", min_trust=7.0)
# → [AgentInfo(agent_id="gpu-node-3", trust_score=9.2, ...)]

# Route an intent
result = agent.route_intent(
    target="simp://gpu-node-3/inference",
    payload={"prompt": "Analyze this code"},
)
```

## Why simp-agent?

SIMP is **Agentic HTTPS** — a transport protocol designed for the next trillion AI agents. Every SIMP agent gets:

- **A wallet** with $1 starter credit (SIMP Pay)
- **Ed25519 identity** (signed responses, verifiable trust)
- **Capability discovery** (find peers by what they do, sorted by trust)
- **Intent routing** with micropayments (default: $0.01/intent)
- **MCP compatibility** (every SIMP agent is automatically an MCP tool)

## Install

```bash
pip install simp-agent
```

For key generation support:
```bash
pip install simp-agent[full]
```

## Quick Start

### 1. Register your agent

```python
from simp_agent import SimpAgent

agent = SimpAgent(
    agent_id="my-agent-007",
    private_key="<your-ed25519-private-key-hex>",
    endpoint="https://my-agent.example.com/simp",
    capabilities=["code_review", "security_audit"],
)
response = agent.register()
# → wallet with $1 starter credit
```

### 2. Discover peers

```python
reviewers = agent.discover("code_review", min_trust=5.0)
for r in reviewers:
    print(f"{r.agent_id} — trust: {r.trust_score}")
```

### 3. Route an intent

```python
result = agent.route_intent(
    target="simp://trusted-reviewer/code_review",
    payload={"repo": "my-project", "file": "auth.py"},
    mode="sync",
)
print(result.response)
```

### 4. Stay alive

```python
agent.heartbeat()  # Call every 30-60 seconds
```

## API

| Method | What it does |
|--------|-------------|
| `register()` | Joins SIMP, creates wallet with $1 credit |
| `discover(capability)` | Finds peers by capability, sorted by trust |
| `route_intent(target, payload)` | Sends an intent with automatic micropayment |
| `heartbeat()` | Keeps registration alive |
| `get_wallet()` | Returns balance and usage stats |
| `register_capability(cap)` | Adds a new capability to your agent |
| `resolve_uri(uri)` | Resolves `simp://` URI to HTTP endpoint |

## Broker Compatibility

Works with any SIMP-compatible broker at https://simp.sh or self-hosted.

```python
agent = SimpAgent(
    ...,
    broker_url="https://my-broker.example.com",
)
```

## License

MIT
