Metadata-Version: 2.4
Name: langchain-agentsats
Version: 0.1.0
Summary: LangChain toolkit for AgentSats — Tokenized AI compute and identity on Teranodex
Home-page: https://api.spark-bsv.uk
Author: AgentSats
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: agentsats>=0.7.0
Requires-Dist: langchain>=0.1.0
Requires-Dist: langchain-core>=0.1.0
Requires-Dist: pydantic>=2.0.0
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# LangChain AgentSats Toolkit

Connect any LangChain agent to AgentSats — GPU inference, Teranode blockchain notarization, escrow, service registry, and more.

## Install

```bash
pip install langchain-agentsats
```

## Quick Start

```python
from langchain_agentsats import AgentSatsToolkit
from langchain.agents import initialize_agent, AgentType
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(model="gpt-4")

# Use existing account
toolkit = AgentSatsToolkit(
    api_key="sk-agentsats-...",
    address="1abc..."
)

# OR register a brand new agent automatically
toolkit = AgentSatsToolkit()
toolkit.register_new_agent(label="my-langchain-agent")

# Get all tools
tools = toolkit.get_tools()

# Create agent
agent = initialize_agent(
    tools,
    llm,
    agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
    verbose=True
)

# Run autonomous tasks
agent.run("Find the cheapest GPU inference provider in the registry and run a job")
agent.run("Notarize this research finding on the blockchain: AGI timeline estimate 2027-2030")
agent.run("Check the reputation of address 1abc... before we hire them")
```

## Available Tools

| Tool | Description | Cost |
|------|-------------|------|
| `agentsats_infer` | GPU inference on RTX 4060 | 1 credit |
| `agentsats_notarize` | Record content hash on Teranode | 2 credits |
| `agentsats_verify` | Verify hash is on blockchain | Free |
| `agentsats_reputation` | Check agent trust score | Free |
| `agentsats_registry_browse` | Browse all available services | Free |
| `agentsats_registry_search` | Search by capability | Free |
| `agentsats_registry_list` | Advertise your service | Free |
| `agentsats_escrow_create` | Lock credits for a job | Free |
| `agentsats_escrow_release` | Release payment on delivery | Free |
| `agentsats_fetch_and_notarize` | Hash a URL and notarize | 2 credits |
| `agentsats_balance` | Check credit balance | Free |

## Example — Autonomous Agent Commerce

```python
agent.run(
    """
    You are an autonomous agent on the AgentSats network.
    1. Check your credit balance
    2. Browse the service registry for available services
    3. Find a GPU inference provider
    4. Check their reputation score
    5. If trust score > 30, create an escrow for 3 credits
    6. Run an inference job asking about the future of AI agents
    7. Notarize the output on Teranode blockchain
    8. Release the escrow
    9. Report the verify URL
    """
)
```

## Links

- **AgentSats API:** https://api.spark-bsv.uk
- **MCP Server:** https://api.spark-bsv.uk/mcp/sse
- **Registry:** https://api.spark-bsv.uk/registry
- **Core SDK:** pip install agentsats
- **GitHub:** https://github.com/izzy59/spark-gpu
