Get Started with the Agent Memory APIs
- how-to
To get started with the Couchbase Capella APIs for Agent Memory, you must create an API key. An API key authenticates and authorizes you to access the APIs.
This page is for Agent Memory in Capella. It covers the Agent Memory features in the Management API, and the Agent Memory API. For more information about the Management API for Capella Operational features, see Get Started with the Capella Operational Management API.
This page describes how to manage:
Use the Management API to deploy and manage Agent Memory servers and Agent Memory API keys. Use the Agent Memory API to store and retrieve memory on your Agent Memory server.
Management API Keys
To create an initial bootstrap API key to access the Management API, you must use the Capella UI. Once you have created an initial bootstrap API key, you can use the Management API itself to create further API keys.
Understand Management API Keys
Each API key for the Management API has the following characteristics:
-
API keys are associated with Couchbase Capella roles and permissions.
-
Every API key has an expiration date.
-
Every API key is associated with an allowed IP address list.
Organization Roles and Project Access
Each API key is associated with 1 or more organization roles, which determine the privileges that the API key has within the organization. For more information about organization roles, see Organization Roles.
Each API key may have access to 1 or more projects, depending on the organization role. For each project, each API key is associated with 1 or more project roles, which determine the privileges that the API key has within each project. For more information about project roles, see Project Roles.
You can create an API key at the organization or a project level:
-
When you create an API key at the organization level, you may specify the organization roles for the API key, which projects the API key is associated with, and the project roles for the API key within each project.
-
When you create an API key at the project level, the API key has the
Organization Memberrole for the organization containing the project, and has access to the project where you created it. You may specify project roles for the API key within that project.
An API key must have the appropriate Capella roles to access an endpoint. The Management API reference guide lists the roles that are needed for each endpoint.
Expiration
By default, each API key expires 180 days after creation. You can specify a different expiration, or specify that the API key does not expire. For security, create new API keys regularly and let old API keys expire after transitioning to the new keys.
IP Access
By default, when you first create an API key, you can use that API key to access the Management API from any IP address. For security, each API key should only be able to access the Management API from specific IP addresses.
For each API key, you can grant access from:
-
Individual IP addresses in IPv4 format.
-
Blocks of IP addresses in IPv4 format using CIDR notation.
Display Management API Keys
You can display Management API keys within an organization or within a project. By default, there are no API keys for the Management API.
-
Organization Level
-
Project Level
To display Management API keys within an organization:
-
In the Capella UI, click your initials.
-
Click Organizations.
-
Select the organization you want to create API keys for.
-
Go to .
To display Management API keys within a project:
-
In your organization, go to Projects.
-
Select the project you want to create API keys for.
-
Go to .
Generate Management API Keys
You can generate Management API keys within an organization or within a project.
-
Organization Level
-
Project Level
To generate a Management API key at the organization level:
-
Display the list of Management API keys within the organization.
-
Click Generate Key.
-
In the Key Name field, enter a name for the API key.
-
(Optional) In the Description field, enter a description of the API key.
-
In Organization Roles, select 1 or more organization roles for the API key.
-
If the API key has the
Organization Memberrole, configure the projects that the API key can access:-
Click Configure Project Access.
-
Enable the projects you want the API key to access, or click Select all.
-
For each project which the API key can access, select 1 or more project roles for the API key.
-
Click Save.
-
-
In Key Expiration, accept the default expiration, change the expiration, or specify that the key should not expire.
-
In Allowed IP Addresses, click Added Allowed IP Address to specify IP access for the API key.
-
Select 1 of the following options:
-
To allow a specific IP address or block, in the Add IP / CIDR Block field, enter the IP address or CIDR notation.
-
To add your current IP address block, click Add Current IP Address.
-
-
Click Add.
-
When you’re ready, click Generate Key.
The Capella UI shows the new API key ID and the new API key token. The API key token is hidden to prevent others reading it.
You must copy or download the API key token now. When you leave this page, you will not be able to copy or download the API key token again. -
To download the API key token, click Download Key. The key is saved by your browser in a file called
<name>-api-key-token.txt, where<name>is the name of the API key. -
To copy either the API key ID or the API key token to the clipboard, click the copy icon () next to the field.
To generate a Management API key at the project level:
-
Display the list of Management API keys within the project.
-
Click Generate Key.
-
In the Key Name field, enter a name for the API key.
-
(Optional) In the Description field, enter a description of the API key.
-
In Roles, select 1 or more project roles for the API key.
-
In the Key Expiration, accept the default expiration, change the expiration, or specify that the key should not expire.
-
In Allowed IP Addresses, click Added Allowed IP Address to specify IP access for the API key.
-
Select 1 of the following options:
-
To allow a specific IP address or block, in the Add IP / CIDR Block field, enter the IP address or CIDR notation.
-
To add your current IP address, click Add Current IP Address.
-
-
Click Add.
-
When you’re ready, click Generate Key.
The Capella UI shows the new API key ID and the new API key token. The API key token is hidden to prevent others reading it.
You must copy or download the API key token now. After leaving this page, you cannot copy or download the API key token. -
To download the API key token, click Download Key. The key is saved by your browser in a file called
<name>-api-key-token.txt, where<name>is the name of the API key. -
To copy either the API key ID or the API key token to the clipboard, click the copy icon () next to the field.
View Management API Keys
To view details of a Management API key:
-
Display the list of Management API keys within an organization or within a project.
-
Click the name of the API key.
The details of the API key are displayed: the name, description, organization roles, expiration, allowed IP addresses, and project access.
Delete Management API Keys
To delete a Management API key:
-
Display the list of Management API keys within an organization or within a project.
-
Next to the API key you want to delete, click the trash can icon ().
-
In the confirmation dialogue, confirm that you want to delete the API key.
-
Click Delete.
Agent Memory API Keys
To create an initial bootstrap API key to access the Agent Memory API, you can use the Capella UI or the Management API.
Prerequisites
To view, create, and delete Agent Memory API keys, you must have 1 of the following roles:
To view Agent Memory API keys, you can also have the Cluster Manager or Cluster Viewer project role.
These roles cannot create or delete API keys.
View Agent Memory API Keys
To display your Agent Memory API keys:
-
In the Capella UI, go to .
-
Select the Agent Memory tab.
By default, there are no Agent Memory API keys.
Generate Agent Memory API Keys
| You can only generate an API key for an Agent Memory server that has finished deploying. |
To generate an Agent Memory API key:
-
In the Capella UI, choose 1 of the following options:
-
Go to .
-
Go to .
-
Access Control
-
Agent Memory
-
Select the Agent Memory tab.
-
Click Generate API Key.
-
In the Agent Memory list, select the Agent Memory server for this API key.
-
Next to your Agent Memory server, click .
-
-
In the API Key Name field, enter a name for the API key.
-
In the Expiry list, accept the default expiration, change the expiration, or specify that the key should not expire.
-
(Optional) In the Description field, enter a description of the API key.
-
Under Access, select the access level for the API key. For more information, see Access Levels.
-
Click Generate API Key.
The Capella UI shows the new API key ID and the new API key token.
You must copy or download the API key token now. When you leave this page, you cannot copy or download the API key token again. -
To download the API key token, click Download Key.
-
To copy either the API key ID or the API key token to the clipboard, click next to the field.
Agent Memory Server Endpoint
The Agent Memory API uses your Agent Memory server’s endpoint as its base URL. The endpoint is unique to every Agent Memory server you deploy.
To copy your Agent Memory server endpoint, you can use the Capella UI or the Management API.
Prerequisites
To copy the endpoint, you must have a project role on the project that contains the operational cluster your Agent Memory server connects to.
Allowed IP Addresses for Agent Memory
For security, your Agent Memory server only accepts requests from IP addresses in its allowed IP address list. A new Agent Memory server has no allowed IP addresses, so it blocks all requests until you add at least 1. Allowed IP addresses apply to an Agent Memory server, not to an individual API key.
To add an allowed IP address, you can use the Capella UI or the Management API.
For each Agent Memory server, you can grant access from:
-
Individual IP addresses in IPv4 format.
-
Blocks of IP addresses in IPv4 format using CIDR notation.
You can add up to 50 allowed IP addresses to each Agent Memory server.
Prerequisites
To view, add, and delete allowed IP addresses for an Agent Memory server, you must have 1 of the following roles:
To view allowed IP addresses, you can also have the Cluster Viewer project role.
View Allowed IP Addresses
To display the allowed IP addresses for your Agent Memory servers:
-
In the Capella UI, go to .
-
Select the Agent Memory tab.
By default, there are no allowed IP addresses.
Add Allowed IP Addresses
To add an allowed IP address:
-
In the Capella UI, choose 1 of the following options:
-
Go to .
-
Go to .
-
Allowed IP Addresses
-
Agent Memory
-
Select the Agent Memory tab.
-
Click Add Allowed IP Address.
-
In the Agent Memory list, select the Agent Memory server.
You can only add allowed IP addresses to an Agent Memory server with a Healthy status.
-
Next to your Agent Memory server, click .
-
-
In the Select Allowed IP list, select 1 of the following options:
- Add IP Address Manually
-
Allow a specific IP address or CIDR block. Enter the IP address or CIDR block in the Allowed IP / CIDR Block field.
- Add Current IP Address
-
Allow your current IP address.
- Allow Access from Anywhere
-
Allow any IP address to access your Agent Memory server. In the confirmation dialog, enter
Yesand click Allow Access from Anywhere.
-
Click Add Allowed IP Address.
Next Steps
-
To make an API call, see Make an API Call with the Agent Memory APIs.
-
For a full reference guide for the Management API, see Couchbase Capella Management API Reference.
-
For a full reference guide for the Agent Memory API, see Agent Memory API Reference.
-
For a reference of the Management API and Agent Memory API errors, see The Agent Memory API Errors.