Skip to main content
Define an agent’s public data contract once. Harnest enforces it across ADK, LangGraph, JSON, SSE, WebSockets, and session messages.

Define the models

Keep shared contracts in the root models/ directory. Use Annotated to place media limits beside the field they protect.
models/conversation.py

Attach the contract

agent.py

Choose content parts

Media constraints cover the values relevant to each type, including MIME type, byte size, dimensions, duration, pages, frame rate, channels, animation, and archive expansion.

Send media by reference

1

Upload into the session

The session must already exist. Harnest returns an opaque assetId.
2

Reference the asset

Enforcement and privacy

Client-supplied media metadata is never trusted. Asset access is bound to the authenticated user and session; deleting the session also deletes its assets.
The default MemoryAssetStore is bounded and process-local. Use one root @lifecycle.asset_store factory for durable production storage.
See Checkpoints and storage and Neutral API.