ProjectIntent Over Keywords: From Stitched Embeddings to a Production Fashion Agent · Module 19: Tracing with Langfuse and OpenTelemetry · part 21 of 26
Part 21 · Module 19: Tracing with Langfuse and OpenTelemetry
Module 19: Tracing with Langfuse and OpenTelemetry
21 min read·
About 45 minutes · Needs: Module 12 (high-level design: the graph and its routes), Module 14 (the planner), Module 16 (the implementer), Module 17 (the generator) · Code: part3-styleme/backend/src/styleme/tracing.py, part3-styleme/backend/src/styleme/agent/graph.py, part3-styleme/backend/src/styleme/llm.py, part3-styleme/backend/src/styleme/logging_setup.py, part3-styleme/backend/tests/test_tracing.py
Where this fits
This module (blue): the optional Langfuse tracing around the planner, the implementer and the generator. Blue marks our own code in every figure.
A StyleMe search turn makes three Gemini calls in a row: the planner, one batched embedding, the generator. When a shopper says "it gave me sarees when I asked for juttis", the reply alone cannot tell you which step went wrong. This module adds the record of each turn: one trace per chat turn with the three nodes and every model call inside it, plus structured logs that carry the same request and session ids. Tracing is optional; without Langfuse keys the app runs exactly the same.
The rest of this project is yours to keep
This project is bought on its own, once, and stays readable afterwards, including the parts added to it later.