22.4 C
New York
Monday, September 8, 2025

Bringing Some Supply of Fact to Your NetAI Agentic Playground


Hey everybody, I’m again to exploring how agentic AI would possibly match right into a community engineer’s workflow and grow to be a priceless software in our software chest.

In my weblog publish, Making a NetAI Playground for Agentic AI Experimentation, I started this journey by exploring how we are able to make the most of Mannequin Context Protocol (MCP) servers and the idea of “instruments” to allow our AI brokers to work together with community gadgets by sending present instructions. In case you haven’t learn that publish but, undoubtedly test it out as a result of it’s some actually fabulous prose. Oh, and there may be some actually cool NetAI stuff in there, too. 😉

Whereas it was fascinating to see how effectively AI might perceive a community engineering process introduced in pure language, create a plan, after which execute that plan in the identical method I’d, there was a limitation in that first instance. The one “software” the agent had was the power to ship present instructions to the community machine. I needed to explicitly present the main points concerning the community machine—particulars which can be available in my “supply of fact.”

To appreciate the facility of agentic AI, NetAI must have entry to the identical info as human community engineers. For right now’s publish, I needed to discover how I might present source-of-truth information to my NetAI agent. So, let’s dig in!

NetBox gives an MCP server

NetBox has lengthy been a favourite software of mine. It’s an open-source community supply of fact, written in Python, and obtainable in numerous deployment choices. NetBox has been with me via a lot of my community automation exploration; it appeared becoming to see the way it might match into this new world of AI.

Initially, I anticipated to place a easy MCP server collectively to entry NetBox information. I rapidly discovered that the workforce at NetBox Labs had already launched an open-source primary MCP server on GitHub. It solely supplies “learn entry” to information, however as we noticed in my first NetAI publish, I’m beginning out slowly with read-only work anyway. Having a place to begin for introducing some supply of fact into my playground was going to considerably velocity up my exploration. Completely superior.

Including NetBox to the NetAI playground

Have you ever ever been engaged on a mission and gotten distracted by one other “cool thought?” No? I suppose it’s simply me then… 🙂

Like most of my community labs and explorations, I’m utilizing Cisco Modeling Labs (CML) to run the community playground for AI. This wasn’t the primary time I needed to have NetBox as a part of a CML topology. And as I used to be prepping to play with the NetBox MCP server, I had the thought…

Hank, wouldn’t it’s nice if there have been a CML NetBox node that might be simply added to a topology, and that may mechanically populate NetBox with the topology info from CML?

In fact I answered myself…

Heck yeah, Hank, that’s an amazing thought!

My thoughts instantly began figuring out the main points of the best way to put it collectively. I knew it might be tremendous straightforward and quick to knock out. And I figured different individuals would discover it useful as effectively. So I took a “quick detour.”

network topology shows NetBox node in Cisco Modeling Labs (CML) workbenchnetwork topology shows NetBox node in Cisco Modeling Labs (CML) workbench
Including NetBox to my Cisco Modeling Labs (CML) topology

I’m certain a lot of you raised your eyebrows once I stated “tremendous straightforward” and “quick.” You had been proper to be skeptical, in fact. It wasn’t fairly as straightforward or easy as I anticipated. Nonetheless, I used to be capable of get it working, and it’s actually cool and useful for anybody who needs so as to add not solely a NetBox server to a CML community but additionally have it pre-populated with the gadgets, hyperlinks, and IP particulars from the CML topology.

I nonetheless must compile the documentation for the brand new node definition earlier than I can publish it to the CML-Group on GitHub for others to make use of. Nonetheless, take into account this weblog publish my public accountability publish, indicating that it’s forthcoming. You may maintain me to it.

However sufficient of the facet observe on this weblog publish, let’s get again to the AI stuff!

Including NetBox MCP server to LM Studio

As I discussed within the final weblog publish, I’m utilizing LM Studio to run the Giant Language Mannequin (LLM) for my AI agent domestically on my laptop computer. The primary motive is to keep away from sending any community info to a cloud AI service. Though I’m utilizing a “lab community” for my exploration, there are particulars within the lab setup that I do NOT need to be public or danger ending up in future coaching information for an LLM.

If this exploration is profitable, utilizing the method with manufacturing information can be the following step; nonetheless, that’s undoubtedly not one thing that aligns with a accountable AI method.

Cloning down the netbox-mcp-server code from GitHub was straightforward sufficient. The README included an instance MCP server configuration that supplied every part I wanted to replace my mcp.json file in LM Studio so as to add it to my already configured pyATS MCP server.

{
  "mcpServers": {
    "pyats": {
      "url": "http://localhost:8002/mcp"
    },
    "netbox": {
      "command": "uv",
      "args": [
        "--directory",
        "/Users/hapresto/code/netbox-mcp-server",
        "run",
        "server.py"
      ],
      "env": {
        "NETBOX_URL": "http://{{MY NETBOX IP ADDRESS}/",
        "NETBOX_TOKEN": "{{MY NETBOX API TOKEN}}"
      }
    }
  }
}

As quickly as I saved the file, LM Studio found the instruments obtainable.

NetBox MCP server added to LMStudioNetBox MCP server added to LMStudio
NetBox MCP server added to LM Studio

There are three instruments supplied by the NetBox MCP server.

  • netbox_get_objects: Generic software that bulk retrieves objects from NetBox. It helps “filters” to restrict the returned objects.
  • netbox_get_object_by_id: Software to retrieve a single object of any sort from NetBox given an ID.
  • netbox_get_changelogs: Software to search for audit and alter occasions

I used to be, and proceed to be, within the method utilized by the NetBox Labs people on this MCP server. Relatively than offering instruments to “get_devices” and “get_ips,” they’ve a single software. NetBox’s APIs and object mannequin are effectively thought out, and make a generic method like this attainable. And it actually means much less code and growth time. Nonetheless, it basically offers API entry to the LLM and shifts the load for “thought” and “processing the info” again to the LLM. As Agentic AI and MCP are nonetheless very new requirements and approaches, there aren’t actual greatest practices and particulars on what works greatest in design patterns right here but. I’ll come again to this method and what I see as some attainable downsides afterward within the publish.

I then loaded the newly launched open mannequin by OpenAI, gpt-oss, and despatched the primary question.

Asking AI how many devices are in NetBoxAsking AI how many devices are in NetBox
Asking AI what number of gadgets are in NetBox

My first thought… Success. After which I scratched my head for a second. 10 gadgets? Scroll again as much as the CML topology picture and rely what number of gadgets are within the topology. Go forward, I’ll wait…

Yeah. I counted seven gadgets, too. And if I test NetBox itself, it additionally reveals seven gadgets.

NetBox shows 7 devicesNetBox shows 7 devices
NetBox reveals seven gadgets

So what occurred? LM Studio reveals the precise response from the software name, so I went and checked. Certain sufficient, solely seven gadgets’ price of data was returned. I then remembered that one of many notoriously meme-worthy failings of many AI instruments is the power to rely. Blueberries anybody?

So this was a pleasant teachable second about AI… AI is unbelievable, however it may be incorrect. And it will likely be unhealthy with a few of the strangest issues. Keep vigilant, my mates. 😉

After resolving the problem with the ten gadgets, I spent a substantial period of time asking extra questions and observing the AI make the most of the instruments to retrieve information from NetBox. On the whole, I used to be fairly impressed, and gaining access to source-of-truth information shall be key to any Agentic NetAI work we undertake. Whenever you do this out by yourself, undoubtedly mess around and see what you are able to do with the LLM and your NetBox information. Nonetheless, I needed to discover what was attainable in bringing instruments collectively.

Combining source-of-truth instruments with community operations instruments

I needed to begin out with one thing that felt each helpful and fairly easy. So I despatched this immediate.

I might wish to confirm that router01 is bodily related to the 
appropriate gadgets per the NetBox cable connections.  

> Notice: The credentials for router01 are: `netadmin / 1234QWer`

Are you able to: 

1. Verify NetBox for what community gadgets router01 is meant to be 
   related to, and on what interfaces
2. Lookup the Out of Band IP tackle and SSH port from NetBox, use 
   these to connect with router01.
3. Use CDP on router01 to test what neighbors are seen
4. Examine the NetBox to CDP info. 

I nonetheless needed to inform the LLM what the credentials are for the gadgets. That’s as a result of whereas NetBox is a unbelievable supply of fact, it does NOT retailer secrets and techniques/credentials. I’m planning on exploring what software choices exist for pulling information from secret storage afterward.

In case you are questioning why I supplied an inventory of steps to deal with this drawback moderately than let the LLM “determine it out,” the reply is that whereas GenAI LLMs can appear “good,” they’re NOT community engineers. Or, extra particularly, they haven’t been skilled and tuned to BE community engineers. Seemingly, the long run will supply tuned LLMs for particular job roles moderately than the general-purpose LLMs of right now. Till then, the most effective apply for “immediate engineering” is to offer the LLM with detailed directions on what you need it to do. That dramatically will increase the probabilities of success and the velocity at which the LLM can deal with the issue.

Let’s have a look at how the LLM dealt with step one within the request, trying up the machine connections.

The AI plans and executes the cable lookup.The AI plans and executes the cable lookup.
The AI plans and executes the cable lookup

At first look, this seems to be fairly good. It “knew” that it wanted to test the Cables from NetBox. Nonetheless, there are some issues right here. The LLM crafted what seems to be a legitimate filter for the lookup: “device_a_name”: “router01.” Nonetheless, that’s really NOT a legitimate filter. It’s a hallucination.

A complete weblog publish might be written on the explanation this hallucination occurred, however the TL;DR is that the NetBox MCP server does NOT present express particulars on the best way to craft filters. It depends on the LLM to have the ability to construct a filter based mostly on the coaching information. And whereas each LLM has benefited from the copious quantities of NetBox documentation obtainable on the web, in all of my testing, I’ve but to have any LLM efficiently craft the proper filter for something however essentially the most primary searches for NetBox.

This has led me to begin constructing my very own “opinion” on how MCP servers must be constructed, and it includes requiring much less “guessing” from the LLMs to make use of them. I’ll most actually be again extra on this subject in later posts and shows. However sufficient on that for now.  

The LLM doesn’t know that the filter was incorrect; it assumes that the cables returned are all related to router01. This results in different errors within the reporting, because the “Thought” course of reveals. It sees each Cable 1 and Cable 4 as related to Ethernet 0/0. The reality is that Cable 4 is related to switch01 Ethernet0/0. We’ll see how this elements in later within the abstract of knowledge.

As soon as it has the cable info, the LLM proceeds and completes the remainder of the software’s use to collect information.

The AI succeeds in getting CDP informationThe AI succeeds in getting CDP information
The AI succeeds in getting CDP info

Discovering the Out of Band IP and SSH port was easy. However the first try and run “present cdp neighbors” failed as a result of the LLM initially didn’t use the SSH port as a part of the software name. However this is a wonderful instance of how Agentic AI can perceive errors from MCP servers and “repair them.” It realized the necessity for SSH and tried once more.

I’ve seen a number of circumstances the place AI brokers will resolve errors with software calls via trial and error and iteration. The truth is, some MCP servers appear to be designed particularly with this because the anticipated conduct. Good error messages can provide the LLM the context required to repair the issue. Just like how we as people would possibly react and regulate after we get an error from a command or API name we ship. This is a wonderful energy of LLMs; nonetheless, I believe that MCP servers can and must be designed to restrict the quantity of trial and error required. I’ve additionally seen LLMs “quit” after too many errors.

Let’s check out the ultimate response from the AI agent after it accomplished gathering and processing the outcomes.

The NetAI agent reports it's findings.The NetAI agent reports it's findings.
The NetAI agent experiences its findings

So how did it do?

First, the nice issues. It appropriately acknowledged that the hyperlink to switch01 from NetBox matched a CDP entry. Wonderful. It additionally referred to as out the lacking CDP neighbor for the “mgmt” change. It’s lacking as a result of “mgmt” is an unmanaged change and doesn’t run CDP.

It could have been actually “cool” if the LLM had seen that the machine sort of “mgmt” was “Unmanaged Swap” and commented on that being the explanation CDP info was lacking. As already talked about, the LLM is NOT tuned for community engineering use circumstances, so I’ll give it a move on this.

And now the errors… The issue with the filter for the cable resulted in two errors within the findings. There aren’t two cables on Ethernet0/0, and the “Different unused cables” aren’t related to router01.

Hank’s takeaways from the take a look at

I used to be undoubtedly slightly disenchanted that my preliminary assessments weren’t 100% profitable; that may have made for an amazing story on this weblog publish. But when I’m sincere, operating into a number of issues was even higher for the publish.

AI may be downright wonderful and jaw-dropping with what it could do. But it surely isn’t excellent. We’re within the very early days of Agentic AI and AIOps, and there’s a lot of labor left to do, from creating and providing tuned LLMs with domain-specific information to discovering the most effective practices for constructing the most effective functioning instruments for AI use circumstances.

What I did see on this experiment, and all my experiments and studying, is the true potential for NetAI to offer community engineers a robust software for designing and working their networks. I’ll be persevering with my exploration and stay up for seeing that potential come to fruition.

There’s a lot extra I discovered from this mission, however the weblog publish is getting fairly lengthy, so it’ll have to attend for one more installment. Whereas I’m engaged on that, let me know what you consider AI and the potential for making your each day work as a community engineer higher.

How has AI helped you lately? What’s the most effective hallucination you’ve run into to this point?

Let me know within the feedback!

Learn subsequent:

Making a NetAI Playground for Agentic AI Experimentation

Wrangling the Wild West of MCP Servers


 

Join Cisco U. | Be part of the  Cisco Studying Community right now without cost.

Be taught with Cisco

X | Threads | Fb | LinkedIn | Instagram | YouTube

Use  #CiscoU and #CiscoCert to hitch the dialog.

Share:



Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Stay Connected

0FansLike
0FollowersFollow
0SubscribersSubscribe
- Advertisement -spot_img

Latest Articles