Ai Agents#

What is an Agent?#

Deployed Dill Agent#

Imagine Deployed Dill receives a command, such as:
“Dill, please book me a flight to Italy.”

Deployed Dill Agent#

Imagine Deployed Dill receives a command, such as:
“Dill, please book me a flight to Italy.”

Because Dill understands natural language,it immediately grasps the request.

Reason and Plan#

Before acting, Dill begins reasoning and planning, identifying the necessary steps and tools it needs to:

  • Check available flights

  • Compare prices and times

  • Select the best option

  • Book the flight

  • Send the confirmation

Use Tools#

With a clear plan in mind, Dill takes action.
It uses tools available to it, like:

  • Flight search APIs

  • Booking services

  • Email tools

Dill uses the flight search tool to find the best options, then completes the booking on the selected airline’s platform.

Complete the Task#

Finally, Deployed Dill sends us the confirmation email and itinerary.

Agents Components#

The Brain (Ai Models):

  • Handles reasoning, planning

  • Decide Actions based on the situation.

  • Uses tools to complete tasks.

The Body (Capabilities and tools)

  • Provides the necessary tools for the agent to act.

Reasoning, Planning and Actions#

Ai Agents Workflow#

Agents work in a continuous cycle of thinking(Thought) –> acting (Act), and observing (Observe).

  1. Thought: The LLM part of the Agent decides which step to take

  2. Act: The Agent uses the tools available to it to perform the action

  3. Observe: The model reflect on the response from the tool

Ai Agents Workflow#

Agents work in a continuous cycle of thinking(Thought) –> acting (Act), and observing (Observe).

  1. Thought: The LLM part of the Agent decides which step to take

  2. Act: The Agent uses the tools available to it to perform the action

  3. Observe: The model reflect on the response from the tool

The rule are embedded directly in the prompt:

You are a helpful AI assistant. Your task is to answer user questions.  You have access to the following tools:

{tools}
Use the following format:

Question: the input question you must answer
Thought: you should always think about what to do
Action: the action to take, should be one of [{tool_names}]
Action Input: the input to the action
Observation: the result of the action
... (this Thought/Action/Action Input/Observation can repeat N times)
Thought: I now know the final answer
Final Answer: the final answer to the original input question

Begin!
Question: {input}
Thought:{agent_scratchpad}'

Ai Agent Conclusion#

PROS:#

  • Advanced Reasoning and Language Understanding

  • Autonomous Task Completion

  • Tool Use Integration

CONS#

  • Limited generalization to complex tasks

  • Security and Safety Risks