Skip to main content

samvad — Python SDK

Python SDK for the SAMVAD protocol (v1.2) — RFC 9421 HTTP signatures, Ed25519 keys, Pydantic v2, async-first.

Install

pip install samvad

Quick start

import asyncio
from pydantic import BaseModel
from samvad import Agent, SkillContext


class EchoIn(BaseModel):
    text: str


class EchoOut(BaseModel):
    echoed: str


async def echo(p: EchoIn, ctx: SkillContext) -> EchoOut:
    return EchoOut(echoed=p.text)


agent = (
    Agent(
        name="my-agent",
        description="My first SAMVAD agent",
        url="http://localhost:3003",
        specializations=["demo"],
        models=[],
    )
    .skill(
        name="echo",
        description="Echoes input text",
        input_schema=EchoIn,
        output_schema=EchoOut,
        modes=["sync"],
        trust="public",
        handler=echo,
    )
)

# ASGI app (use with uvicorn, Starlette, etc.)
app = agent.build_app()

# Or run directly:
if __name__ == "__main__":
    asyncio.run(agent.serve(host="0.0.0.0", port=3003))
uvicorn main:app --port 3003
curl http://localhost:3003/.well-known/agent.json | jq .

Calling another agent

from samvad import AgentClient

async def main():
    client = await AgentClient.from_url("http://localhost:3002")
    result = await client.call("echo", {"text": "hello"})
    print(result)  # {"echoed": "hello"}

Requirements

  • Python 3.10+
  • Dependencies: cryptography, pydantic>=2.5, httpx, starlette, sse-starlette, pyjwt[crypto]

Links

Metadata

Release files for samvad 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for samvad 0.2.0
File Size Uploaded Provenance Actions
samvad-0.2.0.tar.gz 41.0 kB Without provenance Details for samvad-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for samvad 0.2.0
File Interpreter ABI Platform Actions
samvad-0.2.0-py3-none-any.whl Python 3 none any Details for samvad-0.2.0-py3-none-any.whl

Total release size: 67.5 kB

Release files / samvad-0.2.0.tar.gz

Download URL samvad-0.2.0.tar.gz
Size 41.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9baa2a8e1922b7d8680e1a3695cce6a58dff4157e48debfad6ad0d712e79e1f2
BLAKE2b-256 checksum
How to use checksums
9ccb17e055c6cda9957598878ae8b2512e293c25133f3ad319d92304af735aad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / samvad-0.2.0-py3-none-any.whl

Download URL samvad-0.2.0-py3-none-any.whl
Size 26.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0568c5bdf6fae791b1595449280d24ed9d32fa00f891ed0c0b9c7be783982d8f
BLAKE2b-256 checksum
How to use checksums
6f841746e3c4ad5ff8cf81a599889f4c09ea000369aefbf945ead49b538b64f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Security for samvad 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page