A large language model (LLM) is trained on vast amounts of text to understand natural-language prompts and generate coherent text. It can answer questions, converse, and perform tasks by interpreting user intent. section 8.0
Use an LLM to:
- Answer general-purpose questions and power conversational applications such as a movie chatbot. section 8.1.1
- Use current information or complete tasks by calling external tools, services, protocols, and APIs. section 8.1.1
- Generate answers from context retrieved by vector similarity search in a retrieval-augmented generation (RAG) workflow. section 8.1 section 8.6.2
Movie question answering
Given the prompt “What are the other two movies produced by the studio that made Shrek?”, an LLM can identify DreamWorks Animation and respond with “Madagascar” and “Kung Fu Panda.” A RAG application can instead pass movie data retrieved from Postgres into the prompt before generating its answer. section 8.1.1 section 8.6.2
A practical integration connects an LLM through a provider API or local runtime. A LangChain OllamaLLM interface can invoke TinyLlama with a prompt containing the user question and retrieved context. Because LLMs are stateless, applications must store conversation history separately and pass it into later prompts. section 8.1.1 section 8.6.2
Figure 8.1 The LLM uses various tools to perform tasks following user prompts.
Shows how an LLM can combine user prompts with external tools to perform tasks before producing a response. section 8.1.1


































































