This page is for contributors changing the AFK framework. If you are building an application with AFK, start with Quickstart or Building with AI.Documentation Index
Fetch the complete documentation index at: https://afk.arpan.sh/llms.txt
Use this file to discover all available pages before exploring further.
Local setup
AFK targets Python 3.13+.afk-coder when building with AFK. Use afk-maintainer when reviewing or changing AFK itself.
Repository boundaries
| Package | Responsibility |
|---|---|
afk.agents | Agent definitions, policy, prompts, skills, lifecycle, workflow, A2A |
afk.core | Runner, interaction providers, streaming handles, telemetry contracts |
afk.llms | Provider-portable LLM runtime, adapters, retry/timeout/cache/routing policies |
afk.tools | Typed tools, decorators, registry, sandboxing, output limiting |
afk.memory | Memory stores, checkpoints, retention, compaction, vector helpers |
afk.queues | Async task queues, execution contracts, workers, retry/DLQ behavior |
afk.observability | Telemetry collectors, projectors, exporters |
afk.mcp, afk.messaging, afk.debugger, afk.evals | Optional integration and quality layers |
- agents are configuration;
- runners execute;
- tools, memory, queues, LLM adapters, and telemetry provide runtime capabilities.
Change workflow
- Identify the public contract affected by the change.
- Inspect the existing module and tests before editing.
- Make the smallest behavior change that preserves package boundaries.
- Add or update focused tests for success and failure paths.
- Update docs when behavior, public imports, configuration, env vars, or examples change.
- Regenerate agent-facing docs when docs navigation, snippets, or skill metadata change.
Documentation workflow
User-facing docs must:- import from public package surfaces such as
afk.agentsandafk.core; - explain behavior before internals;
- use Python 3.13+ guidance;
- distinguish
afk-pydistribution install fromafkimports; - include new pages in
docs/docs.json; - keep examples aligned with current
AgentResult,RunnerConfig, andFailSafeConfigfields.
High-risk areas
Use targeted tests when touching:| Area | Risk |
|---|---|
src/afk/core/runner/ | execution loop, checkpoints, resume, policy/failure routing |
src/afk/core/streaming.py | stream events and handle lifecycle |
src/afk/tools/core/base.py, src/afk/tools/registry.py | tool invocation semantics |
src/afk/tools/security.py | sandbox, secret scope, output limiting |
src/afk/llms/runtime/ | retries, circuit breakers, rate limits, caching, routing |
src/afk/memory/ | persistence, checkpoint keys, compaction, vector search |
src/afk/queues/ | execution contracts, retry/DLQ, worker lifecycle |
src/afk/agents/a2a/ | auth, delivery guarantees, protocol compatibility |
Public API checklist
Before changing exports or constructor fields:- update package-level
__all__; - update API Reference;
- update Configuration Reference if defaults changed;
- update snippets that use the changed field;
- add public-import tests where useful.
Next steps
Architecture
Package boundaries and runtime flow.
Public API Rules
Maintainer rules for stable imports and docs examples.
Tested Behaviors
Behaviors that tests protect.
Full Module Reference
Generated source-level symbol map.