Interview prep
AI interview patterns
Interviewers reuse a small set of ideas. Learn each pattern once: when to use it, how it works, what it costs, and how to say it out loud.
Retrieval and RAG
Find the right text and answer from it.
- Graph RAGExtract entities and relationships into a knowledge graph so questions about connections and themes can be answered.
- Grounded answers with citationsMake the model answer only from given passages, cite them by id, and refuse when they do not cover the question.
- Hybrid search + rerankRun keyword and vector search together, merge the results, then let a slower, sharper model reorder the top few.
- Long context or RAGDecide whether to send whole documents in a long context window or retrieve a few passages.
- Metadata and permission filtersStore who may see each chunk and what it is about, and filter inside the search before ranking.
- Parent-child chunkingSearch small, precise chunks, but send the model their larger parent section so it has the full context.
- Query rewritingTurn what the user typed into a better search query: standalone, expanded, or split into parts.
- RAG pipelineAnswer from your own documents: retrieve the right passages at question time and make the model answer only from them, with citations.
Agents
Models that take steps and use tools, safely.
- Agent loopA model that repeatedly chooses a tool, sees the result, and decides the next step until the task is done.
- Short- and long-term memoryKeep the current conversation compact, and save durable facts about the user across sessions with source and date.
- Budgets and kill switchesCap steps, tokens, time and money per task, user and day, and let an operator stop any agent instantly.
- Human approval for actionsPause before costly, irreversible or external actions; show a person the action and evidence; resume with their decision.
- Plan, execute, reflectA planner writes the steps, each step runs a short loop, and a check pass reviews the draft before the final answer.
- Supervisor and sub-agentsA lead agent splits work into parts, runs sub-agents with fresh contexts in parallel, and merges their summaries.
- Task-shaped toolsGive the agent a few clear tools shaped around tasks, with strict schemas, instead of wrapping every API endpoint.
Evaluation
Prove it works, and keep it working.
- Golden test setA fixed set of real inputs with what a good output must contain, run on every change and reported by category.
- LLM as judgeA model grades outputs against a rubric, calibrated against human grades before its scores are trusted.
- Online evals and tracingTrace every request in production, score them with rules, a judge on a sample and user feedback, and turn failures into test cases.
- Regression gate in CIRun a fast eval tier on every change and a full tier before deploy, and block merges that make a category worse.
- Agent trajectory evalsJudge an agent on the outcome, the path it took, and how consistently it succeeds across runs.
Serving and cost
Fast, reliable and affordable in production.
- Prompt and response cachingReuse work: cache the stable start of prompts, and cache whole answers to repeated questions.
- LLM gateway with fallbacksOne service in front of every model call: keys, budgets, retries, fallbacks, logging and model aliases.
- Model routing and tieringSend easy requests to a small, cheap model and hard ones to a large model, checked by a validator.
- Streaming and background queuesStream tokens so users see words at once, and move slow work (OCR, indexing, batch jobs) to a queue.
- Structured output with validationMake the model return JSON that matches a schema, validate it in code, and retry once with the error.
Safety
Limit what can go wrong.
- Guardrail layersChecks before the model (input), after it (output) and before any action, each logged with its reason.
- Least privilege and sandboxingGive each tool the narrowest access, and run generated code in a locked-down sandbox.
- Prompt injection defenceAssume text from users, documents and tools may carry instructions, and limit what a hijacked model could do.