AI Articles

All articles

Prompt Caching: Cut LLM Costs and Latency for Repeated Context

How prompt caching works, which parts of a prompt can be cached, structuring prompts for cache hits, pricing effects and measuring hit rates.

LLM Evals: How to Test AI Features Before They Reach Users

Build evaluations for LLM features: golden datasets, code-based and model-graded checks, regression suites in CI, and production monitoring of quality.

Prompt Injection Explained: Direct, Indirect and How to Defend LLM Apps

What prompt injection is, direct vs indirect attacks via documents and web pages, real impacts like data exfiltration, and layered defences that actually hel...

LLM Function Calling (Tool Use) Explained with Examples

How function calling works: defining tools with JSON Schema, the request-response loop, parallel calls, error handling and designing tools models use well.

Structured Outputs from LLMs: Reliable JSON with Schemas

Get reliable JSON from language models: JSON mode vs schema-constrained output, Pydantic and zod validation, retries, and designing schemas models follow.

LLM Quantization Explained: FP16, INT8, 4-bit, GGUF and AWQ

How quantization shrinks large language models: precision formats, memory math, quality trade-offs, GGUF vs GPTQ vs AWQ, and choosing a level.

LLM Context Windows Explained: Limits, Costs and Long-Context Tricks

What a context window is, how input and output share it, why long contexts cost more and degrade attention, and techniques to work within limits.

Temperature, Top-p and Sampling: How LLMs Choose the Next Token

How LLM sampling works: probability distributions, temperature, top-p (nucleus) and top-k, determinism and recommended settings by task.

Embeddings Explained: How Text Becomes Vectors for Search and AI

What embeddings are, how cosine similarity measures meaning, dimensions and normalisation, common uses like semantic search and clustering, and pitfalls.

LLM Tokens and Tokenization Explained (and Why They Affect Cost)

What tokens are, how BPE tokenizers split text, why code and non-English text use more tokens, and how tokens drive context limits and API pricing.

Evaluating RAG Systems: Retrieval Metrics, Faithfulness and LLM-as-Judge

How to measure RAG quality: build a golden dataset, measure recall and precision of retrieval, faithfulness and relevance of answers, and run evals in CI.

Hybrid Search for RAG: BM25 + Vector Search + Re-ranking

Why pure vector search misses exact matches, how hybrid search combines BM25 and embeddings with reciprocal rank fusion, and how re-rankers improve precision...

Chunking Strategies for RAG: Fixed, Recursive, Semantic and Structure-Aware

How to split documents for retrieval: chunk size and overlap, recursive and structure-aware splitting, semantic chunking, parent-child chunks and testing.

Context Engineering: The Skill Behind Reliable LLM Applications

Context engineering explained: deciding what goes into an LLM context window — instructions, examples, retrieved data, tools, memory — and how to keep it lea...

Retrieval-Augmented Generation (RAG) Explained Step by Step

How RAG works: chunking, embeddings, vector search, prompt assembly and generation, plus when RAG beats fine-tuning and how to evaluate it.

Guardrails for AI Agents: Permissions, Validation and Human-in-the-Loop

Keep AI agents safe in production: permission tiers, input and output validation, budgets, sandboxes, approvals for risky actions, and audit logs.

Memory for AI Agents: Short-Term Context, Long-Term Memory and Compaction

How AI agents remember: the context window as working memory, summarisation and compaction, long-term memory stores, retrieval and what to forget.

Multi-Agent Systems with LLMs: When to Split Work Across Agents

How multi-agent LLM systems work: supervisor and peer topologies, context isolation, handoffs, shared state, costs, and when one agent is better.

AI Agent Design Patterns: Prompt Chaining, Routing, Orchestrator-Workers and More

The core patterns for building LLM systems: prompt chaining, routing, parallelization, orchestrator-workers, evaluator-optimizer and autonomous agents.

What Are AI Agents? How LLM Agents Plan, Use Tools and Act

AI agents explained: the agent loop, tools, memory, planning, and how agents differ from chatbots and fixed workflows, with a minimal code example.

MCP Security: Tool Poisoning, Prompt Injection and Safe Server Design

Security risks of Model Context Protocol servers: tool poisoning, prompt injection via tool results, over-broad permissions, token handling, and how to defen...

MCP Transports: stdio vs Streamable HTTP (and Why SSE Was Replaced)

How MCP messages travel: local stdio servers vs remote Streamable HTTP servers, session handling, streaming responses and choosing the right transport.

Build an MCP Server in TypeScript (Node.js)

Create a Model Context Protocol server with the official TypeScript SDK: register tools with zod schemas, add resources, run over stdio and test.

Build an MCP Server in Python with FastMCP

Step-by-step: build a Model Context Protocol server in Python using the official SDK and FastMCP, expose tools and resources, test it and connect it.

Model Context Protocol (MCP) Explained: How AI Apps Connect to Tools and Data

What the Model Context Protocol is, why it exists, and how hosts, clients and servers exchange tools, resources and prompts over JSON-RPC.