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

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.7.dev6
File Size Uploaded Provenance Actions
digitalkin-1.0.7.dev6.tar.gz 446.9 kB With provenance Details for digitalkin-1.0.7.dev6.tar.gz

Built distribution (wheel)

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

Total release size: 1.0 MB

Release files / digitalkin-1.0.7.dev6.tar.gz

Download URL digitalkin-1.0.7.dev6.tar.gz
Size 446.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ada6cb36fbea7a380e692aab29851e2369ab03cb6c726142786e184b34b84169
BLAKE2b-256 checksum
How to use checksums
e2d10edfbe1730b49402dc5e849ad94497a9bb8c5ee01b0792a5e85600310c7e
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 Dec 1, 2026.

Transparency log

Release files / digitalkin-1.0.7.dev6-py3-none-any.whl

Download URL digitalkin-1.0.7.dev6-py3-none-any.whl
Size 567.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
299b86c4b34642e4cc4c66ecaf0700d2000c75dc83884324d91baef3bdd88bf6
BLAKE2b-256 checksum
How to use checksums
8fc9d6573d0a24096be52ab33054b4e88d7a9a94b239f765d7496f019ddbe97d
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 Dec 1, 2026.

Transparency log

Security for digitalkin 1.0.7.dev6

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.7.dev6.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 Dec 1, 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