The lab notebook
Field notes on AI engineering
824 articles · page 11 of 28
RAG Over SQL and Structured Data: Text-to-Query Patterns That Work
Vector search cannot compute an average. These are the text-to-query patterns that make RAG over SQL and structured data actually work: schema-aware generation, schema linking, verified queries, and guardrails that keep generated SQL safe to execute.
Keeping RAG Fresh: Incremental Indexing and Cache Invalidation
Nightly full re-embeds stop scaling fast. A hands-on guide to RAG incremental indexing: content-hash diffing, stable chunk IDs, delete handling, and the cache layers you must invalidate to stop serving stale answers.
Permission-Aware RAG: Access Control for Enterprise Retrieval
Vector search does not know your org chart. How to enforce document permissions in a RAG pipeline with pre-filtering, Postgres row-level security, Qdrant payload filters, OpenFGA, and multi-tenant isolation, with code that runs.
Query Rewriting for RAG: HyDE, Step-Back and Decomposition
Raw user queries are the weakest link in most RAG pipelines. Implement query rewriting with HyDE, step-back prompting, decomposition and reciprocal rank fusion in plain Python, then measure which one actually lifts recall on your corpus.
Multimodal RAG: Retrieving Images, Tables and Charts
Text-only RAG silently drops charts, tables and diagrams. Here are the three multimodal RAG architectures that work in production, with runnable Python for each and a decision guide.
Shared Memory for Multi-Agent Systems: Blackboards to Message Queues
Blackboards, graph state, message queues, and vector stores: how to give a team of AI agents shared memory that survives concurrent writes, context limits, and production load. Includes runnable Python for each pattern.
MCP Security Best Practices: Auth, Sandboxing and Prompt Injection Defense
A hands-on guide to MCP security: OAuth 2.1 audience-bound auth, container sandboxing for stdio servers, tool pinning against rug pulls, and the prompt injection defenses that actually hold up in production.
Remote MCP Servers: OAuth, Streamable HTTP and Production Deployment
How to build, secure and ship a remote MCP server: the Streamable HTTP transport, the OAuth 2.1 discovery flow, working TypeScript code, and the proxy and session gotchas that break servers in production.
MCP Gateways for the Enterprise: Routing, Auth and Audit
How an MCP gateway centralizes routing, OAuth 2.1 auth and tool-call audit logging for enterprise AI agents, with a runnable gateway skeleton, policy examples and a tour of the 2026 gateway landscape.
Debugging MCP Servers with MCP Inspector: A Field Guide
MCP Inspector is the fastest way to find out why your MCP server will not connect, list tools, or return results. A hands-on field guide covering the UI, CLI mode, stdout corruption, timeouts, remote transports, and CI smoke tests.
MCP Apps: Interactive UI Inside AI Chat Clients
MCP apps let your MCP server render real interactive UI (dashboards, pickers, forms) inside ChatGPT, Claude, and other chat clients. Here is how the extension works under the hood, plus a complete TypeScript server you can run and test locally today.
Late Chunking and Long-Context Embeddings Explained
Late chunking embeds the whole document first and splits it afterward, so every chunk vector keeps full-document context. Here is how it works, with runnable code and an honest comparison against contextual retrieval and ColBERT.
Automated Code Review with Claude Code: A Working Setup
A copy-paste Claude Code review setup that actually runs in production: a local review slash command, a read-only reviewer subagent, house rules in CLAUDE.md, and a GitHub Actions workflow that reviews every pull request.
Connecting MCP Servers to Claude Code: Setup Guide That Works
The claude mcp add command, scopes, transports, .mcp.json, OAuth, and the debugging sequence that fixes the connection failures everyone hits.
Headless Claude Code: Agent SDK Automation Patterns
Run Claude Code without the terminal UI: claude -p print mode, the Claude Agent SDK in TypeScript and Python, permission gating, CI review bots, cron agents, custom MCP tools, and cost control patterns that survive production.
API Testing with Claude Code: From curl to Full Test Suites
A hands-on Claude Code API testing workflow: explore endpoints with curl, freeze findings into a smoke script, generate pytest and Playwright suites, and run everything in CI without the agent in the critical path.
Agentic RAG Tutorial: Build a Retrieval Agent That Decides When to Search
Build a retrieval agent in roughly 100 lines of Python that decides for itself when to search a vector store, rewrites weak queries, and cites its sources. Full tool-use loop, system prompt, and a decision eval harness included.
How to Evaluate AI Agents: Trajectories, Outcomes and Cost
A hands-on guide to evaluating AI agents across the three axes that matter: outcome checks, trajectory scoring, and cost metrics, plus a minimal eval harness you can run in CI.
Stop Building Chatbots. Start Building Agents.
The chatbot era peaked in 2024. Here is the mental-model shift that separates teams shipping real agentic products from teams shipping demos.
The 7 Biases Hiding in Your LLM Judge
Position bias, verbosity bias, self-preference… your eval scores may be theater. A practical checklist to audit your judge before you trust it.
Your Second Brain Should Talk Back
Note-taking apps store. Agents retrieve, connect and resurface. Why 2026 is the year personal knowledge management becomes agentic.
The Claude Code Workflow We Teach Every Student
Spec first. Plan mode always. Verify before merge. The three-rule workflow that makes AI pair-programming compound instead of churn.
RAG Isn't Dead — Your Chunking Is
Million-token contexts did not kill retrieval. Bad chunking did. Five chunking strategies compared on real docs.
Designing Certificates That Actually Mean Something
Completion certificates are wallpaper. Here is how TeachYou certificates are earned — labs verified, capstones reviewed, skills demonstrated.
30 Days to a Production AI Agent: The Hermes Agent Curriculum Breakdown
A day-by-day breakdown of the 30 day AI agent bootcamp that takes you from a bare while-loop to a deployed, evaluated production agent.
Agent Memory, Planning and Tools: How the Hermes Agent Handles All Three
A technical breakdown of how AI agents like Hermes combine tool use, planning, and layered memory to act reliably over long tasks.
Top AI Agent Frameworks Compared: LangGraph, CrewAI, AutoGen and More
A practitioner's comparison of LangGraph, CrewAI, AutoGen, provider-native SDKs, and when to skip frameworks entirely.
AI Agents vs Workflows: When You Actually Need Autonomy
Most "agent" projects should have been a workflow — here's the decision framework for telling the two apart before you build.
AI Engineering Roadmap 2026: From Prompting to Production Agents
A staged AI engineering roadmap for 2026 — from prompting and APIs to RAG, tool use, agents, evals, and production.
Building an Autonomous Agent from Scratch: The Hermes Agent Architecture
A first-principles walkthrough of how to build an autonomous agent from scratch: the loop, tools, memory, planning, and the stopping conditions everyone skips.