Resources
Glossary, cheatsheets, guides and references.
Token · Context window · Embedding · Vector search · RAG · Chunking · Reranking · Function calling · Tool calling · Agent · ReAct · MCP · Guardrails · Prompt injection · Faithfulness · Hallucination · Structured output · Streaming · TTFT · Hybrid search · BM25 · HNSW · Cross-encoder · LLM-as-judge · Eval-driven development · Human-in-the-loop · Policy layer · Circuit breaker · Semantic cache · Model routing · Fallback chain
Error handling · Authentication · Authorisation · Input validation · Secrets management · Logging · Tracing · Monitoring · Evaluation · Rate limiting · Retry strategy · Cost controls · Security review · Data privacy · Deployment · Rollback strategy · Prompt injection defence · Output guardrails · Audit logging · Fallback chain · Caching · Circuit breaker · Online eval · Runbook · On-call
Use a system prompt to establish role and rules. Be specific about output format. Provide examples (few-shot) for non-trivial formats. Constrain with JSON schemas. Ask the model to think step-by-step for reasoning. Use delimiters for untrusted content. Set temperature 0 for extraction, 0.7 for creative. Always validate output. Version your prompts. Evaluate before shipping.
Ingestion: multi-format → clean → chunk (section-aware, 512 tokens, 64 overlap) → embed (1024-dim) → store in pgvector with metadata. Query: rewrite → hybrid search (vector + BM25 with RRF) → rerank (cross-encoder) → top-5 → LLM with cited context → output guard → citation. Production: cache (semantic, 0.95 threshold) + route (small model default) + trace + online eval + cost budget + RBAC filter at query.
Always set max_iter and cost budget. Validate tool arguments. Catch tool errors and feed as observations. Trace every step. Human-in-the-loop for destructive actions. Output guards on tool results (injection via tool output). Deduplicate tool calls. Reflect before final answer. Fallback to deterministic path on failure. Per-tool timeout. Circuit breaker on downstream failures.