Connecting to Nautobot¶
NautobotGPT can connect directly to your Nautobot instance, allowing you to query your live network data using natural language. Instead of writing GraphQL queries or navigating the Nautobot UI, you can simply ask NautobotGPT questions like:
- "How many devices are at the NYC location?"
- "Show me all interfaces on device
core-rtr-01" - "List all prefixes in the
Productionstatus" - "What device types do we have from Cisco?"
The Nautobot Query Agent translates your natural language questions into queries, executes them against your Nautobot instance, and returns the results in a conversational format.
Note: This agent is only available to Nautobot Cloud customers.
Prerequisites¶
Before configuring the connection, you will need:
- A Nautobot Cloud instance
- An account in Nautobot with an API token to use (preferably a read-only service account)
Configuration¶
The Nautobot connection is configured through the Nautobot Cloud Console by setting two environment variables for your NautobotGPT instance:
| Variable | Description | Example |
|---|---|---|
NAUTOBOT_BASE_URL |
The base URL of your Nautobot instance | https://nautobot.yourcompany.com |
NAUTOBOT_API_TOKEN |
The API token for a Nautobot account | aaaaaaaaaa... |
To configure these:
- Log in to the Nautobot Cloud Console
- On the left sidebar under
Manage, clickNautobotGPT - Click on your NautobotGPT instance, and go to the
Settingstab - Click
+ Add Another Environment Variableand add the following variables:- Set
NAUTOBOT_BASE_URLto your Nautobot instance URL (e.g.,https://nautobot.yourcompany.com) - Set
NAUTOBOT_API_TOKENto the API token from the read-only service account you created
- Set
- Click
SavethenUpdate Nowto apply the changes
Using the Nautobot Query Agent¶
Once configured, NautobotGPT will automatically route data-related questions to the Nautobot Query Agent. You don't need to do anything special — just ask your question naturally.
Example Queries¶
Querying device information
"Show me all devices at the NYC data center with their roles and statuses"
Exploring your data model
"What fields are available on the Device model in my Nautobot?"
Aggregating data
"How many active interfaces does each core router have?"
Investigating relationships
"Which VLANs are assigned to interfaces on device dist-sw-01?"
The Nautobot Query Agent will construct the appropriate query, execute it against your Nautobot instance, and present the results in a readable format. If the query returns a large number of results, NautobotGPT might summarize the data and highlight key findings.
Troubleshooting¶
NautobotGPT is not querying my Nautobot instance¶
- Verify that both
NAUTOBOT_BASE_URLandNAUTOBOT_API_TOKENare set correctly in the Cloud Console - Check that the API token is valid and has not expired
Queries return permission errors¶
- Verify that the service account has read permissions for the objects you are trying to query
- Check that the API token belongs to the correct service account
For any issues, contact Network to Code Support.