Lab 04
Physical twin of the lab pipe
Teaching map only. This playground uses langchain-core plus Ollama on localhost — no AWS keys, no hosted models, no prompts leave the machine.
Browser to edge, then named lab steps inside a region, then metrics and egress.
Browser
Edge
Region
LangChain physical architecture on AWS
LCEL pipe
Named hops, same order as the lab
metrics only
Browser
egress
The same twin, grouped the way the live Flow column lights.
The question enters a managed API, then a composed LangChain pipe. Twin of POST /labs/langchain/run.
LangChain’s lesson: retrieve | prompt | llm | parser. Each hop is a runnable you can swap. This is not a graph — it is a straight pipe.
A LangChain retriever is a runnable that returns documents. Locally: Chroma + Ollama embed. On AWS: Bedrock Knowledge Bases.
ChatPromptTemplate fills {question} and {context}. You can inspect the formatted string before it hits the model — that is the chain being honest.
The llm runnable. Locally Ollama via the provider seam (not a second Ollama client). On AWS: Bedrock Converse.
JsonOutputParser turns model text into {answer, grounded, sources}. If the model wanders, the parser fails closed and the lab still shows the raw string.
Return the parsed object and the intermediates. Metrics only — not the prompt body in logs.