Introduction to AI Agents
Almost everyone is rely on Large Language Models(LLMs) nowadays. Simply it is capable of providing answers for anything. (Yeah I know they might hallucinate sometime).
Okay then why we need AI agents? Let’s go through the following scenario.
As you can see LLM are not able to perform actions. (Yeah they can think and provide answers)
What are AI Agents?
So now you can guess what are these AI agents are. Yes, You can define AI agents are as Autonomous LLMs which can think and act.
95% of the time, every new concept is just an old idea reintroduced with a new name
How AI Agents are working?
Let me give you an example. Think that you need to go to Sigiriya (Tourist Location at Sri Lanka) and also need to reserve a Hotel. How you are doing it?
- You will contact the Airline to book a ticket
- You will book a hotel room
- You will book a cab from Air port to Hotel etc
AI agents are not a new thing. It is automating tasks with the power of LLM to do the above with AI.
Every AI agent has set of tools that they can use. Once you given a task it will seek knowledge from the LLM how to execute task and it identifies the tools that agent needs to use and execute tasks one by one.
There are different patterns of AI Agents which will be covered in next blog.
Different Frameworks
There are different frameworks that can be used to develop AI agents which are,
- LangGraph — https://www.langchain.com/langgraph
- Phidata — https://www.phidata.com/
- CrewAI — https://www.crewai.com/
- Microsoft Auto Gen — https://www.microsoft.com/en-us/research/project/autogen/
Simple AI agent implementation
Following AI agent will fetch GitHub issues for the given repository. Which need a model, instructions and relevent tools.
from phi.agent import Agent
from phi.tools.github import GithubTools
agent = Agent(
instructions=[
"Use your tools to answer questions about the repo: phidatahq/phidata",
"Do not create any issues or pull requests unless explicitly asked to do so",
],
tools=[GithubTools(base_url="enter_base_url_here")],
)
agent.print_response("List open pull requests", markdown=True)
Following is the reference of the above implementation.
This is the first part of AI Agents which provides comprehensive tutorial series of how AI Agents can developed. Hope you got the basic understanding of how AI Agents are working. In next blogs we can go though, different architectures, implmentations etc.
If you have found this helpful please hit that 👏 and share it on social media :).