

# Building AI agents with Amazon Nova
<a name="agents"></a>

**Note**  
This documentation is for Amazon Nova Version 1. For information about how to build AI agents with Amazon Nova 2, visit [Building AI agents](https://docs.aws.amazon.com/nova/latest/nova2-userguide/building-ai-agents.html).

An AI agent helps your end-users complete actions based on organization data and user input. Agents orchestrate interactions between foundation models (FMs), data sources, software applications, and user conversations. In addition, agents automatically call APIs to take actions and invoke knowledge bases to supplement information for these actions. Developers can save weeks of development effort by integrating agents to accelerate the delivery of generative artificial intelligence (generative AI) applications .

With agents, you can automate tasks for your customers and answer questions for them. For example, you can create an agent that helps customers process insurance claims or an agent that helps customers make travel reservations. You don't have to provision capacity, manage infrastructure, or write custom code. Amazon Nova manages prompt engineering, memory, monitoring, encryption, user permissions, and API invocation.

For information on building AI agents in Amazon Bedrock, see [Bedrock Agents](https://docs.aws.amazon.com/bedrock/latest/userguide/agents.html).

Agents perform the following tasks:
+ Extend foundation models to understand user requests and break down the tasks that the agent must perform into smaller steps.
+ Collect additional information from a user through natural conversation.
+ Take actions to fulfill a customer's request by making API calls to your company systems.
+ Augment performance and accuracy by querying data sources.

**Topics**
+ [

# Using Amazon Nova as a foundation model in an AI agent
](agents-use-nova.md)
+ [

## Using Amazon Nova with AgentCore
](#agents-agentcore)
+ [

## Using Amazon Nova with Strands
](#agents-strands)
+ [

## Additional Resources
](#agents-resources)

# Using Amazon Nova as a foundation model in an AI agent
<a name="agents-use-nova"></a>

To use Amazon Nova models as the foundation model in an AI agent, you can use [Amazon Bedrock Agents](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-how.html) or you can [call a tool with the Converse API](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use-inference-call.html) or InvokeModel API. Amazon Bedrock Agents is a fully managed service that you can use to build and configure autonomous agents in your application. You can also use the converse API and Invoke model API to connect to other out-of-the-box agent frameworks or build your own agent framework.

You can use placeholder variables in agent prompt templates. The variables will be populated by pre-existing configurations when the prompt template is called. For information about these placeholder variables, see [Use placeholder variables in Amazon Bedrock agent prompt templates](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-placeholders.html).

**Topics**
+ [

## Using Amazon Nova with Amazon Bedrock agents
](#agents-bedrock)
+ [

## Using Amazon Nova with the Invoke and Converse API
](#agents-converse)

## Using Amazon Nova with Amazon Bedrock agents
<a name="agents-bedrock"></a>

Amazon Nova models are enabled in [Bedrock Agents](https://docs.aws.amazon.com/bedrock/latest/userguide/agents.html) and follow the user instructions of Amazon Bedrock Agents. Amazon Bedrock Agents is preconfigured with key features and prompts in order to work effectively with the Amazon Nova models. These configurations enable you to leverage key features of Amazon Bedrock Agents with minimal effort:
+ **Autonomous Agents**: Amazon Bedrock Agents allow for the creation of autonomous agents that can perform tasks based on user input and organizational data without requiring extensive custom coding. This can save you significant time and effort.
+ **Built-in API Invocation**: Amazon Bedrock Agents automatically handle API calls to fulfill user requests, which simplifies the integration of external services and data sources.
+ **Memory and Context Management**: Agents can maintain context, conversation and memory across interactions, allowing for more personalized and coherent conversations over time.
+ **Knowledge Base Integration**: You can associate a knowledge base with the agent to enhance its performance and accuracy, enabling it to provide more relevant responses based on stored information.
+ **Prompt Engineering and Customization**: Amazon Bedrock Agents support advanced prompt engineering, allowing developers to customize the agent's behavior and responses to better fit specific use cases.
+ **Code Interpreter:** The code interpretation enables your agent to generate, run, and troubleshoot your application code in a secure test environment.
+ **Multi-Agent Collaboration:** Build, deploy, and manage multiple AI agents working together on complex multi-step tasks that require specialized skills.

## Using Amazon Nova with the Invoke and Converse API
<a name="agents-converse"></a>

It's also possible to leverage [Tool use (function calling) with Amazon Nova](tool-use.md) with Invoke and Converse APIs to integrate Amazon Nova models with open source or build custom AI Agent frameworks. This allows for great flexibility but it's important to note that using the API directly means some aspects are left for your implementation or library to handle:

1. **Store Conversation/User Data**: The Converse API does not retain any user inputs or generated content, which means your agent cannot remember past interactions. You need to pass all the past messages every time you invoke the model.

1. **Automatic Tool Invocation**: You, as the developer, are responsible for implementing the tool based on the model's request. This means you need to execute or write the code that executes the tool's functionality and processes the input parameters provided by the model. After executing the tool, you must send the results back to the model in a structured format.

1. **Built-in Memory**: The API lacks built-in memory capabilities, meaning your agent cannot remember user preferences or past interactions over time, which could limit personalization.

## Using Amazon Nova with AgentCore
<a name="agents-agentcore"></a>

Amazon Nova models can be used with all Bedrock AgentCore services, enabling you to deploy and operate highly effective agents securely, at scale. Key Services include Runtime, Identity, Memory, Gateway, and Observability. See Amazon Bedrock AgentCore for additional details and \$1placeholder\$1 for sample code.

The following is an example of using Amazon Nova with AgentCore:

```
import boto3
from strands.models import BedrockModel

# Create a Bedrock model with the custom session
bedrock_model = BedrockModel(
model_id="model_id",
boto_session=session
)
```

## Using Amazon Nova with Strands
<a name="agents-strands"></a>

 Strands provides native support for Amazon Bedrock, allowing you to use these Nova models in your agents with minimal configuration. See Strands Amazon Bedrock for more details. 

The following is a code example showing how to use Strands with Amazon Nova:

```
from strands import Agent
from strands.models import BedrockModel

# Create a Bedrock model instance
bedrock_model = BedrockModel(
    model_id="us.amazon.nova-premier-v1:0",
    temperature=0.3,
    top_p=0.8,
)

# Create an agent using the BedrockModel instance
agent = Agent(model=bedrock_model)

# Use the agent
response = agent("Tell me about Amazon Bedrock.")
```

## Additional Resources
<a name="agents-resources"></a>

1. [Automate tasks in your application using agents](https://docs.aws.amazon.com/bedrock/latest/userguide/agents.html)

1. [Tool use (function calling) with Amazon Nova](tool-use.md)

1. [Text understanding prompting best practices](prompting-text-understanding.md)