Skip to main content

Agent Concept Map

This page is ai4j's concept GPS — 20 core agent concepts organized into 7 capability clusters. Each cluster marks the relationships between concepts, with a one-sentence positioning and a direct link to the detail page.

Why this page exists

ai4j's documentation is organized by subsystem (Core SDK / Agent Runtime / Coding Agent / MCP / FlowGram…), and each subsystem has its own concept entry page. But agent concepts span multiple subsystems — Function Call lives in Core SDK, Hooks in Agent Runtime, Compaction in Agent + Coding Agent — so readers easily get lost between sections.

This page does not duplicate the content of each detail page. It is only responsible for: telling you what the 20 concepts are, which layer each one belongs to, how they relate to each other, and which page to start reading from.

Concept panorama

┌─────────────────────────────────────────────────────────────┐
│ Capability triangle (how the model acts) │
│ Function Calling ←──→ MCP ←──→ Skill │
│ execute code connect external tools methodology │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Memory & context chain (how state is managed) │
│ Memory → Context Window → Compaction → Checkpoint │
│ store facts manage window compact archive & recover │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Execution core layers (how work is divided) │
│ Agent Loop → DAG/Workflow → Subagents → Agent Teams │
│ single-step loop orchestrate DAG dispatch subtasks multi-agent collaboration │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Security boundary (what can and can't be done) │
│ Sandbox + Hooks + Plugin + Workspace Trust │
│ isolated execution event interception contribute capabilities trust gate │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Observability (what happened) │
│ Trace → Replay / Audit │
│ real-time tracing replay & recovery + tamper-evident │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ External protocols & knowledge augmentation (how to │
│ interact with the outside world) │
│ A2A + ACP + MCP Server + RAG │
│ agent interconnect IDE protocol expose tools knowledge augmentation │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Engineering (how to reach production) │
│ Session + Prompt + Harness │
│ session management prompt assembly coding agent host │
└─────────────────────────────────────────────────────────────┘

1. The capability triangle: Function Calling ↔ MCP ↔ Skill

This is ai4j's most central conceptual relationship — all three let the model "do things," but through entirely different mechanisms. Understand this triangle before diving into any one of them.

ConceptOne sentenceLayerDetail page
Function CallingThe model calls Java methods you declare (@FunctionCall / built-in / SPI), executed inside the host processCore SDKTools overview
MCPA standard protocol that connects external tool servers (local stdio / remote HTTP); the tools do not live in your processCore SDK → top-level MCPMCP overview
SkillRather than executing an action, it gives the model methodology guidance (SKILL.md) to read on demand; it controls the "how to do it" knowledgeCore SDKSkills overview
How to choose between the three

The three are not mutually exclusive; they can be used together. The core distinction:

  • Function Calling = model → your code (in-process)
  • MCP = model → external tool server (cross-process)
  • Skill = model → methodology document (no execution, just knowledge)

For the detailed comparison table and decision framework, see Skill vs Tool vs MCP.


2. Memory & context chain

The full path of state from "remember" to "compact" to "recover." These 4 concepts are progressive — later concepts depend on earlier ones.

ConceptOne sentenceLayerDetail page
Memory / Chat MemorySession-level fact storage (system/user/assistant/tool-call/tool-output/summary); storage and retention policies are decoupledCore SDKMemory overview
Context Window ManagementManages the size of the context window that enters the model (ContextBudget limits entries/characters/pinned prefix)Agent RuntimeContext Window Management
CompactionCompresses the context (ContextProjector trims by strategy / microcompact tool results / auto-compact circuit breaker)Agent + Coding AgentMemory Compact Context · Compact & Checkpoint
Checkpoint / ResumeStructured archive + crash recovery (ResumeCache skips completed side effects + hash-chained tamper-evident audit)Agent + Coding AgentReplay, Recovery & Audit · Compact & Checkpoint
Cross-layer note

Compaction and Checkpoint are both implemented in the Agent Runtime layer and the Coding Agent layer, with different concerns at each layer:

  • Agent layer: ContextProjector + ResumeCache (context/recovery for general agents)
  • Coding Agent layer: CodingSessionCompactor + CodingSessionCheckpoint (pipeline specific to coding sessions)

Start from the concept page in the Agent layer, then jump to the Coding Agent layer for the engineering implementation.


3. Execution core layers

A 4-level progression from "single-agent single-step loop" to "multi-agent collaboration." Each level is a superset of the previous one.

ConceptOne sentenceLayerDetail page
Agent Loop (ReAct / CodeAct)A single agent's think→act→observe loop; ReAct uses tool calls, CodeAct uses code executionAgent RuntimeMinimal React Agent · CodeAct Runtime
DAG / Workflow OrchestrationOrchestrates multiple agent steps into a directed acyclic graph (StateGraph); declare nodes + edges + conditional branchesAgent RuntimeWorkflow StateGraph
SubagentsThe main agent delegates subtasks to isolated subagents (independent memory + tool + session)Agent RuntimeSubagent Handoff Policy
Agent TeamsMultiple agents form a team that coordinates task assignment, parallel execution, and result aggregation through a TaskBoardAgent RuntimeAgent Teams

4. Security boundary

Four gates that control what an agent can and cannot do. Together these concepts form ai4j's security perimeter.

ConceptOne sentenceLayerDetail page
SandboxIsolated code execution environment (E2B / Daytona / CubeSandbox); the agent runs code inside a remote sandboxAgent RuntimeSandbox SPI · CubeSandbox
Lifecycle HooksIntercepts, approves, or observes agent behavior at PreToolUse / PostToolUse / Stop and other event pointsAgent + Coding AgentPlugin Lifecycle Hooks · Lifecycle Hooks
Plugin / ExtensionThird parties package jars to contribute tool/command/skill/prompt, gated by a discover→enable→expose three-stage pipelineCore SDK (extension-api)Extension overview · Extend ai4j
Workspace TrustPauses for a y/n prompt on first entry into an untrusted directory; managed via ~/.ai4j/trusted-dirs.txt; ai4j cli trust commandCoding AgentLifecycle Hooks & Trust
Security model boundary
  • Sandbox controls execution isolation (code runs remotely, not on your machine)
  • Hooks control behavior interception (check + approve before/after the agent executes)
  • Plugin controls capability contribution (not exposed unless given)
  • Workspace Trust controls first-time trust (config is not loaded for untrusted directories)

The four are orthogonal — an agent can be sandbox-isolated + hook-intercepted + limited to an allowlist of tools + restricted to run only in trusted directories, all at once.


5. Observability

What happened during agent execution, whether it can be traced back, and whether it can be recovered.

ConceptOne sentenceLayerDetail page
Agent Trace / ObservabilityThe runtime publishes a unified event stream (MODEL_REQUEST / TOOL_CALL / TOOL_RESULT); trace consumes it, folds it into spans, and exports to OTel / Langfuse / JSONLAgent RuntimeTrace & observability
Replay / AuditNode-level I/O replay (live/mock), crash resume (ResumeCache), and tamper-evident hash-chained audit logAgent RuntimeReplay, Recovery & Audit
The event stream is the foundation

Both Trace and Replay are consumers of the runtime event stream, not instrumentation — the events are already published; trace/replay only decides how to consume them. This means you can add trace export or replay recovery at any time without modifying agent code.


6. External protocols & knowledge augmentation

How the agent interacts with the outside world — with other agents, with the IDE, with tool servers, with knowledge bases.

ConceptOne sentenceLayerDetail page
A2A (Agent-to-Agent)A JSON-RPC + SSE protocol that exposes an ai4j agent as a service other agents can discover and callAgent RuntimeA2A
ACP (Agent Client Protocol)Newline-delimited JSON-RPC (not LSP framing) that lets an IDE / desktop shell drive a coding session (create/load/prompt/permission confirmation)Coding AgentACP integration · Programmatic integration
MCP ServerExposes ai4j's tools as an MCP server (streamable-HTTP / SSE / stdio); other MCP clients can discover and call themMCP (top-level)Build Your MCP Server
RAGIngestion → chunking → embedding → vector store → retrieval → rerank → citation: a complete knowledge augmentation pipelineCore SDKSearch and RAG overview

7. Engineering

Three engineering concepts that take you from SDK calls to a production-grade agent application.

ConceptOne sentenceLayerDetail page
Session ManagementAgentSession as a stateful long-running container (sessionId + independent memory + event log + snapshot/restore)Agent + Coding AgentSession Runtime · Coding Session Runtime
Prompt / System PromptField semantics of systemPrompt (runtime instruction merge) vs instructions (kept independent) + the prompt assembly pipeline of the coding agentAgent + Coding AgentSystem Prompt vs Instructions · Prompt Assembly
Harness / Coding AgentA complete terminal coding agent host (CLI/TUI + ACP + sandbox-routing + tools + approvals + compaction)Coding AgentCoding Agent overview · Programmatic integration

How to use this page

  1. First time learning about agents: start with the capability triangle to understand how the model acts.
  2. Need to manage state: walk the memory & context chain, from Memory to Checkpoint.
  3. Need to orchestrate complex tasks: walk the execution core layers, from Agent Loop to Agent Teams.
  4. Going to production: check the security boundary + observability + engineering.
  5. Need to integrate with the outside world: see external protocols.

Further reading