AI Engineering
Learn LLMs, RAG, agents, secure tools, and production AI through practical insurance examples.
Virtual environments, pip, and project structure
A virtual environment isolates a project's Python packages. pip installs packages into the selected environment. Project structure separates API routes, business services, adapters, and tests so the AI code does not become one notebook-sized script.
Async/await, type hints, and HTTP clients
Python async def creates a coroutine function; await lets other work proceed while an awaitable operation waits. Type hints describe expected inputs and outputs for developers and type checkers. HTTP clients such as HTTPX provide asynchronous requests,…
Pydantic and FastAPI
Pydantic validates data against Python model definitions. FastAPI uses declared routes and schemas to build HTTP services with validation and API documentation. Think of Pydantic as a role similar to Zod and FastAPI as a Python web framework with typed…
Basic NumPy, Pandas, and Jupyter
NumPy provides efficient numerical arrays and vector operations. Pandas provides table-like data structures for cleaning and analyzing datasets. Jupyter provides interactive notebooks that mix code, results, and explanations.
Embeddings, vectors, dimensions, and semantic similarity
An embedding is a list of numbers representing useful features of content, often its meaning. That list is a vector; its number of entries is its dimension. Semantic similarity means closeness in meaning, such as “car accident” and “vehicle collision,” even…
Similarity and cosine similarity
Similarity measures how close two vectors are according to a selected metric. Cosine similarity compares their direction, effectively asking whether they point in a similar direction regardless of magnitude. Dot product and Euclidean distance are other common…
Embedding models, generation, storage, and limitations
An embedding model creates vectors; an embedding pipeline manages generation, versions, and storage. An embedding is a derived index representation, not a replacement for the original text. Different models, dimensions, or preprocessing choices can produce…
Vector databases, vector search, and semantic search
A vector database stores vectors and supports similarity queries with metadata. Vector search is the numerical operation; semantic search is the application goal of finding meaningfully related content. Existing databases can also add vector indexes, so you…
Keyword search and BM25
Keyword search matches words or indexed terms rather than learned meaning. BM25 is a common relevance formula that rewards useful matching terms, accounts for document length, and avoids letting repeated words dominate indefinitely. It is usually implemented…
Hybrid search and metadata filtering
Hybrid search combines lexical and semantic candidate retrieval. Metadata filtering narrows records by explicit attributes such as tenant, policy version, date, or region. Filtering answers “which records are eligible,” while ranking answers “which eligible…
Reranking
Reranking is a second ranking stage that examines a short candidate list more carefully. A reranker often reads the query and each candidate together, allowing richer comparison than separate embeddings. It changes candidate order; it cannot recover a…
Choosing a vector/search store
Pinecone, Qdrant, Weaviate, pgvector, MongoDB Vector Search, Elasticsearch, and OpenSearch provide different ways to store and retrieve vector-backed knowledge. Some are dedicated vector services; others extend databases or search engines you may already…
RAG: three levels of understanding
RAG stands for retrieval-augmented generation. It retrieves relevant external information and provides that information to a model before asking for an answer. It connects language generation to a changing knowledge source without retraining the model.
Document ingestion, PDF processing, and parsing
Ingestion is the pipeline that turns approved source files into searchable records. Parsing extracts text and structure; PDFs may contain actual text, scanned images, tables, or all three. OCR, optical character recognition, converts image-based letters into…
Chunking, chunk size, overlap, and metadata
Chunking divides documents into retrieval-sized pieces. Chunk size controls how much content each piece contains; overlap repeats a small amount at boundaries. Metadata identifies the piece's source, permissions, version, and other useful attributes.
Retrieval, context construction, and prompt construction
Retrieval selects candidate evidence. Context construction chooses which evidence and conversation details the model sees. Prompt construction combines trusted instructions, the user's question, and clearly labeled untrusted source material.
Citations and source attribution
A citation points to evidence supporting a statement. Source attribution identifies the original document, location, and version. The model can suggest references, but the application must ensure they map to actual retrieved sources.
Query rewriting, multi-query retrieval, and query decomposition
Query rewriting restates a request for search, often resolving references from conversation. Multi-query retrieval searches alternative formulations. Query decomposition splits a compound question into smaller questions that may require separate evidence.
Difficulty is an editorial estimate. Completion means you chose to mark a question as understood.