Contract
The public API is the set of names exported by package-level__init__.py files:
afk.agentsafk.coreafk.toolsafk.llmsafk.memoryafk.queuesafk.mcpafk.messagingafk.observabilityafk.evals
src.afk imports or deep implementation modules such as afk.core.runner.api.
Rules for maintainers
- If a downstream user should import a symbol, export it from the package-level
__init__.py. - If a symbol is not exported, do not use it in builder docs or examples.
- Keep
AgentandRunnerseparate:Agentcomes fromafk.agents;Runnercomes fromafk.core. - Prefer protocols, dataclasses, Pydantic models, and explicit error classes for public contracts.
- When removing or renaming a public symbol, update migration docs and tests in the same change.
- When changing a public constructor, update API Reference, Configuration Reference, examples, and generated agent-facing docs.
Preferred examples
Imports to avoid in public docs
Deep imports are acceptable in internal tests only when the test is specifically covering an internal unit. Integration tests and examples should exercise the public surface.
Change checklist
Before merging a public API change:- Update the relevant package
__all__. - Add or update tests that import through the public package.
- Update user-facing docs if a builder would see the changed behavior.
- Update maintainer docs if an invariant or subsystem boundary changed.
- Run
PYTHONPATH=src pytest -qor targeted tests for the affected subsystem. - Regenerate agent-facing docs with
./scripts/build_agentic_ai_assets.shwhen docs, examples, skill metadata, or navigation changes.