n8n
Visual orientationUse it when: Use it for a first pass through model calls, RAG, approvals, and integration-heavy prototypes.
Keep in mind: Once the shape is clear, move the important path to normal application code.
Official docs ↗A practical path for backend engineers who want to build reliable AI features. It focuses on model APIs, retrieval, tools, bounded agents, evaluation, and production work. Model training is outside the main path.
Choose a route, then move on when you can meet the layer’s exit criteria.
Each pass exposes a new engineering problem. You keep the domain and test cases, so the learning compounds.
Click a yellow stage to open its guide. The faded nodes sit beyond the route currently selected.
The visual tools are deliberate. They show the shape of RAG, tools, and agents quickly. The code task is where an experienced engineer should learn the real boundaries.
Each layer has a narrow goal. References are ordered, so start with #1 unless you already know the topic.
Understand what a model can and cannot do before adding frameworks.
In n8n, connect a manual input to one model node. Ask the same task four ways: vague instruction, clear instruction, one example, then the same prompt with irrelevant context. Save the outputs side by side.
Call one model directly from Python. Run the same fixed task ten times and log the input, output, model, latency, and token usage. Change one variable at a time. The point is to observe behavior, not to build a product yet.
Turn the model into a typed, testable component inside a normal backend service.
Build a support-ticket classifier in n8n. Ask for JSON with category, priority, summary, and requires_human. Branch high-risk or malformed results to a review step. Deliberately add missing and conflicting fields.
Create a small ticket-triage API with a typed response. Add validation, retry only retryable failures, log prompt version and latency, and keep a dozen test tickets in the repository.
class TicketDecision(BaseModel):
category: Literal["billing", "bug", "account", "other"]
priority: Literal["low", "normal", "high"]
summary: str
requires_human: bool
# Use the provider SDK's current typed-output method.
decision = model.generate(text=ticket, output_type=TicketDecision)Recommended starting point. Shows how to make model output fit a schema instead of parsing prose.
#2Docs Prompt engineering ↗OpenAI developer documentationCurrent patterns for instructions, examples, context, and prompt iteration.
#3Free lecture Prompt Engineering ↗Full Stack LLM BootcampA compact engineering lecture that connects prompting to system design and testing.
Give the application controlled access to private or current information with inspectable sources.
Use n8n to load a small policy set. Ask five known questions and inspect the chunks returned before reading the final answer. Change chunk size and top-k once so the effect is visible.
Add document ingestion and retrieval to the ticket service. PostgreSQL with pgvector is enough. Return source IDs with every supported claim and say that evidence is insufficient when retrieval does not support an answer.
First diagnostic: did the right evidence reach the model? A fluent answer cannot repair a retrieval miss.
Recommended starting point. A clear explanation of the RAG pipeline and the parts that can be inspected or replaced.
#2Open-source docs pgvector ↗pgvector projectA practical vector search starting point for engineers already comfortable with PostgreSQL.
#3Docs + lab Retrieve relevant context with AI workflows ↗n8n documentationA fast visual way to see ingestion, retrieval, and generation as separate steps.
Let the model request an action while the application keeps control of execution and permissions.
Give an n8n agent one read-only lookup and one write action. Put human approval before the write. Trigger invalid arguments, a missing record, a timeout, and a duplicate request.
Add get_customer, search_orders, draft_reply, and create_ticket. The model may propose a write, but application code validates the arguments, checks the signed-in user, asks for approval, and records the result.
proposal = model.propose_tool_call(context)
args = ToolArgs.model_validate(proposal.arguments)
policy.authorize(user, proposal.name, args)
if tool_registry[proposal.name].writes_data:
approval.require(user, proposal)
result = executor.run_idempotently(proposal.name, args)
audit.record(user, proposal, result)Recommended starting point. Covers tool schemas, arguments, execution, and returning results to the model.
#2Docs Introduction to Model Context Protocol ↗MCP documentationExplains hosts, clients, servers, resources, prompts, and tools without unnecessary framework code.
#3Security guide MCP security best practices ↗MCP documentationUseful before exposing tools, credentials, or remote servers.
Use an agent only when the next step genuinely depends on what happened in the previous step.
Choose one visual tool. Give one agent retrieval plus two tools. Keep it single-agent. Watch the trace and note where the model chooses a path instead of following a fixed branch.
Extend the support copilot: classify the request, retrieve policy, choose a read tool when needed, draft a response, then pause before any write. Use one framework only if state or recovery is becoming awkward in plain code.
Recommended starting point. A grounded distinction between workflows and agents, with simple patterns before complex autonomy.
#2Docs LangGraph overview ↗LangChain documentationUseful when a workflow needs durable state, checkpoints, explicit transitions, or human pauses.
#3Docs OpenAI Agents SDK ↗OpenAI open-source documentationA lightweight reference for agents, handoffs, guardrails, sessions, and tracing.
Replace demo impressions with repeatable evidence.
Collect twenty cases from the project. Compare two prompts or models with simple rules plus a written human rubric. Inspect failures before looking at one average score.
Grow the set to 30–50 cases. Check ticket classification, retrieval relevance, cited support, tool choice, forbidden writes, latency, and cost. Run it in CI for important prompt, model, retrieval, or tool changes.
Recommended starting point. Shows how to move from vague impressions to task-level and component-level evidence.
#2Open-source docs Promptfoo ↗Promptfoo documentationUseful for local test cases, provider comparisons, assertions, and CI regression gates.
#3Open-source tutorial Evaluate RAG ↗Arize Phoenix documentationA concrete path for inspecting retrieval and response quality with traces.
Production AI is production software plus untrusted content, uncertain model behavior, and external actions.
Draw the trust boundaries, then test them: malicious text in a document, an unauthorized record lookup, a duplicate write, a model timeout, a provider outage, and a request that exceeds its budget.
Add authentication and per-user permissions, queued ingestion, traces, red-team cases, cost limits, dashboards, deployment, and rollback. Document which actions are allowed, suggest-only, approval-gated, or forbidden.
Recommended starting point. A current threat checklist for prompt injection, data exposure, excessive agency, and related risks.
#2Docs Production best practices ↗OpenAI developer documentationCovers operational concerns such as scaling, limits, reliability, and deployment.
#3Open-source spec OpenTelemetry semantic conventions for GenAI ↗OpenTelemetry projectA useful reference when traces need consistent model, token, tool, and agent fields.
The capstone is ordinary enough to understand, but rich enough to exercise retrieval, tools, approvals, evals, and production controls.
Draft response
The order service is returning elevated 5xx errors. The release runbook says to open an incident, notify the on-call engineer, and hold customer-facing status language until impact is confirmed.
Runbook §3.2Service status 14:21Keep the same tickets and policies. The application becomes more capable and more accountable.
Keep the stack small. Use one visual tool to understand the shape, provider SDKs to learn the real boundaries, and one workflow framework only when state and recovery become real needs.
Use it when: Use it for a first pass through model calls, RAG, approvals, and integration-heavy prototypes.
Keep in mind: Once the shape is clear, move the important path to normal application code.
Official docs ↗Use it when: Start here for messages, structured output, streaming, tool calls, retries, and error handling.
Keep in mind: Stay with direct SDKs until a framework clearly removes repeated orchestration work.
Developer docs ↗Use it when: Bring it in only when the application needs checkpoints, pauses, branching, or recovery over time.
Keep in mind: Do not introduce it for short deterministic request paths that are already clear in plain code.
Official docs ↗Ten years of backend experience changes the path. Do not reteach APIs, databases, queues, auth, testing, or deployment. Connect those skills to model behavior and evaluation.
Agree whether the goal is orientation, feature delivery, or production ownership. This prevents both shallow browsing and unnecessary theory.
Let n8n make the system shape visible. Then stop and rebuild the important path in code.
Ask for the working project, traces, failures, and decisions. Do not judge progress by videos watched or framework vocabulary.
New requirements should deepen the same product. That reveals architecture trade-offs that isolated tutorials hide.