Metadata-Version: 2.4
Name: synapse-adapter-sdk
Version: 0.1.1
Summary: The intelligence layer above the AI protocol layer — canonical IR and adapter framework for heterogeneous AI model pipelines
Project-URL: Homepage, https://github.com/synapse-ir/adapter-sdk
Project-URL: Documentation, https://github.com/synapse-ir/spec
Project-URL: Repository, https://github.com/synapse-ir/adapter-sdk
Project-URL: Bug Tracker, https://github.com/synapse-ir/adapter-sdk/issues
Project-URL: Changelog, https://github.com/synapse-ir/adapter-sdk/blob/main/CHANGELOG.md
Author: SYNAPSE Contributors
License: MIT
License-File: LICENSE
Keywords: a2a,adapter,ai,canonical-ir,interoperability,llm,mcp,pipeline,synapse
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Requires-Dist: pydantic>=2.0
Provides-Extra: dev
Requires-Dist: mypy; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Description-Content-Type: text/markdown

# SYNAPSE Adapter SDK

SYNAPSE is a canonical intermediate representation (IR) protocol that lets AI models with incompatible schemas interoperate through a unified adapter interface.

Write **two functions** — connect your AI model to every other model in the ecosystem.

Without SYNAPSE: 4 models require 6 custom connectors. 10 models require 45.
Each breaks when either model's schema changes.

With SYNAPSE: write one `ingress` and one `egress` adapter. Done.
Your model is immediately composable with every other registered model.

## Install

```bash
pip install synapse-adapter-sdk
```

## Write your first adapter

```python
from synapse_sdk import AdapterBase, CanonicalIR, ProvenanceEntry
from typing import Any

class MyModelAdapter(AdapterBase):
    MODEL_ID = "my-org/my-model-v1.0"
    ADAPTER_VERSION = "1.0.0"

    def ingress(self, ir: CanonicalIR) -> dict[str, Any]:
        return { "input": ir.payload.content }

    def egress(self, output: dict, original_ir: CanonicalIR, latency_ms: int) -> CanonicalIR:
        updated = original_ir.copy()
        updated.provenance.append(self.build_provenance(
            confidence=output["score"],
            latency_ms=latency_ms,
        ))
        return updated
```

## Validate

```bash
synapse-validate --adapter my_module.MyModelAdapter
```

## Documentation

- [Getting started](https://docs.synapse-ir.io/getting-started)
- [Writing adapters](https://docs.synapse-ir.io/adapters)
- [Canonical IR specification](https://github.com/synapse-ir/spec)
- [Registry](https://github.com/synapse-ir/registry)

## What SYNAPSE is not

SYNAPSE does not compete with MCP or A2A. It builds on top of them.
MCP connects agents to tools. A2A connects agents to each other.
SYNAPSE connects specialized models with incompatible schemas — and
makes routing between them smarter over time.

## License

MIT. See [LICENSE](LICENSE).
