Skip to content
AI Engineering

How I build AI that holds up

How I build retrieval-augmented generation, vector search, fine-tuned small language models and tool-calling agents for clients: the pipeline, the controls, and how each one is evaluated.

Anatomy of a RAG pipeline

The path a question takes from your documents to a grounded answer.

live flow
chunk overlaptop-krecall@kcross-encodercitationsrefusal policy
Retrieval-Augmented Generation

RAG Systems

I build assistants that retrieve relevant information, cite their sources and flag questions the available evidence cannot answer. That means the whole path: ingestion, chunking, hybrid retrieval, reranking and grounding, with recall measured against a golden set rather than judged by impression.

  • Hybrid search: BM25 keyword + dense vector recall
  • Semantic and recursive chunking with overlap tuning
  • Cross-encoder reranking for precision at the top
  • Citation spans, plus a check that the cited text exists in the source
  • Query rewriting, HyDE and multi-query expansion
LangChainLlamaIndexHybrid searchReranking
Semantic representation

Embeddings

Retrieval quality is decided long before the LLM is called. I choose and evaluate embedding models, tune chunk geometry, and measure recall on real queries rather than guessing.

  • Model selection across dimensions and cost tiers
  • Multilingual and domain-adapted embeddings
  • Chunk size, overlap and metadata design
  • Recall@k evaluation against golden query sets
  • Semantic caching and deduplication
OpenAICohereBGEE5Matryoshka
Search infrastructure

Vector Databases

Running vector search in production means index tuning, metadata filtering and honest latency budgets. I ship it on Postgres when that is enough, and on a dedicated engine when it is not.

  • pgvector, Pinecone, Qdrant, Weaviate and Chroma
  • HNSW and IVF-Flat index tuning for recall vs latency
  • Metadata filtering and multi-tenant isolation
  • Sharding, replication and re-index strategies
  • Cost modelling per million vectors
pgvectorQdrantPineconeHNSW
SLM fine-tuning & serving

Small Language Models

Not every task needs a frontier model. On narrow, high-volume work a fine-tuned 3B–7B model can cut cost and latency sharply where an eval set shows quality holds, and it can run on your own hardware.

  • LoRA / QLoRA fine-tuning on curated datasets
  • 4-bit and 8-bit quantization (GGUF, AWQ)
  • vLLM serving with continuous batching
  • On-prem and edge deployment for data residency
  • Confidence-based routing to larger models
QLoRAvLLMGGUFDistillation
Agents that transact

Agentic Commerce

Commerce is moving from pages to agents. I build the tool layer for catalogue, cart and checkout, so an agent can complete a purchase safely with a human in the loop where it counts.

  • MCP servers exposing storefront capabilities as tools
  • Tool-calling agents for discovery, cart and checkout
  • Agent-readable catalogues and structured product feeds
  • Guarded payment steps with explicit confirmation
  • Headless storefront and payment-gateway integrations
MCPTool callingCatalogueCheckout
Making it trustworthy

Agents, Evals & Guardrails

Demos are easy; reliability is the work. Multi-agent graphs with typed handoffs, golden-set evaluation on every change, and guardrails against injection, leakage and quiet regressions.

  • Planner / executor and multi-agent graphs
  • Golden datasets and LLM-as-judge scoring
  • Prompt-injection and PII guardrails
  • Tracing, replay and token-cost observability
  • Human-in-the-loop approval gates
LangGraphEvalsTracingGuardrails

What these systems do not do

  • They do not guarantee correctness. Retrieval can miss, and a model can still phrase something badly. That is why answers carry citations and a refusal path.
  • They do not replace a domain expert. In regulated areas the output is information, reviewed by a person who is accountable for the decision.
  • They are not evaluated on impressions. Recall is measured against a golden set of real queries before a change ships.
  • They do not run unattended where an action is hard to reverse. Payments, deletions and anything regulated go through explicit confirmation.

The AI stack

AI Engineering

RAG pipelinesEmbeddingsVector searchSLM fine-tuningLoRA / QLoRAAgent orchestrationTool calling / MCPPrompt engineeringEvals & guardrails

Vector & Data

pgvectorPineconeQdrantWeaviateChromaElasticsearchMySQLPostgreSQLRedis

Shipped AI work

Considering something similar? Tell me what the system needs to do.

Discuss your project