Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

DigitalKin Python SDK

digitalkin is the Python SDK for writing modules (tools and archetypes) of the DigitalKin agentic mesh. You declare typed Pydantic contracts and trigger handlers; the SDK serves them over gRPC. Each module process embeds a gateway that persists outputs to Redis Streams and pushes them to the consumer.

What it is not

  • Not a standalone gateway process: the gateway runs inside each module server.
  • Not a registry server: modules register with an external registry in remote mode.
  • Not a client library: the consumer calls StartStream and hosts the dial-back Stream endpoint itself.
  • Not the wire contract: protos come from the agentic-mesh-protocol package.

Install

uv add digitalkin or pip install digitalkin (Python 3.10+); add [agno] for the Agno integration. Extras: agno (Agno integration), performance (uvloop), profiling.

Quick start

Files: echo_module.py, server.py, triggers/__init__.py, triggers/echo_trigger.py (discovery imports *_trigger.py).

# echo_module.py
from typing import Any, ClassVar, Literal
from pydantic import BaseModel
from digitalkin import ModuleContext, ToolModule
from digitalkin.models.module import DataModel, DataTrigger, SetupModel
from digitalkin.utils.package_discover import ModuleDiscoverer

class EchoIn(DataTrigger):
    protocol: Literal["message"] = "message"
    text: str

class EchoOut(DataTrigger):
    protocol: Literal["message"] = "message"
    reply: str

class EchoInput(DataModel[EchoIn]):
    root: EchoIn

class EchoOutput(DataModel[EchoOut]):
    root: EchoOut

class EchoSetup(SetupModel):
    prefix: str = "echo: "

class EchoModule(ToolModule[EchoInput, EchoOutput, EchoSetup, BaseModel]):
    name = "EchoModule"
    description = "Echoes the input text."
    input_format = EchoInput
    output_format = EchoOutput
    setup_format = EchoSetup
    secret_format = BaseModel  # no secrets
    metadata: ClassVar[dict[str, Any]] = {"module_id": "modules:echo", "version": "0.1.0"}
    services_config_params: ClassVar[dict[str, Any]] = {"storage": {"config": {}}, "cost": {"config": {}}}
    triggers_discoverer = ModuleDiscoverer(packages=["triggers"])

    async def initialize(self, context: ModuleContext, setup_data: EchoSetup) -> None:
        pass  # open clients, build agents

    async def cleanup(self) -> None:
        pass
# triggers/echo_trigger.py
from digitalkin import ModuleContext, TriggerHandler
from echo_module import EchoIn, EchoModule, EchoOut, EchoOutput, EchoSetup

@EchoModule.register
class EchoTrigger(TriggerHandler):
    protocol = "message"
    input_format = EchoIn
    output_format = EchoOut

    async def handle(self, input_data: EchoIn, setup_data: EchoSetup, context: ModuleContext) -> None:
        reply = EchoOut(reply=setup_data.prefix + input_data.text)
        await context.callbacks.send_message(EchoOutput(root=reply))
# server.py
import asyncio
from digitalkin.grpc_servers.module_server import ModuleServer
from echo_module import EchoModule

async def main() -> None:
    server = ModuleServer(EchoModule)
    await server.start_async()
    try:
        await server.await_termination()
    finally:
        await server.stop_async()

asyncio.run(main())
docker compose -f examples/redis_demo/docker-compose.yml up -d     # Redis on localhost:6379
SERVICE_MODE=local DIGITALKIN_REDIS_URL=redis://localhost:6379/0 python server.py

The server listens on SERVER_CHANNEL_HOST:SERVER_CHANNEL_PORT (default [::]:50055). SERVICE_MODE=local (or -d LOCAL) uses in-process services; remote mode (default) needs the variables in .env.minimum. Consumers drive the module with the gateway RPCs described in the gateway protocol page.

Documentation

Topic Page
Architecture, data and signal flow docs/architecture.md
Writing modules docs/module_authoring.md
Wire contracts docs/gateway_protocol.md, docs/agui_events.md (AG-UI)
Deploy and tune docs/operations.md
Environment variables docs/environment_variables.md
Testing docs/testing.md
Changelog docs/changelog/index.md
API reference docs/api/api.md

Development

task setup-dev     # venv, dev/docs/tests deps, pre-commit hooks
task check         # ruff format + lint, mypy, tests
task run-tests     # full suite in docker compose (needs Redis)
task docs-serve    # mkdocs serve

License: CC BY-NC-SA 4.0.

Metadata

Release files for digitalkin 1.0.5.dev8

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

Source distribution (sdist)

Source distribution for digitalkin 1.0.5.dev8
File Size Uploaded Provenance Actions
digitalkin-1.0.5.dev8.tar.gz 395.8 kB With provenance Details for digitalkin-1.0.5.dev8.tar.gz

Built distribution (wheel)

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

Total release size: 911.6 kB

Release files / digitalkin-1.0.5.dev8.tar.gz

Download URL digitalkin-1.0.5.dev8.tar.gz
Size 395.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d76833481b193846a926af71ba33b63d2e177af6a81577e05446258977863525
BLAKE2b-256 checksum
How to use checksums
7db47919fa72a412eb33d2b7a16fbacbf2e0a24f02d8c40eaa99425870dc2336
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Release files / digitalkin-1.0.5.dev8-py3-none-any.whl

Download URL digitalkin-1.0.5.dev8-py3-none-any.whl
Size 515.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f61e900df93d4158a6e81c850b9919ebd1893ba305cadc9ed320f005b7caf4e9
BLAKE2b-256 checksum
How to use checksums
317d2d6791e69351c3a4360286684cce581548028f62da186f321768074b3636
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Security for digitalkin 1.0.5.dev8

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for digitalkin-1.0.5.dev8.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

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
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