What RAG is and when to use it
How retrieval-augmented generation lets a language model answer from your content, and how to tell whether your project needs it.
Blog
Practical explanations of RAG, agents, orchestration and LLM features, focused on trade-offs and design decisions.
How retrieval-augmented generation lets a language model answer from your content, and how to tell whether your project needs it.
The trade-offs between one agent and several, the coordination patterns involved and a step-by-step way to choose.
A worked support-router example covering state, nodes, conditional routing, checkpointing and human review.
Fixed-size, recursive, structure-aware, semantic and parent-child chunking compared, with an experiment for choosing between them.
The backend, interface, security, cost and rollout decisions around a model call, with a checklist to finish on.
A practical method for measuring a RAG system: building a test set, scoring retrieval and answers separately, and turning failures into specific fixes.
How to pause an agent for human approval: deciding what to gate, resuming safely, showing reviewers the right information and avoiding approval fatigue.
How to combine keyword and vector search, merge their rankings with reciprocal rank fusion, and decide whether a reranker is worth its extra latency.
A practical path from model to browser: choosing a transport, designing events, rendering partial Markdown safely, and handling cancellation, errors and proxies.
What prompt injection is, why filters alone cannot stop it, and how to layer permissions, output handling, approval and testing so that a manipulated model can do little harm.
How LLMs compare with rules, linear models, embeddings and fine-tuned transformers for classifying text, how to test them fairly and when to combine them.
When to use an LLM for entity and data extraction, and how to design schemas, validate output, catch invented values and measure quality field by field.
How to manage state within an agent run and decide what to keep long term, including retrieval, conflicts, forgetting and the security risks of persistent memory.
How to design tools that agents use correctly: clear descriptions and schemas, validation, actionable errors, idempotent side effects, loop limits and testing.
Framework-neutral concepts for a Python agent backend: modelling runs, state machines, background work, idempotency, permissions, cancellation, limits and testing.
A decision guide based on control flow: what each library is for, how they work together, the signs you have outgrown a simple chain and when to use neither.
FastAPI-specific structure and async patterns for LLM services: project layout, shared clients, avoiding a blocked event loop, concurrency limits, timeouts and disconnects.
What embeddings are, how to compare embedding models on your own data and the criteria that matter when choosing a vector store, including when your existing database is enough.
The risks of letting an LLM write SQL and the layered safeguards that reduce them: database permissions, tenant isolation, query validation, resource limits and accuracy testing.
Techniques for reducing what an LLM application spends and how long it takes: measuring by step, trimming context, model routing, caching, output limits, streaming and agent loop controls.