Back to list
dev_to 2026年3月14日

2026 年の AI エンジニアリングスタック:まずは何を学ぶべきか

The AI Engineering Stack in 2026: What to Learn First

Translated: 2026/3/14 13:01:34
pythonai-engineeringllm-sdkpydanticmachine-learning

Japanese Translation

多くの「AI エンジニアになるには」というガイドは、47 つのスキル、12 つのフレームワーク、3 つの数学学位を列挙していますが、読了後はスタート時点よりも目標から遠ざかっているように感じるだけです。実際のスタックは 5 つのレイヤーに深く分かっており、順に学習することで本格的な生産環境用の AI システム構築が可能になります。一つのステップを飛ばすと、あらゆるチュートリアル也无法修复の壁に遭遇します。 2026 年 3 月時点のこのスタックについて、実際に関係するツールとバージョンを以下に示します。 すべての AI フレームワーク、LLM SDK、およびデプロイメントツールは「Python-first(Python が最初)」です。単に Python に親切であるというだけでなく、Python が最初です。 JavaScript、Java、または他の言語からの移行を計画している人は、ここから始めましょう。AI から始めず、Python から始めましょう。 知っておくべきこと: # タイプヒント — 全ての現代の AI ライブラリはこれを利用します from typing import Optional def classify_intent(text: str, threshold: float = 0.7) -> Optional[str]: """テキスト入力からユーザーの意図を分類します。""" # あなたの分類ロジック here return "greeting" if "hello" in text.lower() else None 具体的には、関数、クラス、デコレータ、async/await、タイプヒント、および仮想環境です。メタクラスや記述子についてはマスターする必要はありません。清潔で型の付いた Python を他社のエンジニアが読みやすい形で書くことが必要です。 ツール: Python 3.10+(2026 年 3 月時点で全ての主要な AI フレームワークによって必要とされています) uv または pip をパッケージ管理用 pytest をテスト用 ruff をリンティングとフォーマット用 時間:毎日コーディングする場合 4-6 週間。もう一つの言語を既に分かっている場合 2 週間。 LLM の一つに触る前に、Pydantic を学んでください。2026 年のすべての真剣な AI フレームワークはこれに基づいています。 LangChain はツールスキーマのために Pydantic モデルを使用しています。OpenAI Agents SDK は関数ツールの検証のために Pydantic を使用しています。FastMCP は Pydantic タイプからスキーマを自動生成します。LLM に構造化データを返すように指示すると、Pydantic がその応答を検証します。 from pydantic import BaseModel, Field class ToolCall(BaseModel): """AI エージェントのツール呼び出しスキーマです。""" tool_name: str = Field(description="呼び出すツールの名前") arguments: dict = Field(default_factory=dict) confidence: float = Field(ge=0.0, le=1.0, description="モデルの信頼度") # これは LLM 出力を検証する方法です raw_response = {"tool_name": "search", "arguments": {"query": "python"}, "confidence": 0.95} validated = ToolCall(**raw_response) # 無効な場合は ValidationError を上昇 2026 年 3 月時点で、pydantic のバージョンは 2.12.5 です。v2 API(model_validator、Field、ConfigDict を含む)が学べるべきものです。v1 のチュートリアルを無視してください。 これはなぜキャリア変更者にとって重要か:AI エンジニアの求人情報は、「TensorFlow の経験」よりも頻繁に「Pydantic の経験」を列挙しています。構造化データの処理が日常業務です。モデルのトレーニングはそうではありません。 時間:1-2 週間(レイヤー 1 と共に)。 これで AI に備えます。一つから始めましょう。三つではありません。一つだけです。 90% の求人情報をカバーする二つの選択肢: Option A: OpenAI SDK from openai import OpenAI client = OpenAI() # 環境変数から OPENAI_API_KEY を読み込む response = client.chat.completions.create( model="gpt-4o", messages=[ {"role": "system", "content": "あなたは有益なアシスタントです。"}, {"role": "user", "content": "Python の async/await を説明してください。"} ], temperature=0.3 ) print(response.choices[0].message.content) Option B: Anthropic SDK from anthropic import Anthropic client = Anthropic() # 環境変数から ANTHROPIC_API_KEY を読み込む message = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[ {"role": "user", "content": "Python の async/await を説明してください。"} ] ) print(message.content[0].text) 両方の SDK は同じパターンに従います:クライアントを作成、API メソッドを呼び出す、応答を解析します。具体的な差異がありますが、メンタルモデルは同一です。 このレイヤーで学べること: チャット補完呼び出しの作成 ストリーミング応答(リアルタイム UI 用) ツール/関数呼び出しを使用してモデルがあなたのコードを実行させる 構造化出力(JSON モードやスキーマに制限された応答) トークンカウントとコスト意識 時間:1 つの SDK なら 1-2 週間。2 つ目を追加します。

Original Content

Most "how to become an AI engineer" guides list 47 skills, 12 frameworks, and 3 math degrees. You finish reading and feel further from the goal than when you started. The actual stack is 5 layers deep. Learn them in order and you can build production AI systems. Skip one and you will hit a wall that no tutorial can fix. Here is the stack, as of March 2026, with the exact tools and versions that matter. Every AI framework, every LLM SDK, and every deployment tool is Python-first. Not Python-friendly. Python-first. If you are switching from JavaScript, Java, or another language, this is where you start. Not with AI. With Python. What you need to know: # Type hints — every modern AI library uses them from typing import Optional def classify_intent(text: str, threshold: float = 0.7) -> Optional[str]: """Classify user intent from text input.""" # Your classification logic here return "greeting" if "hello" in text.lower() else None The specifics: functions, classes, decorators, async/await, type hints, and virtual environments. You do not need to master metaclasses or descriptors. You need to write clean, typed Python that other engineers can read. Tools: Python 3.10+ (required by every major AI framework as of March 2026) uv or pip for package management pytest for testing ruff for linting and formatting How long: 4-6 weeks if you code daily. 2 weeks if you already know another language. Before you touch a single LLM, learn Pydantic. Every serious AI framework in 2026 builds on it. LangChain uses Pydantic models for tool schemas. OpenAI Agents SDK uses Pydantic for function tool validation. FastMCP auto-generates schemas from Pydantic types. When you tell an LLM to return structured data, Pydantic validates the response. from pydantic import BaseModel, Field class ToolCall(BaseModel): """Schema for an AI agent's tool invocation.""" tool_name: str = Field(description="Name of the tool to call") arguments: dict = Field(default_factory=dict) confidence: float = Field(ge=0.0, le=1.0, description="Model confidence") # This is how you validate LLM output raw_response = {"tool_name": "search", "arguments": {"query": "python"}, "confidence": 0.95} validated = ToolCall(**raw_response) # Raises ValidationError if invalid As of March 2026, pydantic is at version 2.12.5. The v2 API (with model_validator, Field, and ConfigDict) is what you should learn. Ignore v1 tutorials. Why this matters for career switchers: Job postings for AI engineers list "experience with Pydantic" more often than "experience with TensorFlow." Structured data handling is the daily work. Training models is not. How long: 1-2 weeks alongside Layer 1. Now you are ready for AI. Start with one SDK. Not three. One. The two choices that cover 90% of job postings: Option A: OpenAI SDK from openai import OpenAI client = OpenAI() # Reads OPENAI_API_KEY from environment response = client.chat.completions.create( model="gpt-4o", messages=[ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Explain async/await in Python."} ], temperature=0.3 ) print(response.choices[0].message.content) Option B: Anthropic SDK from anthropic import Anthropic client = Anthropic() # Reads ANTHROPIC_API_KEY from environment message = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[ {"role": "user", "content": "Explain async/await in Python."} ] ) print(message.content[0].text) Both SDKs follow the same pattern: create a client, call an API method, parse the response. The specifics differ but the mental model is identical. What to learn at this layer: Making chat completions calls Streaming responses (for real-time UIs) Using tool/function calling to let the model invoke your code Structured output (JSON mode or schema-constrained responses) Token counting and cost awareness How long: 1-2 weeks for one SDK. Add the second later. An LLM call is a single request-response. An agent is a loop: the model thinks, calls tools, reads the results, and decides what to do next. You need a framework for this. Building from scratch teaches you the fundamentals (we covered this in a previous article). But for production, you need orchestration, state management, and error handling that frameworks provide. The 3 frameworks that matter in March 2026: LangChain (v1.2.12 as of March 2026) is the most widely adopted framework by downloads and community size. LangGraph extends it with graph-based orchestration — your agent becomes a directed graph where nodes are actions and edges are transitions. from langchain.agents import create_agent # Define tools as Python functions def get_weather(city: str) -> str: """Get current weather for a city.""" return f"Weather in {city}: 72°F, sunny" # Create an agent with the unified API agent = create_agent( model="openai:gpt-4o", tools=[get_weather], system_prompt="You are a helpful assistant." ) # Run it result = agent.invoke( {"messages": [{"role": "user", "content": "What's the weather in Denver?"}]} ) As of LangChain v1.x, create_agent from langchain.agents is the recommended way to build agents. It replaced the earlier create_react_agent from langgraph.prebuilt, which still works but is deprecated. The new API supports multiple agent architectures through a unified interface with a built-in middleware system. Version 0.12.1 as of March 2026. Lightweight, opinionated, and built specifically for OpenAI models — though it now supports 100+ LLMs through provider adapters. from agents import Agent, Runner agent = Agent( name="assistant", instructions="You help users with Python questions.", model="gpt-4o" ) result = Runner.run_sync(agent, "How do I read a CSV file in Python?") print(result.final_output) Version 1.68.0 as of March 2026. Built by the Pydantic team. If you already know Pydantic well (Layer 2), PydanticAI will feel natural. from pydantic_ai import Agent agent = Agent( model="openai:gpt-4o", system_prompt="You are a Python expert." ) result = agent.run_sync("What's the difference between a list and a tuple?") print(result.output) Which one should you pick? Start with one. LangChain has the largest community and the most learning resources. OpenAI Agents SDK is the simplest to start with. PydanticAI has the cleanest type safety. Pick based on what your target employer uses, or default to LangChain if you are unsure. How long: 2-4 weeks to build real projects with one framework. The Model Context Protocol (MCP) is the standard way AI agents connect to external tools, databases, and APIs. As of 2026, it is supported by every major AI framework and adopted by Microsoft, Anthropic, and dozens of tool providers. Before MCP, you wrote custom integration code for every external service. With MCP, a tool server exposes capabilities through a standard protocol, and any MCP-compatible agent can use them. from fastmcp import FastMCP mcp = FastMCP("My Tools") @mcp.tool() def search_docs(query: str) -> str: """Search internal documentation for relevant information.""" # Your search logic here return f"Found 3 results for: {query}" @mcp.tool() def create_ticket(title: str, priority: str = "medium") -> str: """Create a support ticket in the issue tracker.""" return f"Created ticket: {title} (priority: {priority})" FastMCP (v3.1.0 as of March 2026) is the most popular way to build MCP servers in Python. It auto-generates tool schemas from your function signatures and type hints. The @mcp.tool() decorator is all you need. Why MCP matters for your career: Job postings now list "MCP experience" alongside "REST API experience." Companies want engineers who can plug agents into their existing systems — databases, CRMs, internal tools — without rewriting connectors for every model provider. How long: 1-2 weeks after Layer 4. The layers are numbered for a reason. Each one builds on the one below it: Layer 5: MCP ← connects agents to external tools Layer 4: Frameworks ← orchestrates agent loops Layer 3: LLM SDKs ← talks to models Layer 2: Pydantic ← validates all data flowing through the system Layer 1: Python ← everything runs on this Skipping Layer 1 to start at Layer 4 is the most common mistake career switchers make. You will spend more time debugging Python import errors than building agents. Skipping Layer 2 is the second most common mistake. When your agent returns malformed JSON from the LLM (and it will), Pydantic is what catches the error before it crashes your application. Here is what the 47-skill guides tell you to learn that you can safely defer: Training models from scratch. AI engineering in 2026 is about integrating pre-trained models, not training new ones. Learn fine-tuning later, when a specific project requires it. Deep learning theory (CNNs, RNNs, transformers from scratch). Useful for understanding how models work. Not required for building applications with them. Kubernetes. Learn Docker first. Deploy to a single server. Scale when you have users, not before. Every framework. Pick one at Layer 4. Master it. Add others when you hit its limitations or when a job requires it. Week Layer What to Build 1-4 Python CLI tool that fetches and processes data from an API 5-6 Pydantic Data validation layer for an API response parser 7-8 LLM SDK Chatbot that answers questions about a topic you know 9-10 Framework Agent that uses 2-3 tools to complete a task 11-12 MCP MCP server that exposes your own tools + agent that uses them Each project builds on the previous one. By week 12, you have a working agent system with custom tools, validated data flow, and production-grade error handling. That is a portfolio. Not 5 separate demo apps — one integrated system that shows you understand the full stack. We talked to engineers who review AI engineering candidates. The pattern is consistent: Can you build something that works end-to-end? Not a notebook. A system with inputs, processing, error handling, and outputs. Do you understand structured data? Pydantic models, schema validation, handling malformed LLM responses. Can you debug when the model does something unexpected? Tracing, logging, understanding why an agent chose a wrong tool. Do you know one framework deeply? Depth beats breadth. "I built 3 projects with LangGraph" beats "I tried 6 frameworks." The 47-skill list is a hiring manager's wish list, not a minimum requirement. The 5-layer stack is the minimum that gets you building real systems. The AI engineering stack will keep evolving. New frameworks will appear, models will get cheaper, and the boundaries between layers will shift. But the fundamentals — Python, data validation, API integration, agent orchestration, and tool protocols — have been stable for two years and show no signs of changing. Start at Layer 1. Build up. Ship something real at every layer. Follow @klement_gunndu for more AI engineering content. We're building in public.