teachyou.ai academy

The lab notebook

Field notes on AI engineering

824 articles · page 4 of 28

AI Agentstool calling

Handling Tool Timeouts in AI Agents

A practical guide to detecting, surviving, and recovering from agent tool timeout failures, with runnable Python patterns for retries, circuit breakers, and graceful degradation.

Jul 8, 2026 · 13 min read
AI Agentsprompt engineering

Prompt Templates for AI Agents

A hands-on guide to building, versioning, and testing agent prompt templates, with runnable Python examples for ReAct loops, tool-calling agents, and RAG agents.

Jul 8, 2026 · 13 min read
AI Agentsobservability

Agent Observability with Langfuse

A hands-on guide to instrumenting AI agents with Langfuse: traces, spans, sessions, scores, and cost tracking, so you can debug multi-step agent runs instead of guessing what went wrong.

Jul 9, 2026 · 12 min read
AI Agentsvector databases

Agent Memory with a Vector Store

Learn how to give an LLM agent persistent memory using a vector store, from chunking and embedding to retrieval, write-back, and pruning, with runnable Python code.

Jul 9, 2026 · 12 min read
AI Agentsagent safety

Implementing Guardrails for AI Agents

A practical walkthrough of building input validation, tool allowlists, output checks, and human-in-the-loop approval into an AI agent, with runnable Python code you can adapt today.

Jul 9, 2026 · 13 min read
AI AgentsLLM reliability

Fallback Models for AI Agents

Learn how to design and implement fallback models for AI agents so a single provider outage, rate limit, or bad response never takes your agent offline.

Jul 9, 2026 · 13 min read
AI AgentsLLM Evaluation

Evaluation Metrics for AI Agents

A practical breakdown of the agent evaluation metrics that actually predict production behavior, task completion rate, tool call accuracy, trajectory scoring, cost per task, and how to wire them into a runnable regression harness.

Jul 10, 2026 · 13 min read
AI Agentsserverless

Deploying AI Agents on Serverless

A hands-on guide to agent serverless deployment: how to package, invoke, and scale LLM agents on Lambda, Cloudflare Workers, and Modal without falling over on cold starts or timeouts.

Jul 10, 2026 · 14 min read
AI AgentsLLM cost optimization

Agent Cost Budgeting: How to Stop AI Agents From Burning Your Token Budget

Learn how to set real spending limits on autonomous AI agents, track token usage per task, and stop runaway tool-call loops before they empty your API budget.

Jul 10, 2026 · 12 min read
RAGgraph rag

Building Graph RAG with Neo4j

How to build graph RAG on Neo4j for multi-hop retrieval.

Jul 10, 2026 · 12 min read
Workflow AutomationLLM tool use

Zapier AI Actions for LLM Workflows: A Practical Guide

Learn how Zapier AI Actions let LLMs like Claude and ChatGPT trigger real work in your existing apps, with setup steps, code, and the tradeoffs versus native function calling.

Jun 19, 2026 · 13 min read
Multimodal AIcomputer vision

A Guide to Vision-Language Models

A practical, code-first walkthrough of how vision-language models work, how to call one through an API, how to run one locally, and how to fine-tune one on your own images.

Jun 20, 2026 · 16 min read
Vector Databaseshnsw tuning

Tuning HNSW Vector Indexes

A hands-on guide to HNSW tuning for engineers: what m, ef_construction, and ef_search actually do, how to measure recall, and how to trade latency for accuracy without guesswork.

Jun 20, 2026 · 14 min read
Vector Databasessharding

Sharding and Scaling Vector Databases

A working engineer's guide to vector database sharding: how to split billions of embeddings across nodes, when to shard by ID versus by cluster, and how to keep recall high while queries fan out.

Jun 20, 2026 · 15 min read
Vector Databasesvector hybrid search

Hybrid Search in Vector Databases

Vector hybrid search combines keyword scoring with dense embeddings so your RAG retrieval stops missing exact terms and product codes. Here is how to wire it up with real code.

Jun 20, 2026 · 13 min read
Data EngineeringLLM tooling

Structured Data Extraction with LLMs: A Practical Engineering Guide

A hands-on guide to structured extraction with LLMs: schema design, function calling, validation, chunking, and the production pitfalls that break pipelines in week two.

Jun 20, 2026 · 14 min read
RAGvector database

Choosing a Vector Database for RAG

A practical decision framework for picking a vector database for rag, with real tradeoffs between pgvector, Pinecone, Qdrant, Weaviate, and Milvus, plus runnable code to test each one.

Jun 21, 2026 · 10 min read
RAGretrieval

Time-Aware RAG: Ranking Retrieval by Recency

Plain cosine similarity keeps surfacing a stale doc from three years ago over the update from last week. Here is how to build time-aware RAG that ranks retrieval by recency without breaking evergreen content.

Jun 21, 2026 · 12 min read
RAGreranking

RAG Reranking Compared: Cohere, BGE, and Jina

A hands-on comparison of Cohere Rerank, BGE reranker, and Jina reranker for RAG pipelines, with code, latency and cost tradeoffs, and a decision guide for picking one.

Jun 21, 2026 · 14 min read
RAGretrieval augmented generation

Multi-Hop RAG: Answering Questions That Need Several Documents

Standard RAG breaks the moment an answer needs facts from two or more documents chained together. Here is how multi-hop RAG actually works, with runnable code for decomposition, iterative retrieval, and graph-based hops.

Jun 21, 2026 · 13 min read
RAGhybrid search

Hybrid Search with Reciprocal Rank Fusion: Combining Vector and Keyword Search in RAG

Reciprocal rank fusion merges vector and keyword search results without tuning a single weight, and it is the simplest fix for the queries your embedding-only RAG pipeline keeps getting wrong.

Jun 21, 2026 · 11 min read
RAGevaluation

Closing the Loop: Feedback Signals in RAG

Most RAG systems ship and then go quiet, no signal on which retrievals were wrong or which answers users trusted. Here is how to build rag feedback loops that turn thumbs, clicks, and corrections into better retrieval and generation.

Jun 22, 2026 · 14 min read
RAGretrieval augmented generation

Contextual Compression in RAG Pipelines: A Practical Guide

Contextual compression in RAG strips retrieved chunks down to the sentences that actually answer the query, cutting noise, token cost, and hallucination risk before generation. Here is how to build it, tune it, and know when it is worth the extra hop.

Jun 22, 2026 · 14 min read
RAGsource attribution

Adding Citations and Source Attribution to RAG

A concrete, code-first guide to attaching real citations to RAG answers, so every claim links back to a passage a user can actually verify.

Jun 22, 2026 · 11 min read
RAGretrieval augmented generation

Tuning RAG Chunk Size and Overlap

Your RAG chunk size choice quietly caps retrieval quality before a single embedding gets computed. Here is how to pick a starting point, tune it with real evals, and stop guessing.

Jun 22, 2026 · 12 min read
Vector DatabasesQdrant

Qdrant vs Weaviate: Choosing a Vector Database

A hands-on Qdrant vs Weaviate comparison for engineers building RAG and semantic search: real client code, filtering, hybrid search, and how to pick.

Jun 22, 2026 · 14 min read
Prompt EngineeringLLM cost optimization

Prompt Token Optimization: A Practical Guide for Engineers Cutting LLM Costs

Prompt token optimization is the difference between a $200 monthly API bill and a $2,000 one at the same traffic. Here is how to measure, trim, and cache your way to leaner prompts without breaking output quality.

Jun 23, 2026 · 13 min read
Prompt EngineeringLLM testing

Prompt Testing Frameworks for LLM Apps: A Practical Guide

Your prompts will break in production if you never test them. Here's how to build a real prompt testing framework with promptfoo, DeepEval, and pytest, plus how to wire it into CI.

Jun 23, 2026 · 13 min read
Prompt EngineeringPython

Prompt Templates with Jinja: A Practical Guide for LLM Apps

Learn how to use prompt templates with Jinja to build reusable, testable, version-controlled prompts instead of tangled f-strings, with runnable Python examples for the Claude API.

Jun 23, 2026 · 13 min read
Prompt Engineeringchain of thought

Self-Consistency Prompting for Better Answers

Self consistency prompting fixes flaky LLM answers by sampling multiple reasoning paths and voting on the result. Here's how to implement it, when it's worth the extra cost, and where it breaks down.

Jun 23, 2026 · 11 min read