My Account Log in

1 option

Building AI Agents for Network Operations : Design LLM-Powered NetOps Workflows with Python, Ollama, MCP, and Tool Calling.

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Baksh, Sif.
Language:
English
Subjects (All):
Artificial intelligence.
Computer networks.
Physical Description:
1 online resource (226 pages)
Edition:
1st ed.
Place of Publication:
Birmingham : Packt Publishing, Limited, 2026.
Summary:
Build AI-assisted network troubleshooting workflows that parse CLI output, call approved tools, use MCP, and keep evidence visible for review Key Features Build local LLM workflows for NetOps using Python, Ollama, and validated CLI data Create troubleshooting agents that use memory, approved tools, and clear evidence Package reusable network.
Contents:
Intro
Building AI Agents for Network Operations
Design LLM-powered NetOps workflows with Python, Ollama, MCP, and tool calling
Contributors
About the author
Table of Contents
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Share your thoughts
Free benefits with your book
How to Unlock
Stay Sharp in Cloud and DevOps - Join 44,000+ Subscribers of CloudPro
1
Understanding AI Agents for Network Operations
Technical requirements
The operational problem agents are trying to solve
What is an AI agent?
Chatbots, copilots, automation, and agents
Where agents help in network operations
Alert triage
CLI output parsing
Troubleshooting support
Documentation and handoffs
Where agents are the wrong tool
The basic agent workflow
A practical troubleshooting scenario
Human control is not optional
How traditional automation and agents work together
What you will build in this book
Production reality check
How to think about success
Summary
Get this book's PDF version and more
2
LLM Fundamentals and Local Setup
Understanding why LLM fundamentals matter for NetOps
Understanding what a large language model is
Working with tokens and context windows
Managing output size and cost
Controlling temperature and predictable output
Comparing temperature behavior
Understanding stateless calls and memory
Using Ollama for the local lab
Installing Ollama and pulling the model
Running the model from the command line
Setting up the repository and Python environment
Calling Ollama from Python
Reviewing what the Python code is doing.
Experimenting with temperature from Python
Reviewing tokens in the lab
Troubleshooting and production considerations
Troubleshooting the local setup
Checking production reality
Join us on Discord
3
Prompt Engineering for Network Automation
Understanding why prompt engineering matters
Introducing the RACE prompt framework
Defining the role
Adding anchors
Providing context
Defining the expected output
Comparing vague prompts with structured prompts
Building a configuration parser prompt
Writing the RACE prompt
Running the prompt engineering lab
Reviewing what the lab is doing
Validating model output
Creating reusable prompt templates
Creating an alert triage prompt
Creating a documentation prompt
Handling common prompt failures
Extending prompts to live device data
4
Parsing Network Outputs into Structured Data
Understanding why structured output matters for NetOps
Moving from raw CLI text to validated JSON
Parsing interface output
Reviewing the interface prompt
Parsing BGP summary output
Normalizing multi-vendor output
Validating structured output before using it
Handling malformed output and uncertain states
Connecting parsing to live device data carefully
Choosing between LLM-assisted and deterministic parsing
5
Building a Network Chatbot with Memory
Understanding why chatbot memory matters
Running a stateless chatbot
Adding application-managed memory
Building the NetworkChatbot class
Building the chat method
Building the full prompt
Running the memory-enabled chatbot.
Managing conversation history
Resetting the conversation
Using a network-focused system prompt
Preparing chatbot memory for agents
6
Designing Tools and Agentic Workflows
Understanding why agents need tools
Moving from chatbot responses to tool-assisted reasoning
Reviewing the mock network tools
Reviewing the main Lab 4 script
Mapping tool names to approved Python functions
Describing tools to the model
Building the system prompt for tool use
Parsing model requested tool calls
Executing tools safely
Returning tool results to the model
Limiting the agent loop
Handling tool-calling failure modes
Running the agentic network bot
Trying a multi-step question
Testing an investigation query
Keeping live network access optional
Applying production boundaries to tools using agents
Logging what the agent does
Avoiding common agent design mistakes
Preparing for the main troubleshooting agent
7
Building the Main Network Troubleshooting Agent
Moving from tool mechanics to troubleshooting
Reviewing the troubleshooting scenarios
Reviewing the mock topology
Running the troubleshooting agent
Scenario 1: Checking device status
Scenario 2: Checking BGP health
Scenario 3: Investigating leaf2
Scenario 4: Investigating a missing route to host symptom
Building an evidence-based final answer
Catching wrong or incomplete model conclusions
Improving the troubleshooting prompts
Using the agent interactively
Keeping the workflow mocked and read-only
Understanding what the agent can and cannot do
Walking through the leaf2 investigation step by step
Creating an evidence record.
Checking the answer before trusting it
Designing a structured troubleshooting response
Expanding the missing route investigation
Preparing for reusable tools with MCP
8
From Lab Agents to Reusable Tools with MCP
Moving beyond direct tool calling
Understanding what MCP adds
Reviewing the Lab 5 architecture
Reviewing the safe network tool wrappers
Testing the tool layer before MCP
Exposing network tools through the MCP server
Running the MCP server
Connecting the HTTP bridge
Opening the browser UI
Testing the MCP tools from the UI
Understanding why the bridge exists
Running the lab in the correct order
Troubleshooting the MCP lab
Keeping MCP tools safe
Deciding when MCP is useful
Comparing MCP transport choices
Designing stable MCP tool contracts
Avoiding common MCP design mistakes
Reviewing what we built
9
Moving Toward Production-Ready Network Agents
Understanding why production is different from a lab
Defining the production boundary
Keeping the first operational step read-only
Deciding what should not be automated
Applying authentication and authorization
Handling secrets and credentials
Validating inputs and outputs
Using the Lab 6 safety wrapper demo
Designing tool safety and approval workflows
Logging every tool call
Reviewing an audit event
Observing the agent and tool layers
Handling failure and rollback planning
Using the production skeleton pattern
Planning a staged rollout
Reviewing the production-readiness checklist
Building a production review packet
Testing before a controlled pilot
Writing an operations runbook.
Using feature flags and kill switches
Assigning ownership and support
Defining acceptance criteria
Creating a production-readiness worksheet
Preparing an approval record
Avoiding production shortcuts
Connecting the chapter back to the book's journey
Final go/no-go review
10
Unlock Your Exclusive Benefits
Unlock this Book's Free Benefits in three Easy Steps
Step 1
Step 2
Step 3
Need Help
Appendix A
AI Network Agent Design Toolkit
Book concepts mapped to design artifacts
Use-case fit scorecard
Use-case brief template
RACE prompt worksheet
Reusable RACE prompt skeleton
Structured-output and validation checklist
Minimal schema checklist
Testing different models
Memory and context policy
Tool inventory and safety matrix
Tool contract template
Evidence record for troubleshooting agents
Troubleshooting response template
MCP tool contract worksheet
Production readiness checklist
Audit event template
Read-only pilot acceptance criteria
Operations runbook template
Feature flag and kill switch template
Go/no-go review
Why subscribe?
Other Books You May Enjoy
Packt is searching for authors like you
Index.
Notes:
Description based on publisher supplied metadata and other sources.
Part of the metadata in this record was created by AI, based on the text of the resource.
Other Format:
Print version: Baksh, Sif Building AI Agents for Network Operations
ISBN:
9781808346828
OCLC:
1607915277

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

Find

Home Release notes

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Find catalog Using Articles+ Using your account