teachyou.ai academy

The lab notebook

Field notes on AI engineering

824 articles · page 8 of 28

RAGvector search

Semantic vs Keyword Search: What RAG Actually Needs

Semantic search finds meaning, keyword search finds exact terms, and most production RAG systems fail because they pick only one. Here's how to decide, and when to run both.

Jun 20, 2026 · 13 min read
RAGretrieval

RAG Query Routing: Sending Questions to the Right Index

When your RAG system has more than one index, sending every query to every source wastes tokens and hurts accuracy. Here's how to route each question to the index that can actually answer it.

Jun 21, 2026 · 13 min read
RAGobservability

Monitoring a RAG Pipeline in Production

A RAG pipeline that passed your eval suite can still fail silently in production. Here is what to actually measure, log, and alert on across retrieval, generation, and the index itself.

Jun 21, 2026 · 12 min read
RAGretrieval

The Parent Document Retriever Pattern in RAG

Small chunks retrieve well but read poorly in isolation. The parent document retriever pattern fixes this by searching small and returning large, and this guide shows exactly how to build it.

Jun 21, 2026 · 12 min read
RAGColBERT

Multi-Vector Retrieval: ColBERT and Beyond

Single-vector embeddings collapse a whole document into one point and lose the fine-grained matches that make retrieval accurate. Here is how multi-vector RAG with ColBERT-style late interaction fixes that, with working code.

Jun 21, 2026 · 16 min read
RAGvector databases

Metadata Filtering in RAG: Precise Retrieval at Scale

Vector similarity alone returns plausible-looking but wrong chunks once your corpus grows past a few thousand documents. Here is how to design and implement RAG metadata filtering that keeps retrieval accurate at scale.

Jun 21, 2026 · 14 min read
RAGevaluation

Building a Golden Dataset for RAG Evaluation

Your RAG pipeline looks fine in the demo and falls apart in production because you never built a real test set. Here is how to construct a rag golden dataset that actually catches regressions.

Jun 22, 2026 · 12 min read
RAGLLM cost optimization

RAG Caching Strategies: Cutting Latency and Cost

Every RAG call redoes work you already paid for. Here is where to put caches in a retrieval pipeline, what each one saves, and where teams get it wrong.

Jun 22, 2026 · 13 min read
Prompt EngineeringLLM ops

Prompt Versioning and Management for Teams

Prompts break production just like code does, but most teams still paste them into Slack. Here is how to version, test, and roll back prompts the same way you handle code.

Jun 22, 2026 · 12 min read
Prompt EngineeringLLM workflows

Prompt Chaining Patterns for Complex Tasks

Prompt chaining breaks a hard task into smaller LLM calls that hand off to each other. Here are the patterns that hold up in production, with runnable code.

Jun 22, 2026 · 10 min read
Prompt EngineeringLLM API

Prompt Caching Explained

Prompt caching can cut your LLM input costs by up to 90 percent and slash latency, but only if you understand the prefix-match rule that silently breaks it. Here is exactly how it works, what it costs, and where to put the breakpoints.

Jun 22, 2026 · 14 min read
LLM Evaluationmodel selection

Pairwise Model Comparison for LLM Selection

Absolute 1-10 scores from an LLM judge are noisy and hard to compare across runs. Pairwise comparison, showing a judge two outputs and asking which is better, gives you a ranking you can actually trust.

Jun 23, 2026 · 14 min read
LLM Evalonline llm evaluation

Offline vs Online LLM Evals: What to Run Where

Offline evals gate deploys, online LLM evaluation scores real traffic. Here is a decision matrix for what to run where, with working code for both sides.

Jun 23, 2026 · 17 min read
Workflow Automationn8n testing

Testing n8n Workflows Before They Break

n8n workflows fail quietly in production unless you test them the way you'd test code. Here's how to build a real test harness around your automations.

Jun 23, 2026 · 11 min read
Workflow AutomationAI Agents

n8n vs LangGraph for AI Workflows

n8n and LangGraph solve different problems even though both get pitched for "AI workflows." Here is how to pick the right one, with real code for both.

Jun 23, 2026 · 11 min read
Workflow Automationn8n

Self-Hosting n8n with Docker: A Complete Setup Guide

Run n8n self host docker in production with Postgres, HTTPS, and encrypted credentials, not the default SQLite demo setup that breaks on your first real workflow.

Jun 23, 2026 · 10 min read
Workflow Automationn8n rag

Building a RAG Workflow in n8n

A step-by-step build of a production-ready n8n RAG workflow, from document ingestion and chunking to vector search and grounded LLM answers, with node configs you can copy directly.

Jun 24, 2026 · 13 min read
Workflow Automationn8n

Multi-Agent Orchestration in n8n

Learn how to design n8n multi agent workflows with a router node, worker sub-workflows, shared memory, and error handling that actually survives production traffic.

Jun 24, 2026 · 10 min read
Workflow Automationn8n mcp

Connecting n8n to MCP Servers

A hands-on guide to wiring n8n up to MCP servers, from the built-in MCP Client node to hosting your own MCP server so any workflow can act as an agent tool.

Jun 24, 2026 · 11 min read
Production AILLM cost optimization

Model Routing Strategies for Cost and Quality

Sending every request to your biggest model burns budget for no reason. Here is how to build a model router that sends easy questions to a cheap model and hard ones to a strong one, without breaking quality.

Jun 24, 2026 · 14 min read
Prompt EngineeringLLM workflows

Meta-Prompting: Using LLMs to Write Better Prompts

Stop hand-tuning prompts by guesswork. Meta-prompting uses one LLM call to design, critique, and rewrite the prompt for another, and it reliably beats manual iteration once you know the loop.

Jun 25, 2026 · 13 min read
MCPOpenAPI

MCP vs OpenAPI Tool Calling: When to Use Each

MCP and OpenAPI tool calling solve overlapping problems in different ways. Here is how they actually differ under the hood, and a concrete decision framework for picking one over the other.

Jun 25, 2026 · 16 min read
MCPmodel context protocol

How to Test MCP Servers: Unit, Integration, and Inspector

A working MCP server that "looks fine in Claude Desktop" can still fail silently in production. Here is a layered testing approach: unit tests for tool handlers, the MCP Inspector for manual poking, and integration tests against a real client.

Jun 25, 2026 · 15 min read
MCPModel Context Protocol

Stateful MCP Sessions: Managing Connection State

MCP sessions carry more than a connection ID: capability negotiation, subscriptions, and per-client memory all live inside them. Here is how to build servers that manage that state correctly instead of leaking it.

Jun 25, 2026 · 13 min read
MCPModel Context Protocol

MCP Sampling and Elicitation: Server-Initiated LLM Calls

Most MCP tutorials stop at tools and resources. Sampling and elicitation let an MCP server ask the client's model to think, or ask the client's user a question, mid-task, without holding its own API key.

Jun 25, 2026 · 18 min read
MCPModel Context Protocol

The MCP Registry Explained: Discovering and Publishing Servers

The MCP registry is the missing directory for Model Context Protocol servers. Here is how to search it, evaluate what you find, and publish your own server the right way.

Jun 26, 2026 · 14 min read
MCPobservability

MCP Observability: Logging, Tracing, and Metrics

MCP servers fail in ways your normal APM stack won't catch. Here is how to add structured logging, distributed tracing, and metrics to an MCP server without breaking the stdio transport.

Jun 26, 2026 · 15 min read
MCPOAuth

Securing MCP Servers with OAuth: Authorization in Practice

A working guide to MCP authorization: the OAuth 2.1 flow, resource indicators, dynamic client registration, and the code that makes a remote MCP server actually reject stolen tokens.

Jun 26, 2026 · 15 min read
MCPModel Context Protocol

Building Multi-Tenant MCP Servers: Isolation and Scaling

A practical guide to building a multi-tenant MCP server that keeps customer data isolated, enforces per-tenant quotas, and scales past a single-tenant proof of concept.

Jun 26, 2026 · 15 min read
MCPerror handling

MCP Error Handling Patterns: Building Resilient Servers

MCP error handling has two distinct layers that most tutorials never separate, and mixing them up is why so many custom servers crash agents instead of helping them recover.

Jun 26, 2026 · 17 min read