<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Automation on Sam7oon</title><link>https://amrelhusseiny.github.io/tags/automation/</link><description>Recent content in Automation on Sam7oon</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 20 Oct 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://amrelhusseiny.github.io/tags/automation/index.xml" rel="self" type="application/rss+xml"/><item><title>AI Agents &amp; MCP Servers for Network Engineers: RAG &amp; Chroma MCP Deep Dive</title><link>https://amrelhusseiny.github.io/blog/001_ai_0006_rag_vector_databases/</link><pubDate>Mon, 20 Oct 2025 00:00:00 +0000</pubDate><guid>https://amrelhusseiny.github.io/blog/001_ai_0006_rag_vector_databases/</guid><description>&lt;h2 id="table-of-contents"&gt;Table of Contents&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#introduction"&gt;Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#rag-database-for-ai"&gt;RAG (Database for AI)&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#understanding-the-challenges"&gt;Understanding the Challenges&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#cost-analysis-and-real-world-experience"&gt;Cost Analysis and Real-World Experience&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#chroma-mcp-implementation"&gt;Chroma MCP Implementation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#semantic-and-hybrid-search"&gt;Semantic and Hybrid Search&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#conclusion"&gt;Conclusion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#references"&gt;References&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;I have reached the conclusion to write this article after 7 months of continous studying , tweaking and testing many AI workflows in order to optimize my daily work,&lt;/p&gt;
&lt;p&gt;As a primarily network engineer, my field&amp;rsquo;s vendors still are resisting the pivoting to AI in Infra, as unlike software engineering, which does not mind move fast and break things, in Infrastructure, the vendors can be much more cautous,&lt;/p&gt;</description></item><item><title>PyATS MCP, How a Network Engineer start with AI</title><link>https://amrelhusseiny.github.io/blog/001_networks_0009_pyats_using_ai/</link><pubDate>Wed, 15 Oct 2025 01:11:49 +0300</pubDate><guid>https://amrelhusseiny.github.io/blog/001_networks_0009_pyats_using_ai/</guid><description>&lt;h2 id="table-of-contents"&gt;Table of Contents&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#overview"&gt;Overview&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#starting-with-result"&gt;Starting with result&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#introduction"&gt;Introduction&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#what-are-mcp-servers"&gt;What are MCP servers?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#what-is-pyats"&gt;What is PyATS ?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#what-is-gemini-cli"&gt;What is Gemini CLI ?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#dive-in"&gt;Dive in&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#our-test-setup"&gt;Our test setup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#preparing-pyats-mcp-server-container"&gt;Preparing PyATS MCP Server container&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#using-the-mcp-server"&gt;Using the MCP server&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#references"&gt;References&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;
&lt;h3 id="starting-with-result"&gt;Starting with result&lt;/h3&gt;
&lt;p&gt;Starting with the final result, here I am asking Gemini to get me the software version of one of my switches :&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;$ gemini -m gemini-2.5-flash 

 ███ █████████ ██████████ ██████ ██████ █████ ██████ █████ █████
░░░███ ███░░░░░███░░███░░░░░█░░██████ ██████ ░░███ ░░██████ ░░███ ░░███
 ░░░███ ███ ░░░ ░███ █ ░ ░███░█████░███ ░███ ░███░███ ░███ ░███
 ░░░███ ░███ ░██████ ░███░░███ ░███ ░███ ░███░░███░███ ░███
 ███░ ░███ █████ ░███░░█ ░███ ░░░ ░███ ░███ ░███ ░░██████ ░███
 ███░ ░░███ ░░███ ░███ ░ █ ░███ ░███ ░███ ░███ ░░█████ ░███
 ███░ ░░█████████ ██████████ █████ █████ █████ █████ ░░█████ █████
░░░ ░░░░░░░░░ ░░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░




╭─────────────────────────────────────────────────────────────────────────────────────╮
│ &amp;gt; get me the software verstion of clab-fullmesh-lab-n9kv1 and put it in cli table │
╰─────────────────────────────────────────────────────────────────────────────────────╯

 
 1 +-------------------------+-----------------+
 2 | Device | Software Version|
 3 +-------------------------+-----------------+
 4 | clab-fullmesh-lab-n9kv1 | 10.4(6) |
 5 +-------------------------+-----------------+
 
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;
&lt;p&gt;AI usage is no longer only for copy &amp;amp; paste to chatgpt to get info about an error, or to search how to do something, no longer is just a Google search replacement,&lt;/p&gt;</description></item><item><title>Automating DrawIO network topology using Python</title><link>https://amrelhusseiny.github.io/blog/001_networks_0004_drawio_lib/</link><pubDate>Tue, 06 Sep 2022 11:26:44 +0200</pubDate><guid>https://amrelhusseiny.github.io/blog/001_networks_0004_drawio_lib/</guid><description>&lt;div&gt;
 &lt;h2&gt;Table Of Contents&lt;/h2&gt;
 &lt;nav id="TableOfContents"&gt;
 &lt;ul&gt;
 &lt;li&gt;&lt;a href="#generated-topology"&gt;Generated Topology&lt;/a&gt;&lt;/li&gt;
 &lt;/ul&gt;
&lt;/nav&gt;
&lt;/div&gt;
&lt;h1 id="intro"&gt;Intro&lt;/h1&gt;
&lt;p&gt;In this blog , we are going to show how to use the draw_network_plot python library to generate a DrawIO Network topology easily instead of manually drawing them yourself .
DrawIO is widely used as a free alternative to Microsoft&amp;rsquo;s Visio to draw network topologies.
I will be using Netmiko and CDP to acquire the data needed for the plot for the devices themselves , but this part won&amp;rsquo;t be the focus of the article .
Focus of the article is how to use the &amp;ldquo;drawio_network_plot&amp;rdquo; library&amp;quot; to generate the DrawIO file .&lt;/p&gt;</description></item><item><title>Managing Huawei Cloud_Engine switches using Ansible</title><link>https://amrelhusseiny.github.io/blog/003_cloud_0001_huwawei_cloud_egine_ansible/003_cloud_0001_huwawei_cloud_egine_ansible/</link><pubDate>Thu, 25 Aug 2022 12:19:49 +0200</pubDate><guid>https://amrelhusseiny.github.io/blog/003_cloud_0001_huwawei_cloud_egine_ansible/003_cloud_0001_huwawei_cloud_egine_ansible/</guid><description>&lt;div&gt;
 &lt;h2&gt;Table Of Contents&lt;/h2&gt;
 &lt;nav id="TableOfContents"&gt;
 &lt;ul&gt;
 &lt;li&gt;&lt;a href="#what-we-will-be-discussing"&gt;what we will be discussing&lt;/a&gt;&lt;/li&gt;
 &lt;/ul&gt;

 &lt;ul&gt;
 &lt;li&gt;&lt;a href="#1--eve-ng-installation-"&gt;1- EVE-NG Installation :&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#2--huawei-cloud-engine-eve-image-"&gt;2- Huawei Cloud Engine EVE Image :&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#3--our-lab-setup-"&gt;3- Our lab setup :&lt;/a&gt;
 &lt;ul&gt;
 &lt;li&gt;&lt;a href="#a-ansible-machine"&gt;A) Ansible Machine&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#b-on-eve-portal"&gt;B) On EVE Portal&lt;/a&gt;&lt;/li&gt;
 &lt;/ul&gt;
 &lt;/li&gt;
 &lt;li&gt;&lt;a href="#4--setup-of-the-ansible-machine"&gt;4- Setup of the Ansible machine:&lt;/a&gt;
 &lt;ul&gt;
 &lt;li&gt;&lt;a href="#acreate-a-virtual-python-environment"&gt;A)Create a virtual Python environment:&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#b-lets-create-a-simple-inventory-and-playbook-to-run-on-our-current-switch-"&gt;B) lets create a simple Inventory and Playbook to run on our current switch :&lt;/a&gt;&lt;/li&gt;
 &lt;/ul&gt;
 &lt;/li&gt;
 &lt;/ul&gt;
&lt;/nav&gt;
&lt;/div&gt;
&lt;h1 id="introduction"&gt;Introduction&lt;/h1&gt;
&lt;p&gt;I have been working with the Huawei Cloud Engine series of switches for the Data Center, and one of the great things I was introduced to is the efficient usage of Ansible+Netconf to configure Legacy network devices instead of the trial and error handling way of Python+SSH , which you had to anticipate the delay of the SSH session and to handle a console output using Regex which while very customizable , when it comes to production environments , your supervisors would much prefer a tried and tested technology backed up by the vendor itself .&lt;/p&gt;</description></item><item><title>Python's Netmiko starter template</title><link>https://amrelhusseiny.github.io/blog/001_networks_0006_python_netmiko_template/001_networks_0006_python_netmiko_template/</link><pubDate>Sun, 17 Jul 2022 12:36:51 +0200</pubDate><guid>https://amrelhusseiny.github.io/blog/001_networks_0006_python_netmiko_template/001_networks_0006_python_netmiko_template/</guid><description>&lt;p&gt;&lt;div&gt;
 &lt;h2&gt;Table Of Contents&lt;/h2&gt;
 &lt;nav id="TableOfContents"&gt;
 &lt;ul&gt;
 &lt;li&gt;&lt;a href="#comments-on-the-code-"&gt;Comments on the code :&lt;/a&gt;&lt;/li&gt;
 &lt;/ul&gt;
&lt;/nav&gt;
&lt;/div&gt;
The following is a ready to go netlike template , you just need to choose your way of authentication and the device type , you can find the supported devices on both the documentation and the Git for the Netmiko library :&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Netmiko Source Code :&lt;/strong&gt; &lt;a href="https://github.com/ktbyers/netmiko"&gt;Netmiko Github&lt;/a&gt;
&lt;strong&gt;API reference&lt;/strong&gt; &lt;em&gt;(must check for more functionality)&lt;/em&gt; : &lt;a href="https://ktbyers.github.io/netmiko/docs/netmiko/index.html"&gt;Netmiko Doc&lt;/a&gt;&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;# netmiko_starter.py 
from netmiko import ConnectHandler

device_dictionary = {
 &amp;#39;device_type&amp;#39;: &amp;#39;DEVICE_TYPE&amp;#39;, 
 &amp;#39;host&amp;#39;: &amp;#39;DEVICE_IP_ADDRESS&amp;#39;,
 &amp;#39;username&amp;#39;: &amp;#39;USERNAME&amp;#39;,
 &amp;#39;password&amp;#39; : &amp;#39;PASSWORD&amp;#39;,
 # &amp;#39;verbose&amp;#39;: False ,
 # &amp;#39;session_log&amp;#39;: &amp;#39;log.txt&amp;#39;, 
 # &amp;#39;global_delay_factor&amp;#39;: 2, 
 }
net_connect = ConnectHandler(**device_dictionary)
output = net_connect.send_command(&amp;#34;show version&amp;#34;)
net_connect.disconnect()
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="comments-on-the-code-"&gt;Comments on the code :&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;uncomment &lt;em&gt;verbose&lt;/em&gt; if you want to disable Netmiko&amp;rsquo;s Logs .&lt;/li&gt;
&lt;li&gt;uncomment &lt;em&gt;session_log&lt;/em&gt; to debug the connection failures .&lt;/li&gt;
&lt;li&gt;uncomment _ global_delay_factor_ to add delay when waiting for commands output , very useful if the devices are slow , note that this is not in seconds but in multiple , so &amp;ldquo;2&amp;rdquo; mean multiply the default delay by 2 and so on&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For more functionality , like the types of devices supported , please check the API docs .&lt;/p&gt;</description></item></channel></rss>