Habr and Otus published a collection of open lessons for moving from working with ML models to building full-fledged AI agents. The key skill is tool calling: the LLM must not just answer with text but call functions, plan chains of actions, and manage memory. The five skills below close the gap between “I can train models” and “I can assemble agents you can trust with production”. The mechanics of calls are covered in agents with tool calling.
Key Skills for the ML → AI Agent Transition
1. Tool Calling (Function Calling)
The LLM must be able to call functions by JSON schema: form arguments correctly, handle errors, and chain calls. The key patterns:
- Sequential — the result of one function feeds the arguments of the next (search → booking).
- Parallel — independent calls at the same time (the weather in 5 cities).
- Retry with correction — when argument validation fails, the LLM fixes the arguments itself and retries.
The skill formalizes simply — as a tool schema that the framework hands to the model together with the system prompt:
{
"name": "get_order_status",
"description": "Returns order status by order number",
"parameters": {
"type": "object",
"properties": {
"order_id": {"type": "string", "pattern": "^ORD-\\d{6}$"},
"with_history": {"type": "boolean", "default": false}
},
"required": ["order_id"]
}
}And this is the call the model returns to the user’s question:
{"name": "get_order_status",
"arguments": {"order_id": "ORD-402117", "with_history": true}}A strict pattern in the schema cuts half the junk arguments before execution even starts, and retry with correction picks up the rest. Without input validation, the agent will bring down the whole pipeline with one pretty-looking error. Call errors should be split into three classes right away:
- Validation error: the arguments failed the schema — the framework feeds the validator’s message back to the model, and it fixes the arguments in a single retry.
- Infrastructure error: a timeout or an unavailable API — exponential backoff, then replanning: the agent looks for an alternative path to the goal.
- Business error: the tool honestly returned “order not found” — this is not a failure but data; the agent answers the user instead of burning retries.
2. Planning and Task Decomposition
The agent must break a complex goal into subtasks: ReAct (Reasoning + Acting), Plan-and-Execute, Tree of Thoughts. The key skill is writing the plan in a structured form (JSON/YAML), then executing it step by step with the option of replanning: a step fails — the plan is reassembled, rather than failing as a whole. It is practical to store the plan as an array of steps with a depends_on field: the executor picks steps with no open dependencies, independent branches run in parallel, and the plan length is capped at 7-10 steps, otherwise the model loses the goal. Planning patterns are covered in agent planning.
3. Memory and Context
Context management: short-term (the last N turns), long-term (RAG, a vector DB), working (a scratchpad for intermediate reasoning). The skill is deciding what stays in context, what goes to RAG, and what gets written to the scratchpad. Working starting numbers: short-term — 10-20 turns, the scratchpad — up to 2k tokens with older content offloaded to storage, the user profile — up to 150 tokens of facts with a TTL and an update date. Store schemas and per-user isolation are covered in agent memory.
4. RAG and Retrieval
Vector search (dense + sparse BM25), reranking (cross-encoder), hybrid search (dense + sparse + knowledge graph). The skill is tuning chunking, overlap, top-K, and similarity thresholds. A working starting point: 512-token chunks with an overlap of 50, reranking picks the top-5 out of the top-20 candidates, and the similarity threshold prunes junk without fanaticism — hybrid search recovers the exact matches on article numbers and IDs that pure vector search consistently loses.
5. Eval and Monitoring of Agents
Metrics: success rate (the task completed), tool accuracy (how correct the calls are), latency, cost per task. The skill is building dashboards and setting alerts on success-rate degradation.
A ReAct Trace: Thought → Action → Observation
Planning is best seen in a live trace — that is exactly the format that gets written to the log in full:
Thought: the user asks about order ORD-402117.
There is a get_order_status tool — calling it.
Action: get_order_status(order_id="ORD-402117")
Observation: {"status": "in_transit", "eta": "2026-12-05", "courier": "CDEK"}
Thought: status received, delivery on December 5. No calculator or return needed.
Answer: order ORD-402117 is already in transit, expect it on December 5, courier CDEK.Traces like this are what tool accuracy is computed from, planning prompts are debugged against, and loops are caught on: three identical actions in a row with no new observation is the signal that the plan must be forcibly reassembled.
An Eval Harness Skeleton
Without a harness, progress is invisible and degradation comes as a surprise. A minimal skeleton over 200 scenarios:
import json, time
from agent import run_agent
CASES = [json.loads(l) for l in open("cases.jsonl")] # 200 scenarios
ok, tool_ok, lat = 0, 0, []
for case in CASES:
t0 = time.time()
trace = run_agent(case["question"])
lat.append(time.time() - t0)
ok += trace.final_answer == case["expected"]
tool_ok += trace.tool_calls == case["expected_tools"]
print("success_rate", ok / len(CASES))
print("tool_accuracy", tool_ok / len(CASES))
print("p99_latency", sorted(lat)[int(len(lat) * 0.99)])The metrics are the same as in production: success rate, tool accuracy, latency P99, cost per task. For team work LangSmith is convenient: traces, datasets, prompt A/B; the dashboard and degradation alerts sit on top in Grafana. The iron rule: any change to a prompt or the tool set goes through the harness before the release, not after a user complaint.
Open Otus Lessons for Skill Building
- Tool-calling Basics — JSON Schema, Pydantic models, retry logic.
- Agent Planning Patterns — ReAct, Plan-and-Execute, Self-Ask.
- Memory Systems for Agents — In-context, RAG, Scratchpad, Long-term.
- RAG Advanced — Hybrid search, Reranking, Knowledge Graphs.
- Agent Evaluation — Prometheus metrics, LangSmith, Weights & Biases.
All lessons are free, in Jupyter Notebook + video format. Suitable for Python developers who want to become AI engineers.
A 12-Week Skill Plan
| Weeks | Skill | Practice | Artifact |
|---|---|---|---|
| 1-2 | Tool calling | JSON Schema for 5 functions of your domain + retry logic | A schema library with tests |
| 3-4 | Planning | A ReAct agent on 3 tools, the plan in JSON | 20 labeled traces |
| 5-6 | Memory | Scratchpad + long-term facts in a vector DB | A user profile with a TTL |
| 7-8 | RAG | Hybrid search + cross-encoder reranking | An index over 1k documents |
| 9-10 | Eval | A harness over 200 cases + LangSmith | A dashboard and alerts |
| 11-12 | Production | Deployment, limits, incident analysis | A postmortem of one failure |
The artifact matters more than the certificate: over six months, a portfolio assembled this way — schemas, traces, a harness, a postmortem — shows an employer exactly the skills that separate an AI engineer from a model analyst.
Useful resources: LangChain repository, LangGraph documentation.
Checklist for moving from ML engineer to AI engineer:
1) Tool calling: write JSON Schemas for your functions, test retry logic and parallel calls.
2) Planning: adopt ReAct or Plan-and-Execute, teach the agent to write its plan in JSON.
3) Memory: add a scratchpad for reasoning, RAG for knowledge, Git for prompt versioning.
4) RAG: tune chunking (512 tokens, overlap 50), hybrid search (dense+BM25), cross-encoder rerank.
5) Eval: success rate, tool accuracy, latency P99, cost per task. A dashboard in Grafana + alerts.
Resources: free Otus lessons (Jupyter + video), LangChain/LlamaIndex docs, LangSmith for eval.

