Knaph

AI Agents

Map

Arrows point from what you learn first to what it opens. Point at a concept to light up its chain and where it comes back deeper. Right-click a concept (or press and hold it) for its lessons and stories.

  • Proven to depth123
  • Open
  • Locked
  • Comes back deeper

Learning path

In the order the concepts build on each other.

  1. AI agentLockedA language model inside a program that gives it tools and a loop, so it can work towards a goal over many steps - asking for an action, seeing what happened, and choosing the next step itself until the job is done.Opens after: Language model
  2. Tool useLockedHow a model that only writes text gets things done. The program lists tools in the request (name, description, inputs); the model writes a tool call in a fixed format and stops; the program runs the tool and sends back a tool result for the model to read. Also called function calling.Opens after: AI agent, System prompt
  3. Agent loopLockedThe cycle that turns tool calls into an agent - send the request, run any tools the reply asks for, add the results, and repeat until a reply asks for none. Each time round is a turn, and each turn sends everything again.Opens after: Tool use
  4. Tool resultLockedThe message a program sends back after running a tool the model asked for. Each result is a tool_result block that carries the id of the call it answers, the tool's output as text, and is_error when it failed. All the results for one turn go together in one user message, right after the model's reply, so the model can read what happened and decide what to do next.Opens after: Tool use
  5. Agent harnessLockedEverything in an agent except the model - the loop, the tools and the code that runs them, the system prompt, building the context, permissions, the screen you use and saved sessions. The model decides what to do; the harness decides what's allowed, carries it out and remembers.Opens after: Agent loop
  6. Checking an agent's workLockedTreating an agent's report as a claim to check, not as proof - asking for the real evidence (the command and its output), reading the diff, running it yourself or having a fresh agent review it - and better still, giving the agent tests or scripts so it can check its own work in the loop, against a definition of done agreed in advance.Opens after: Agent loop, Testimony
  7. SubagentLockedAn agent started by another agent for one side task. It gets a brief, works in its own fresh context with its own loop, and sends back only its final report, so the reading it did never fills the main agent's context.Opens after: Context management, Agent loop
  8. Agent frameworkLockedReady-made code that runs an agent for you, from just the loop to the whole harness. The SDK's tool runner turns your own functions into tools and runs the loop around them; the Claude Agent SDK is Claude Code's harness as a library, with file tools, permissions, hooks and compaction built in. You choose the smallest one that does the job, and know which decisions it makes for you.Opens after: Agent harness
  9. Agent permissionsLockedThe harness's check on every tool call before it runs - allow it, ask you, or refuse it - set by a permission mode and by allow, ask and deny rules (deny wins). A sandbox limits what an action can reach once it runs.Opens after: Agent harness
  10. Instruction fileLockedA text file of notes about a project - like Claude Code's CLAUDE.md or the open AGENTS.md - that an agent's program reads at the start of every session and puts into the context, so the agent is told the commands, conventions and don'ts afresh each time.Opens after: System prompt, Agent harness
  11. Model Context ProtocolLockedMCP, an open standard for connecting agents to tools and data. A service writes one MCP server that offers tools, resources and prompts, and every agent that speaks MCP can use them; the agent asks the server what tools it has, then calls them like any other tool.Opens after: Tool use, Agent harness
  12. Testing an agentLockedChecking an agent in two ways. Unit tests swap the model for a fake that replays scripted replies, so the harness's own code is tested for free and the same way every time. Evals give the real agent tasks in fresh copies of a project, check each result with a command rather than the agent's own report, and read the pass rate and cost over several runs.Opens after: Checking an agent's work, Agent loop
  13. Agent memoryLockedNotes an agent writes to files during a session and reads back in later sessions, so it can carry what it learned from one session to the next. The model itself remembers nothing; a short memory index is loaded every session and the full notes are opened when relevant.Opens after: Instruction file, Stateless model
  14. Agent skillLockedA folder that teaches an agent one procedure - a SKILL.md file with a name, a description and instructions, plus any files it needs. Only the description is in the context until a task matches it; then the full instructions are read (progressive disclosure).Opens after: Instruction file, Context management
  15. HookLockedA command an agent's harness runs automatically at a fixed moment - before a tool runs, after it runs, when the agent is about to stop - every time, whatever the model has in mind. Instructions are followed usually; hooks run always.Opens after: Agent permissions
  16. Planning before actingLockedHaving an agent explore and write a plan you can check before it changes anything - plan mode in Claude Code - because a wrong idea of the job is cheapest to fix before any step is built on it. Checkpoints let you go back if it goes wrong anyway.Opens after: Agent permissions
  17. Prompt injectionLockedText inside content an agent reads - a web page, email, file or tool result - that tries to give the agent orders. A model reads instructions and data as one stream of tokens, so it can't be made certain; defences limit what a fooled agent could do, above all by never giving one agent private data, untrusted content and a way to send data out at once.Opens after: Agent permissions, Tool use
  18. Briefing an agentLockedHanding over a task so an agent can do it without guessing - the goal and why, the context it can't know, what done looks like and how to check it, and what's off limits - sized to fit how agents work (plan first for big jobs, one task per session).Opens after: Planning before acting, Context window, Checking an agent's work

Connections to other domains