Skip to content
2 min read · 328 words

Module 3: Services Deep Dive

**Intermediate**  ·  **~40 min**  ·  **5 lessons**

Overview

Module 2 gave you the map; this module is the territory. Every one of the five services gets a dedicated, line-by-line lesson — including the two that a prior draft of this course left completely uncovered: document_service.py (chunking, embeddings, ChromaDB writes) and rag_graph_service.py (the one real LangGraph StateGraph in this codebase).

What You'll Learn

  • Every function in openai_service.py: chat completion, email analysis, RAG answers, retrieval evaluation
  • The token/cost estimation math behind every ToolCall row
  • The three-agent email pipeline: analysis → reply → review, and how it differs from a LangGraph workflow
  • The character-based chunking algorithm, embedding calls, and ChromaDB writes behind document ingestion
  • The Corrective RAG StateGraph: four nodes, one conditional edge, and why the branch exists at all

Prerequisites

Lessons in This Module

#LessonWhat it covers
08aOpenAI ServiceChat, email analysis, RAG answers, retrieval evaluation
08bMonitoring ServiceToken estimation and cost calculation
08cMulti-Agent EmailThe three-agent sequential pipeline
08dDocument ServiceChunking, embeddings, ChromaDB writes
08eRAG Graph ServiceThe one real LangGraph StateGraph, node by node

Learning Outcomes

By the end of this module you can:

  • List all six system prompts in this codebase and which ones expect JSON back
  • Explain the character-based chunking algorithm's overlap math by hand
  • Draw the Corrective RAG graph from memory: nodes, edges, and the one conditional branch
  • State precisely why the email workflow is not LangGraph, and what the actual difference is in code

Start Module → Back to Module 2