匠人学院 JR Academy
Skip to article
Engineering handbook
AI Agent Engineering Handbook

Start with tool calls. Understand how an agent acts, reads observations and stops when something fails. Verify each boundary with complete code and offline tests.

5 chapters·16 guides·Open access
Agent Architecture
On this page

AI Agent Cognitive Architecture

A model is only one part of an agent. A working system also needs task state, a plan, controlled tools and a way to decide whether the result is complete.

#Four components and one feedback loop

ComponentResponsibilityTypical failure
Decision layerInterpret the objective and choose the next stepAnswers before gathering necessary evidence
MemoryRetain relevant constraints and observationsOld assumptions are stored as facts
PlanningOrder work and revise it after feedbackRepeats a failing action indefinitely
ToolsRead or change the external environmentExecutes beyond the user's permissions

The runtime supplies the current state, the model proposes an action, the application validates and executes it, and the observation updates state. Stop when acceptance criteria are met or a time, usage or step limit is reached.

#Decision layer

Evaluate instruction following, tool-call structure and the ability to use observations. A larger model is not a substitute for missing permissions, unreliable tools or an unclear objective. Routing, extraction and difficult analysis can have different model requirements.

#Short- and long-term memory

Recent messages, task summaries and explicit state keep a current task coherent. Durable knowledge may use retrieval, but exact facts such as user permissions, document versions and account configuration belong in structured records. Store source and verification status with important facts.

#Planning and tools

For a login bug, a useful plan is reproduce, inspect the relevant code, make a narrow change, run checks and inspect the resulting behavior. A plan must respond to failed tests; it is not a fixed script or proof that work happened.

Tools should have narrow schemas, bounded results and explicit error states. Distinguish a proposed write, an executed write and a read-back confirming the result. Logs should record observable decisions and actions without requiring hidden reasoning.

#Check the complete system

Test a missing document, a failed tool, an unauthorized operation and an interrupted run. A successful final paragraph is insufficient if the action never completed.

Conceptual background: LLM-powered agents↗ · Planning

System Design

Core system design concepts and practical case studies

Learn the trade-offs and patterns that matter in technical interviews.

Open System Design →

FAQ

Which language should I use?
Python and TypeScript both work. Start with the language you can debug; the first exercise uses Python 3.10+ and its standard library.
Does MCP require a specific model?
No. MCP connects applications to tools and context services. Compatibility depends on the host client, transport, protocol version and authorisation; model tool-calling support is a separate check.
Does learning agents guarantee employment?
No. Use a small project to demonstrate requirements analysis, permissions, testing and maintenance. Employment outcomes depend on the role market and your actual skills.

Done reading? Next steps