Skip to main content
models/ and lib/ contain shared Python used by the agent bundle. Unlike tools, subagents, MCP clients, and extensions, neither folder is capability discovery.

models/

Put shared Pydantic contracts under root models/ and import them through the compiler-owned harnest.models namespace. For example, models/orders.py becomes harnest.models.orders:
Use these contracts for agent, graph, tool, and client-tool input or output. The folder is root-only and needs no __init__.py.

Typed multimodal contracts

Enforce Pydantic input, output, tool-result, and media contracts across both frameworks and every managed transport.

lib/

Put ordinary reusable implementation under root lib/ and import it through harnest.lib. For example, lib/storage/queries.py becomes harnest.lib.storage.queries:
Library functions do not become tools or agents by themselves. The same namespace works in compilation, tests, evals, and serving. lib/ is root-only. Add third-party packages used by either namespace to the agent’s pyproject.toml. Add __init__.py only for intentional library initialization, not to make discovery work.