Skip to content

Python API

Generated from the dna package docstrings with mkdocstrings. The docstrings in the source are the single source of truth — this page cannot drift from the code because it is rebuilt from it on every mkdocs build.

Reaching this API from another language

This is the in-process surface of the runtime. Other languages consume the same kernel through the REST and MCP faces — see Microkernel & ports. The REST surface is described by docs/openapi.json, and the dna-client packages are generated from it.

Where to start

  • Kernel & Runtime — the mediator over the five ports, and the thin Runtime convenience wrapper. This is the object you construct (Kernel.auto()) and the entry point to everything else.
  • Instance & ManifestInstance — the universal instance wrapper and the blessed read/query surface (all, one, root, default_agent, build_prompt, resolve).
  • Ports & protocols — the five port Protocols a host wires into the kernel (SourcePort, CachePort, ResolverPort, ReaderPort, WriterPort) plus KindPort and the supporting value types.
  • Extensions — the built-in extensions that register Kinds (skills, souls, guardrails, SDLC, …).
  • Testing / conformance kit — the ship-with-the-SDK compliance suites (dna.testing) an adapter author runs against their own port implementation.

The stable, documented read surface is described narratively in How to read instance data; this page is the exhaustive, machine-generated counterpart.