
- Customer asks, “What is the baggage policy?” — this typically triggers RAG: retrieve relevant policy text from an indexed document (vector DB), inject it into the prompt, and generate an answer.
- Customer asks, “When is my flight expected to arrive?” — that requires current status from a flight-tracking API; the answer depends on live data, not the stored PDF.


- In LangChain, a tool is a configurable module that exposes some external capability to your chain.
- Tools can fetch live data, call APIs, run custom logic, or execute code in a runtime (for example, Python).
- Agents — autonomous components that plan and pick actions — depend on tools to perform operations that the LLM cannot do by generation alone.

- Wikipedia — fetch and summarize articles (Wikipedia)
- Web search — perform live internet queries
- YouTube — retrieve transcripts or summarizations (YouTube)
- Python runtime — run code for numerical computation or data processing (Python)
- Custom tools — wrappers for internal APIs or business logic


- Run complex simulations, perform statistical analyses, or generate structured outputs.
- Return results to the LLM for further reasoning or response composition.
- Wrap domain-specific functions as callable tools to preserve business logic and ensure repeatability.
- RAG: augment prompts with context retrieved from preprocessed, indexed data (vector databases, document stores). Best for static or slowly changing content (policies, manuals, archived logs).
- Tools: interact with live systems or perform computation that must occur at query time (APIs, streaming data, heavy algorithms).

- RAG is usually asynchronous and batch-driven: documents get vectorized over time, and retrieval happens during queries.
- Tools provide synchronous access to external capabilities and real-time data.
- For heavy computation or real-time decision-making, delegate to tools (e.g., a Python tool). For retrieving policy text or archived content, use RAG.
- Baggage policy → RAG (static documentation)
- Flight tracking → Tool (flight-tracking API / real-time data)

RAG is ideal for retrieving pre-indexed, relatively static content. Use tools when you need real-time data, live API calls, or external computation.
- We will demonstrate concrete tool implementations and how to wire them into LangChain chains.
- After the demos, we’ll dive into agents: how they plan, decide which tools to call, and orchestrate multi-step workflows.