April 6, 2026 · 2 min read

Ardan Ultimate AI #30 — PDF extraction with Docling + LLM

PDFs are the format that breaks every RAG pipeline. Docling is the IBM-research extractor that handles layout, tables, and figures. The example wires Docling + LLM to make PDFs usable.

Ardan LabsGoRAGPDFDocling
April 1, 2026 · 2 min read

Ardan Ultimate AI #25 — Poisoned-document attacks on RAG and defenses

A RAG pipeline that ingests user-supplied documents is a prompt-injection vector. An attacker uploads a document with hidden instructions; the LLM retrieves it and follows them. Defense: input filtering, content classification, output verification.

Ardan LabsGoSecurityRAG
March 30, 2026 · 2 min read

Ardan Ultimate AI #23 — Direct and indirect prompt injection, plus defenses

The single biggest LLM security risk. The example walks through both forms (direct from user input, indirect via retrieved content) and the layered defenses: system prompt isolation, content classification, output validation, structured tool schemas.

Ardan LabsGoSecurityPrompt Injection
March 27, 2026 · 2 min read

Ardan Ultimate AI #20 — Embedding-based semantic cache

Exact-match caching misses paraphrases. "What is the refund policy?" and "How do refunds work?" should both hit the same cached answer. Semantic cache embeds queries and matches by similarity.

Ardan LabsGoCachingCost Optimisation
March 26, 2026 · 2 min read

Ardan Ultimate AI #19 — Speculative decoding with a draft model

Run a small draft model to predict several tokens at once; verify them in a single pass with the large model. Latency drops without quality dropping. The technique production LLM serving uses but most application engineers don't see.

Ardan LabsGoLLM OpsPerformance
March 25, 2026 · 2 min read

Ardan Ultimate AI #18 — Incremental message caching (IMC) for chat

A long chat reprocesses the entire history on every turn. Prefix caching lets the LLM serve the cached KV-cache prefix from the previous turn and only compute the new suffix. Massive latency win on long conversations.

Ardan LabsGoLLM OpsPerformance
March 24, 2026 · 2 min read

Ardan Ultimate AI #17 — Building an agent over an MCP server

Model Context Protocol standardises tool calling across LLMs. The example builds both sides: an MCP server exposing tools, and an agent that calls them. Works the same against any MCP-compatible LLM.

Ardan LabsGoMCPAgents
March 22, 2026 · 2 min read

Ardan Ultimate AI #15 — A read-only NL→SQL tool

Give an LLM a SQL tool, watch it write delete statements. The read-only version: parse the generated SQL, refuse anything that isn't SELECT, validate against an allow-listed schema, run with a strict timeout.

Ardan LabsGoSQLAgentsSecurity
March 21, 2026 · 2 min read

Ardan Ultimate AI #14 — A streaming agent with a reasoning panel

Stream the agent's reasoning and tool calls to the UI as they happen. The user sees "thinking about X, calling tool Y, got result Z, now answering..." — dramatically better UX than waiting for the final answer.

Ardan LabsGoAgentsStreamingUX
March 20, 2026 · 2 min read

Ardan Ultimate AI #13 — A minimal multi-tool agent loop

The smallest possible multi-tool agent. The loop is 30 lines of Go and shows exactly what an "agent" is — there's no magic, just a structured back-and-forth between the LLM and a set of tools until the model says stop.

Ardan LabsGoAgents
March 19, 2026 · 2 min read

Ardan Ultimate AI #12 — Two-phase tool calling explained

The tool-calling dance: the LLM emits a structured tool call → application runs the tool → application appends the result → the LLM uses it in the next turn. Two phases. Everything else is detail.

Ardan LabsGoTool CallingLLM
March 16, 2026 · 2 min read

Ardan Ultimate AI #09 — Debugging retrieval in isolation (K and threshold)

When RAG gives wrong answers, the problem is usually retrieval, not the LLM. The example isolates the retrieval step so you can see exactly what chunks come back for a given query, with what scores, and tune K and the similarity threshold accordingly.

Ardan LabsGoRAGDebugging
March 12, 2026 · 2 min read

Ardan Ultimate AI #05 — The same question with and without RAG

Side-by-side comparison: ask the LLM a domain question with no context, then ask with retrieved context. The without-RAG answer is plausible nonsense. The with-RAG answer is correct. The example that motivates everything else in the course.

Ardan LabsGoRAGFoundations
March 10, 2026 · 2 min read

Ardan Ultimate AI #03 — Context injection into a prompt

Before RAG and tools, the original way to give an LLM extra information was to inject it into the prompt. The example shows the right way to format injected context and what the LLM does (and doesn't) pay attention to.

Ardan LabsGoPromptingLLM
March 9, 2026 · 2 min read

Ardan Ultimate AI #02 — LLM-generated embeddings

Hand-crafting vectors stops scaling at about 10 dimensions. LLM-generated embeddings give you a 1024-dim vector that captures semantic meaning. The example shows how to generate them and what they're good for.

Ardan LabsGoEmbeddingsFoundations