TechnologyJanuary 22, 2025

How to Create Your First AI Agent

How to Create Your First AI Agent

2025 is the year of AI agents. In this post, you’ll get a better understanding of what an agent is and how you can get started working with them.

What is an agent?

According to an October 2024 paper from Google, an AI agent is software that composes over 3 tiers:

  1. A large language model (LLM)
  2. A set of tools that it can invoke with agency
  3. An orchestration layer that manages the cyclical process of information intake, reasoning, and action execution

It’s characterized by this diagram:

Source: Google

Given an input query from a user, the agent runtime works to come up with the best possible answer and then returns it to the user. 

For the sake of brevity, we won’t go into the details of agentic architecture in this post; instead, we’ll provide a hands-on guide on how to implement this architecture to create a simple agent.

Creating an agent

Langflow is a low-code, visual development environment that treats agents as first-class citizens. To get started with agents in Langflow, sign up and create a flow using the “Simple Agent” template.

This should give you the beginnings of an agent. Let’s explore how this tracks with the definition of an agent above:

  • The flow contains an “agent” that serves as the agent runtime in the diagram and contains the orchestration layer
  • You can connect tools to the agent using tool inputs and outputs in Langflow, represented by cyan dots
  • The agent component in Langflow enables a choice of language model and language model vendor in its settings

The default “Simple Agent” template comes with a calculator and a web browser (URL component) plugged in. To use this, you’ll have to plug in an API key for your language model vendor.

When all relevant components are connected and with the API key in place, your agent comes alive. 

Solving real problems with agents

Given that the default template (Simple Agent) comes with a calculator and a URL attached, you can solve the real problem of in-time currency conversion. Specifically, your agent can:

  • Take an input query from a user like “convert 200 USD to INR”
  • Look up the current exchange rate using the URL component as a tool
  • Perform the currency conversion using the calculator tool
  • Check if the conversion was successful
  • Return the output to the user

Let’s give this a try in the playground.

In under two seconds, your agent can solve real-world problems with real world data.

Using an agent in your applications

Langflow flows are exposed via API and can be consumed by any other application: like web or mobile applications. To use this flow in your application, click on the API button.

You’ll have to generate an API key if you don’t already have one. Once you do, this flow can be run from any application via a network request.

Wrapping up

You just created our first AI agent—and you’re just getting started! There are many new questions and features to explore: how do we extend an agent’s knowledge? How might we perform tasks on behalf of users? Can we run agents locally?

Tune in on 𝕏 and Discord to continue the conversation.

Discover more
AgentsLangflow
JUMP TO SECTION

What is an agent?

Creating an agent

Solving real problems with agents

Using an agent in your applications

Wrapping up

One-Stop Data API for Production GenAI

Astra DB gives developers a complete data API and out-of-the-box integrations that make it easier to build production RAG apps with high relevancy and low latency.