Tutorial

LangBot Day 9: The RAG Pipeline — Retriever Meets Generator
reading time: 23 minutes

Recap: On Day 8, LangBot gained a long-term memory — a vector store (Pinecone) filled with document embeddings. You can ask /search home office stipend and get relevant chunks back. But that is half the picture. You still have to type /search, read raw chunks, and synthesize the answer yourself. Today we close the loop: the retriever feeds into the chatbot automatically, so you ask “How much is the home office stipend?” and LangBot answers from your documents — no slash command, no manual lookup.

LangBot Day 8: Retrieval — Vector Stores, Embeddings, and Pinecone
reading time: 29 minutes

Recap: On Day 7, LangBot learned to stream — token-by-token responses that feel like a real chat app. It remembers the conversation within a session (Day 2 memory), it has a personality (Day 3 prompt templates), it returns typed data (Day 5 structured output), it handles lists (Day 6 output parsers), and it streams those replies in real time (Day 7). But ask it anything outside its training data and it either guesses, hallucinates, or apologizes. Today we fix that by giving LangBot the ability to search external documents — the retrieval half of RAG.

LangBot Day 7: Streaming Output — Token-by-Token Responses
reading time: 20 minutes

Recap: On Day 6, LangBot gained output parsers and now responds in two modes — chat mode returns typed LangBotResponse objects with mood and confidence, and list mode returns clean list[str] via CommaSeparatedListOutputParser. Both modes use .invoke(), which means the entire response arrives at once after the model finishes generating. Today we fix that — LangBot learns to type its replies one token at a time.


The problem: waiting for the whole answer

Every interaction so far has the same rhythm:

LangBot Day 6: Output Parsers — Transforming Raw Responses into Usable Data
reading time: 20 minutes

Recap: On Day 5, LangBot started returning typed objects — every response is now a LangBotResponse with .message, .mood, and .confidence. That is great when you need structured metadata. But structured output is not always the right tool. Sometimes you just want a clean string. Sometimes you want a parsed list. Today we add output parsers — lightweight LCEL components that transform raw AIMessage output into exactly the shape you need.

LangBot Day 5: Structured Output — Typed Responses with Pydantic
reading time: 16 minutes

Recap: Yesterday we wired LangBot’s prompt and model into one pipeline with LCEL’s pipe operator — chain = prompt | llm. One invoke() call now handles everything from formatting to generation. But we still get back a raw AIMessage and have to reach into .content for the text. Today LangBot returns real typed objects.


The problem: unstructured mush

Every LLM response so far has been an AIMessage — a blob of text with no shape. To extract anything useful, you either parse it yourself or pray the model followed your formatting instructions. Both are fragile.