# Day 13 - Feb 5 2026

Understand the difference between a passive Chatbot and an active Agent by implementing "Tool Calling."

### 1. Chatbot vs. Agent

* Chatbot: A closed system. It relies only on its training data. If you ask "What is the date?", it hallucinates because its training data is from the past.
* Agent: An open system. It has access to external "Tools" (functions). It can "reason" about which tool to use.

### 2. The Agent Loop (ReAct)

Most agents follow a loop called ReAct (Reason + Act):

1. Thought: "The user asked for math. I am bad at math, but I have a calculator tool."
2. Decision: "I will call `TOOL: CALC`."
3. Action: The Python script executes `eval(2+2)`.
4. Observation: The result is `4`.
5. Response: "The answer is 4."

### 3. Why this matters

This is how things like "ChatGPT Plugins" or "AutoGPT" work. They aren't magic; they are just LLMs instructed to output specific keywords (like `TOOL:`) which the code then intercepts and executes.

Status:

* [x] Defined "Tools" (Python functions)
* [x] Created "Router" Logic (LLM Decision Making)
* [x] Verified Autonomous Execution


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://shankar-lab.gitbook.io/mylearning/15-days-genai-learning-challenge/day-13-feb-5-2026.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
