Skip to content
All articles

RAG and AI agents

Retrieval, tools and orchestration

RAG and AI agents · · 13 min readRAG chunking strategies: how to split documents that retrieve wellCompare chunking strategies for RAG, from fixed-size and recursive splitting to structure-aware and contextual chunks, and learn how to choose by measuring.RAG and AI agents · · 14 min readPrompt injection: how it works and how to defend your appHow direct and indirect prompt injection work, why filters alone fail, and the layered controls that limit what an injected LLM app can do.RAG and AI agents · · 13 min readModel Context Protocol (MCP) explained with a working serverHow MCP connects AI applications to tools and data: the architecture, the messages on the wire, and a Python server you can run and test.RAG and AI agents · · 12 min readHybrid search and reranking: better retrieval for RAGCombine keyword and vector search with reciprocal rank fusion, then rerank with a cross-encoder, using PostgreSQL, Qdrant and Python examples.RAG and AI agents · · 14 min readHow to evaluate a RAG system: metrics, test sets and toolingBuild a test set, measure retrieval with recall and MRR, score answers for faithfulness with an LLM judge, and run it all as a regression check.RAG and AI agents · · 13 min readpgvector vs Qdrant vs Chroma: choosing a vector databaseCompare pgvector, Qdrant and Chroma on indexing, filtering, operations and scale, with working setup commands and queries for each one.RAG and AI agents · · 13 min readBuild a RAG pipeline from scratch in Python, step by stepBuild retrieval-augmented generation in plain Python: load and chunk documents, embed them, search by similarity and generate answers that cite sources.RAG and AI agents · · 14 min readBuild an AI agent with tool calling from first principlesWrite a working AI agent loop in plain Python: define tools, handle tool calls, feed results back and add the limits that keep it safe.