The lab notebook
Field notes on AI engineering
824 articles · page 1 of 28
A Practical Guide to Pinecone
A hands-on pinecone guide for engineers building retrieval and RAG systems: index setup, upserts, metadata filtering, namespaces, and the mistakes that quietly blow up your recall.
A Practical Guide to Milvus
A hands-on Milvus guide covering installation, collections, indexing, and hybrid search, with runnable Python code for building a real retrieval pipeline.
Metadata Indexing in Vector Databases
Vector metadata indexing lets you attach structured fields to embeddings and filter on them at query time, turning a pure similarity search into a precise, scoped retrieval system.
A Practical Guide to Chroma
A hands-on chroma guide covering setup, collections, embeddings, filtering, and production tradeoffs, with runnable code for building a real retrieval pipeline.
Backing Up and Restoring Vector Databases
A practical guide to vector database backup and restore across Qdrant, Weaviate, Milvus, pgvector, and Pinecone, with runnable snapshot, export, and disaster recovery scripts.
Testing RAG Pipelines End to End: A Practical Guide
Testing RAG pipelines means checking retrieval quality, generation faithfulness, and the full request-to-answer path separately, then wiring all three into CI with a golden dataset. This guide shows exactly how, with runnable pytest code.
How to Test LLM Applications
A practical, hands-on guide to testing LLM applications, covering deterministic checks, LLM-as-judge evaluation, regression suites, and CI integration with runnable code.
A Guide to Testing AI Agents
Testing AI agents means checking tool calls, multi-step reasoning, and non-deterministic outputs, not just asserting on a single response. This guide covers harnesses, eval datasets, and regression checks you can run today.
Snapshot Testing for LLM Prompts: A Practical Guide
Snapshot testing prompts catches silent regressions when you change a model, a prompt template, or a system message. This guide shows how to build a snapshot suite with pytest, handle non-determinism, and wire it into CI.
A Guide to Microsoft Semantic Kernel
Semantic Kernel is Microsoft's open-source SDK for wiring LLMs into real applications through plugins, planners, and memory. This guide walks through the kernel, functions, and agent orchestration with runnable code.
RAG Reranking Latency
Reranking can improve retrieval quality without making every request feel slow. Learn how to measure, budget, implement, and tune the full reranking path with runnable Python and practical production controls.
RAG Query Expansion
Improve retrieval when users ask vague, short, or vocabulary-mismatched questions. This practical guide implements query expansion, fusion, filters, evaluation, and production safeguards with runnable Python.
RAG HYDE Technique
Learn how HyDE improves difficult RAG retrieval by generating a hypothetical answer before vector search. Build, evaluate, and productionize the pattern with runnable Python and practical safeguards.
RAG Hallucination Testing
Learn how to catch unsupported RAG answers with reproducible datasets, retrieval checks, claim-level grading, and CI gates. Build a practical test harness that tells engineers exactly what failed and why.
RAG Evaluation: Precision and Recall
Learn how to measure RAG precision and recall with runnable Python examples, understand context precision vs context recall, and wire the metrics into a repeatable evaluation loop.
Document Preprocessing for RAG: A Practical Pipeline That Actually Works
RAG document preprocessing is the step most teams rush and regret. Here's a hands-on pipeline for extraction, cleaning, chunking, and metadata that keeps retrieval accurate.
RAG Cross Encoder Reranking
Improve RAG answer quality by reranking retrieved passages with a cross encoder. Build a runnable pipeline, tune it safely, and measure whether the extra latency earns its place.
Tuning RAG Chunk Overlap
A hands-on guide to picking and testing chunk overlap for retrieval-augmented generation, with runnable Python for token-based splitting, an eval harness, and rules of thumb by document type.
Pydantic AI: A Hands-On Tutorial
Learn Pydantic AI by building a real agent step by step, covering structured outputs, tools, dependency injection, streaming, and testing.
Controlling LLM Output Formatting with Prompts
A practical guide to forcing consistent, parseable output from language models, covering delimiters, schemas, structured output modes, and validation loops you can drop into production code today.
Managing a Prompt Library at Scale
A practical system for organizing, versioning, and testing hundreds of prompts so your team stops copy-pasting from Slack and starts shipping consistent, reviewable prompt changes.
Selecting Few-Shot Examples That Work
Few-shot example selection decides whether your prompt generalizes or overfits to whatever you happened to paste in. Here is a practical, testable process for picking, ordering, and retiring examples.
Handling Errors and Refusals in Prompts
A practical guide to prompt error handling, covering why LLMs refuse or produce malformed output, how to detect both automatically, and how to build retry, repair, and fallback logic that keeps production pipelines running.
Prompt Engineering for Modern Claude Models
A hands-on guide to prompt engineering for Claude: system prompts, XML structuring, extended thinking, few-shot examples, and tool use, with runnable Python and TypeScript examples.
Decomposing Complex Tasks into Prompt Steps
Task decomposition prompting turns one overloaded instruction into a chain of small, verifiable steps, cutting hallucinations and making failures easy to locate. Here's how to design, chain, and debug multi-step prompts with real code.
Context Priming for Better LLM Responses
Context priming means loading an LLM with the right background, examples, and constraints before it sees your actual question, and it is the single highest-leverage habit for consistent, on-target model output.
A/B Testing Your Prompts
A practical walkthrough for running prompt a/b testing on production LLM features, from designing clean variants to scoring outputs and reading results without fooling yourself.
Triggering AI Workflows with n8n Webhooks
Learn how to wire an n8n webhook to an AI node so any external event, form submit, Slack message, or API call, kicks off an automated AI workflow. Includes working node configs, auth, and error handling.
Integrating OpenAI into n8n Workflows
A hands-on guide to wiring OpenAI into n8n, covering credentials, the OpenAI node versus HTTP Request node, prompt structure, tool calling, and error handling for production workflows.
Automating Email Triage with AI in n8n
Build an n8n workflow that reads incoming email, classifies it with AI, and routes it to the right label, channel, or ticket automatically.