AFK is a Python 3.13+ SDK for building AI agents that need to run reliably outside a demo. You define agents, tools, policies, and memory as typed Python contracts. The runner handles the agent loop, LLM calls, tool execution, streaming, checkpoints, telemetry, and safety limits.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.
Choose your path
Build with AFK
Start here if you are building an application, workflow, chatbot, coding tool,
or production agent on top of AFK.
Maintain AFK
Start here if you are changing AFK itself, reviewing internals, or updating
public contracts.
Install
The distribution package isafk-py; the import package is afk.
- pip
- uv
- local repo
First agent
Agentis configuration: model, instructions, tools, policies, subagents, and defaults.Runneris execution: LLM calls, tool calls, memory, streaming, checkpoints, and telemetry.AgentResultis the run record: final text, terminal state, tool/subagent records, usage, and cost.
Core capabilities
Agents
Declarative agent definitions with instructions, tools, subagents, skills,
MCP servers, and safety limits.
Runner
Sync, async, and streaming execution with lifecycle control and thread
continuity.
Tools
Typed Python tools with Pydantic validation, hooks, middleware, sandboxing,
and bounded output.
LLM Runtime
Provider-portable LLM clients with retries, timeouts, rate limits, caching,
circuit breakers, and fallback chains.
Memory
Thread state, checkpoints, retention, compaction, and persistent stores.
Production
Evals, observability, queues, security controls, deployment guidance, and
troubleshooting.
AFK skills
Install the AFK skills with Vercel’s Skills CLI when you want Codex or another supported agent to use AFK-specific guidance:afk-coder when building applications with AFK. Use afk-maintainer when reviewing or changing AFK itself. See Agent Skills for details.
How AFK fits together
Next steps
Quickstart
Build one runnable agent with one typed tool.
Learn AFK in 15 Minutes
Walk through agents, tools, streaming, memory, and safety.
Examples
Find complete snippets by scenario.
API Reference
Check canonical imports, signatures, result fields, and stability rules.