Skip to content

About

Advanced Topics in Analytics II - Generative AI: RAG, MCP, and agents with LangChain & LangGraph

Topics

Resources

Stars

8 stars

Watchers

0 watching

Forks

Repository files navigation

Advanced Topics in Analytics II - Generative AI

Status: Course proposal · In development. Proposed for Pontificia Universidad Javeriana. Approval, delivery dates, and teaching hours are pending confirmation.

Instructor: Sergio A. Mora Pardo · sergioa.mora@javeriana.edu.co · GitHub

This course continues Advanced Topics in Analytics: students move from understanding language models to building applications with them. Over 12 weeks they design, connect, evaluate and deploy LLM applications with LangChain, LangGraph, RAG, the Model Context Protocol (MCP), LangSmith and OpenEvals, and learn when a direct API call is enough.

Every example shares one case: ACME, a fictional fintech whose support assistant answers from its policies with citations, looks up the credit portfolio through tools and hands money movements to a person. All data and documents are synthetic.

Learning outcomes

By the end of the course you will be able to:

  • Connect language models to documents, data and tools, and answer with citations.
  • Choose and build workflows with state, memory, specialists and human approval, and explain why a pattern fits better than a simpler one.
  • Evaluate answers and agent behaviour with datasets, code evaluators and an LLM judge calibrated against human review, comparing quality, cost and latency.
  • Deploy an assistant as an API with persistent memory, diagnose its failures and evaluate changes again before shipping them.

Three guides go with the schedule: agentic patterns compares the workflow structures and when to use each, readings lists book chapters and code for every week, and the demo guide walks through the week 12 API.

Schedule

Draft sequence of 12 weekly sessions. Calendar dates will be added once the course is approved and scheduled.

1. Foundations with LangChain · weeks 1–3

Week Session Notebooks Presentation
1 Messages, templates, structured output and streaming L01 · LangChain step by step
L02 · Structured output
W01 · LangChain
2 Dynamic prompts with Jinja, schemas and traces L03 · Dynamic prompting W02 · Jinja
3 Tools, a first agent and an external API L04 · Tools
L05 · Tools with an external API
W03 · Tools

2. RAG and evaluation · weeks 4–6

Week Session Notebooks Presentation
4 Embeddings, vector stores and answers with citations L06 · Embeddings
L07 · FAISS and Chroma
L08 · RAG with citations
W04 · RAG
5 Follow-up questions, multi-query, retrieval metrics and memory L09 · Conversational RAG
L10 · Memory with an agent
W05 · Conversational RAG
6 Datasets, code evaluators and a calibrated LLM-as-judge L11 · RAG evaluation W06 · Evaluation

3. Model Context Protocol · week 7

Week Session Notebooks Presentation
7 Building MCP servers and an agent that uses them L12 · MCP server
L13 · Agent with MCP tools
W07 · MCP

4. LangGraph and agentic patterns · weeks 8–11

Week Session Notebooks Presentation
8 State, prompt chaining, routing and parallelization L14 · LangGraph in Studio
L15 · Simple graph
L16 · Messages
L17 · Chaining
L18 · Routing
L19 · Parallelization
W08 · LangGraph
9 Human-in-the-loop: persistence, approval and resumption L20 · Human-in-the-loop W09 · Human-in-the-loop
10 Orchestrator-workers and subgraphs L21 · Orchestrator W10 · Orchestrator
11 Evaluator-optimizer L22 · Evaluator-optimizer W11 · Evaluator-optimizer

5. LLMOps and deployment · week 12

Week Session Notebooks Presentation
12 The ACME assistant as an API with persistent memory Local support chat API W12 · Deployment

Proposed evaluation: 50% project · 40% exercises · 10% class participation.

Getting started

You need Python 3.12 with uv, an Anthropic API key (Claude Haiku is the default model), a LangSmith key for tracing and evaluation (tracing stays off unless you enable it) and Docker only for the PostgreSQL examples. Follow SETUP.md to install the environment and configure your keys.

The notebooks are versioned executed, so their outputs and diagrams can be read on GitHub before running anything. After editing one, refresh its Mermaid diagrams (no model calls) or rerun it against Claude Haiku with tests/run_notebooks.py:

uv run python tests/run_notebooks.py diagrams L08-RAG.ipynb
uv run python tests/run_notebooks.py execute L08-RAG.ipynb   # spends tokens

Local support chat API

The FastAPI demo serves the ACME support agent (src/agents/acme.py) with PostgreSQL checkpoints. It joins cited search over the policies (week 4), the read-only credit portfolio of the MCP server (week 7) and memory per conversation (week 5). Set DB_URI in .env as in .env.example, then:

uv sync --locked --no-dev
docker compose up -d postgres
uv run --no-sync uvicorn api.main:app --host 127.0.0.1 --port 8000

curl http://127.0.0.1:8000/chat/demo-thread \
  -H 'Content-Type: application/json' -d '{"message":"Soy el cliente C-3307, ¿cuánto tengo vencido?"}'
curl -N http://127.0.0.1:8000/chat/demo-thread/stream \
  -H 'Content-Type: application/json' -d '{"message":"¿Y todavía puedo reestructurarlo?"}'

Reuse a chat_id to continue a conversation, even after restarting the API; the stream endpoint sends SSE data: events and hides tool output. The demo guide explains each turn, its model calls, a test script and how to diagnose errors. Endpoint schemas are at http://127.0.0.1:8000/docs, and docs/sql/checkpoints.sql inspects the saved threads. This is a local teaching demo without authentication: keep it on loopback. Each turn calls a paid model, and the first policy search downloads the local embeddings model (~220 MB). docker compose down keeps the postgres_data volume.

Repository

  • LangGraph Studio: uv run langgraph dev opens the graphs in langgraph.json, including acme and the single-file (contact) and modular (support) versions of the same contact agent.

  • Claude Code: nine skills in .claude/skills/, named <area>-<capability> with five areas (llm, agentic, mcp, eval, ops), one responsibility each:

    Skill Builds or does Weeks
    /llm-prompts A fixed-step chain: chat or Jinja template, structured output 1–2
    /llm-tools A tool agent: read-only tools, a public API, MCP tools with elicitation 3, 7
    /llm-rag RAG with [file, p. N] citations, FAISS or Chroma, follow-up rewriting and multi-query 4–5
    /agentic-memory Memory per conversation and human approval before an action 5, 9
    /eval-experiments Datasets, code evaluators, a calibrated judge and experiments, including agents' tool calls and routes 6, 11
    /mcp-server MCP servers, and a review of third-party ones 7
    /agentic-patterns LangGraph workflows: chaining, routing, parallel branches, orchestrator-workers, evaluator-optimizer 8–11
    /ops-traces Reads what a run left in LangSmith: traces, calls, latency, cost, branches, errors 6–12
    /ops-deploy Serves an app as an API with persistent threads and streaming 12

    The W11 and W12 presentations use earlier names: agent-patterns is now agentic-patterns, and deploy-app is ops-deploy; agentic-workflow was split into the llm-* skills and agentic-memory, and evaluate-app is eval-experiments. Hooks in .claude/settings.json check Jinja templates, apps and MCP servers without calling a model; .mcp.json registers the course servers.

  • Guides: agentic patterns, readings by week and the API demo.

  • Tests and CI: the tests run offline, simulating model responses. GitHub Actions requires unit-tests and langgraph-startup before merging into main; the quality job runs pre-commit hooks, Bandit and the package build, and reports coverage, Ruff, mypy and pip-audit as advisory. Dependabot proposes weekly updates; see dependency maintenance.

uv sync --locked --dev --group quality
uv run --no-sync python -m pytest -q                              # offline tests
uv run --no-sync python .github/scripts/check_langgraph_startup.py
uv run --no-sync pre-commit run --all-files

Interest links 🔗

LangChain · LangGraph · LangSmith · OpenEvals · Model Context Protocol · Anthropic, Building effective agents · DeepLearning.AI short courses

About

Advanced Topics in Analytics II - Generative AI: RAG, MCP, and agents with LangChain & LangGraph

Topics

Resources

Stars

8 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages