Huggingface agents
- What is an Agent, and how does it work?
- How do Agents make decisions using reasoning and planning?
- How LLMs serve as the “brain” behind an Agent.
- How LLMs structure conversations via the Messages system.
- How Agents use external tools to interact with the environment.
- How to build and integrate tools for your Agent.
Think → Act → Observe.
An Agent is a system that leverages an AI model to interact with its environment in order to achieve a user-defined objective. It combines reasoning, planning, and the execution of actions (often via external tools) to fulfill tasks.
This is where all the thinking happens. The AI model handles reasoning and planning. It decides which Actions to take based on the situation.
This part represents everything the Agent is equipped to do.
The scope of possible actions depends on what the agent has been equipped with. For example, because humans lack wings, they can’t perform the “fly” Action, but they can execute Actions like “walk”, “run” ,“jump”, “grab”, and so on.
The most common AI model found in Agents is an LLM (Large Language Model), which takes Text as an input and outputs Text as well.
Well known examples are GPT4 from OpenAI, LLama from Meta, Gemini from Google, etc. These models have been trained on a vast amount of text and are able to generalize well. We
will learn more about LLMs in the next section.
- Implement and modify the Thought → Act → Observe cycle to create robust and maintainable Function-calling workflows.
To summarize, an Agent is a system that uses an AI Model (typically an LLM) as its core reasoning engine, to:
-
Understand natural language: Interpret and respond to human instructions in a meaningful way.
-
Reason and plan: Analyze information, make decisions, and devise strategies to solve problems.
-
Interact with its environment: Gather information, take actions, and observe the results of those actions.
Now that you have a solid grasp of what Agents are, let’s reinforce your understanding with a short, ungraded quiz. After that, we’ll dive into the “Agent’s brain”: the LLMs.
