<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Md Abid Hussain</title>
    <description>The latest articles on DEV Community by Md Abid Hussain (@md-abid-hussain).</description>
    <link>https://dev.to/md-abid-hussain</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F968815%2F6b3c06d9-4da3-405b-98e3-13263c96c3a4.jpg</url>
      <title>DEV Community: Md Abid Hussain</title>
      <link>https://dev.to/md-abid-hussain</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/md-abid-hussain"/>
    <language>en</language>
    <item>
      <title>docs-kb cli</title>
      <dc:creator>Md Abid Hussain</dc:creator>
      <pubDate>Tue, 01 Jul 2025 11:53:21 +0000</pubDate>
      <link>https://dev.to/md-abid-hussain/docs-kb-cli-tool-351j</link>
      <guid>https://dev.to/md-abid-hussain/docs-kb-cli-tool-351j</guid>
      <description>&lt;p&gt;CLI tool to create knowledge base on open source docs using &lt;strong&gt;MindsDB Knowledge Base&lt;/strong&gt; and Ollama. Comes with 🧠 &lt;strong&gt;MCP&lt;/strong&gt; support so that your agent can access it as well.&lt;/p&gt;




&lt;h4&gt;
  
  
  Overview of MindsDB
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;MindsDB&lt;/strong&gt; is an AI federated query engine that enables humans, AI agents, and applications to get highly accurate answers across sprawled and large-scale data sources. It follows the &lt;strong&gt;"Connect, Unify, Respond"&lt;/strong&gt; philosophy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; Connecting to hundreds of data sources
&lt;/li&gt;
&lt;li&gt; Unifying them through SQL interfaces
&lt;/li&gt;
&lt;li&gt; Responding to queries using AI models as virtual tables&lt;/li&gt;
&lt;/ul&gt;




&lt;h4&gt;
  
  
  Knowledge Bases in MindsDB
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Knowledge Bases&lt;/strong&gt; are one of MindsDB's core unification interfaces that index and organize unstructured data for efficient retrieval.&lt;/p&gt;

&lt;p&gt;They:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; Transform documents, web content, and text into searchable repositories
&lt;/li&gt;
&lt;li&gt; Enable natural language querying via SQL
&lt;/li&gt;
&lt;li&gt; Work with other MindsDB components (Views, ML Models, Jobs) for full unification
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;MindsDB turns scattered data into an intelligent retrieval system — structured or unstructured.&lt;/p&gt;




&lt;h4&gt;
  
  
  ⚙️ Features
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;📄 Markdown documentation discovery
&lt;/li&gt;
&lt;li&gt;⚡ Efficient repo syncs via file SHA comparisons
&lt;/li&gt;
&lt;li&gt;📦 Track multiple repositories with rich metadata
&lt;/li&gt;
&lt;li&gt;🧩 Model Context Protocol (MCP) server for IDE integrations (VS Code / Cursor)
&lt;/li&gt;
&lt;li&gt;🔌 Optional GitHub Data Handler in MindsDB for enhanced repo access
&lt;/li&gt;
&lt;/ul&gt;




&lt;h4&gt;
  
  
  In action
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://mdabidhussain.hashnode.dev/enhance-repository-analysis-with-mindsdb-mcp-and-docs-kb-mcp" rel="noopener noreferrer"&gt;Enhance Repository Analysis with MindsDB MCP and Docs-KB MCP&lt;/a&gt;&lt;/p&gt;




&lt;h4&gt;
  
  
  Built With
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;🧠 &lt;a href="https://docs.mindsdb.com/mindsdb" rel="noopener noreferrer"&gt;MindsDB&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🐪 Ollama
&lt;/li&gt;
&lt;li&gt;🖋 &lt;a href="https://typer.tiangolo.com/" rel="noopener noreferrer"&gt;Typer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🚀 &lt;a href="https://gofastmcp.com/getting-started/welcome" rel="noopener noreferrer"&gt;FastMCP&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h4&gt;
  
  
  🔗 GitHub Repo
&lt;/h4&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/md-abid-hussain/docs-kb-cli" rel="noopener noreferrer"&gt;docs-kb CLI Demo&lt;/a&gt;&lt;/p&gt;




&lt;h4&gt;
  
  
  🎥 Demo
&lt;/h4&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/IztokNiGa4s"&gt;
  &lt;/iframe&gt;
&lt;br&gt;
  &lt;iframe src="https://www.youtube.com/embed/p0-1fCEDhIU"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>mindsdb</category>
      <category>cli</category>
      <category>mcp</category>
      <category>rag</category>
    </item>
    <item>
      <title>Building SDKs for MindsDB this Hacktoberfest</title>
      <dc:creator>Md Abid Hussain</dc:creator>
      <pubDate>Wed, 30 Oct 2024 19:13:11 +0000</pubDate>
      <link>https://dev.to/md-abid-hussain/building-sdks-for-mindsdb-this-hacktoberfest-384a</link>
      <guid>https://dev.to/md-abid-hussain/building-sdks-for-mindsdb-this-hacktoberfest-384a</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest"&gt;2024 Hacktoberfest Writing challenge&lt;/a&gt;: Contributor Experience&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Hacktoberfest 2024&lt;/strong&gt; was quite special for me.&lt;/p&gt;

&lt;p&gt;I have been involved in open source but have only made small contributions. In the past, I also completed the &lt;strong&gt;Hacktoberfest&lt;/strong&gt; challenge in &lt;strong&gt;2022&lt;/strong&gt;, where I contributed to &lt;a href="https://github.com/kamranahmedse/developer-roadmap" rel="noopener noreferrer"&gt;roadmap.sh&lt;/a&gt; through &lt;strong&gt;documentations&lt;/strong&gt;. It was really great experience. &lt;/p&gt;

&lt;p&gt;But this hacktoberfest I took a great step towards contributing to open source. During this hacktoberfest I have contributed to &lt;a href="https://github.com/mindsdb/mindsdb" rel="noopener noreferrer"&gt;MindsDB&lt;/a&gt; which is a great platform for building AI from enterprise data, enabling smarter organizations.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9a7dvkcqd2l3ytqslfle.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9a7dvkcqd2l3ytqslfle.png" alt="MindsDB platform overview" width="800" height="665"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  My Contribution
&lt;/h2&gt;

&lt;p&gt;I have built Java SDK for MindsDB and also contributed to JavaScript/TypeScript SDK of MindsDB. &lt;/p&gt;

&lt;p&gt;It was challenging and took a lot of effort in understanding the MindsDB. There is already SQL api, REST API and Python SDK. I have to built the whole SDK using the reference from those. The REST API client lack some implementation  so I have to write the dynamic SQL query and send it via REST API. Python SDK for MindsDB is written very well along with documentation, so I followed that structure to build Java SDK. I have to read the whole documentation from Python SDK , REST API to SQL API. It's like I have memorized the whole Python codebase, SQL api and documentation because I have referenced them so many times that I can't remember. If I ran to any issue I know where to look and what might be causing the issue. &lt;/p&gt;

&lt;p&gt;Apart from this I have also contributed to the JS/TS SDK and it was easy because I know what I have to do since I have already built the Java SDK.&lt;/p&gt;

&lt;p&gt;I didn't just built it, I performed tests, wrote both documentation and tests. &lt;/p&gt;

&lt;p&gt;Below are the links: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/md-abid-hussain/mindsdb-java-sdk" rel="noopener noreferrer"&gt;Java SDK&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mindsdb-java-sdk.hashnode.space/docs?t=1730315337499" rel="noopener noreferrer"&gt;Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://central.sonatype.com/artifact/io.github.md-abid-hussain/mindsdb-java-sdk" rel="noopener noreferrer"&gt;Maven Central&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://md-abid-hussain.github.io/mindsdb-java-sdk/" rel="noopener noreferrer"&gt;API references&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devchallenge</category>
      <category>hacktoberfest</category>
      <category>opensource</category>
    </item>
    <item>
      <title>OpenSourceSmith - Complete Kit to Forge Your Project</title>
      <dc:creator>Md Abid Hussain</dc:creator>
      <pubDate>Sun, 01 Sep 2024 05:56:21 +0000</pubDate>
      <link>https://dev.to/md-abid-hussain/opensourcesmith-1e1h</link>
      <guid>https://dev.to/md-abid-hussain/opensourcesmith-1e1h</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/neon"&gt;Neon Open Source Starter Kit Challenge &lt;/a&gt;: Ultimate Starter Kit&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  My Kit
&lt;/h2&gt;

&lt;p&gt;The OpenSourceSmith starter kit is designed to empower developers by providing a curated collection of open-source project templates. Whether you're a beginner looking to start your first project or an experienced developer seeking to streamline your workflow, our platform offers a wide range of templates to suit your needs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The kit is not just an idea but a fully functional and live, ready-to-use set&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Features&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Template Discovery:&lt;/strong&gt; Browse and filter through a diverse collection of templates for frontend, backend, and full-stack applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Template Addition:&lt;/strong&gt; Seamlessly upload your own templates directly from your GitHub repositories and share your work with the community.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CLI Tool:&lt;/strong&gt; Utilize our CLI tool, open-source-smith, to automate the initial setup process and fetch templates from the OpenSourceSmith platform.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI Chatbot Assistance:&lt;/strong&gt; Generate step-by-step instructions for setting up your project using our AI chatbot.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwxdv8izmf2py3ehsdzol.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwxdv8izmf2py3ehsdzol.png" alt="tools used" width="800" height="570"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Link to Kit
&lt;/h2&gt;

&lt;p&gt;Kit compromises three components.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Documentation Site:

&lt;ul&gt;
&lt;li&gt;GitHub URL: &lt;a href="https://github.com/md-abid-hussain/open-source-smith-docs" rel="noopener noreferrer"&gt;OpenSourceSmithDocs - GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Live URL: &lt;a href="https://amomynus.mintlify.app/introduction" rel="noopener noreferrer"&gt;OpenSourceSmithDocs&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Website:

&lt;ul&gt;
&lt;li&gt;GitHub URL: &lt;a href="https://github.com/md-abid-hussain/open-source-smith-site" rel="noopener noreferrer"&gt;OpenSourceSmithPlatform - GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Live URL: &lt;a href="https://opensourcesmith.vercel.app/" rel="noopener noreferrer"&gt;OpenSourceSmithPlatform&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;CLI tool:

&lt;ul&gt;
&lt;li&gt;GitHub URL: &lt;a href="https://github.com/md-abid-hussain/open-source-smith" rel="noopener noreferrer"&gt;OpenSourceSmithCLI - GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;NPM URL: &lt;a href="https://www.npmjs.com/package/open-source-smith" rel="noopener noreferrer"&gt;OpenSourceSmithCLI&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Your Journey
&lt;/h2&gt;

&lt;p&gt;The journey to idea discovery and project building is quite dynamic. I started with creating templates like &lt;code&gt;express template using typescript&lt;/code&gt;, but I didn't feel it was much of a solution because there are already tons of templates out there. So I started creating a cli, which at first gives user options to add a project name and select template type (frontend, backend, or fullstack), and I have added project initialization from official packages like Vite, Vue, and Nextjs, which I also felt was not my original idea, just using the already created tools and only my tool acting as an interface. Then I added the above-created template (e.g., express template using typescript), which I uploaded on github and the user can download it from the cli, which I felt very good after creating, but again, I faced the challenge of adding a new template and showing a huge number of templates in the cli, which can be challenging in terms of search and filtering.&lt;br&gt;
After this, I got the idea to build a platform where users can share their templates because everyone is building templates, and I also integrated it with an already-created cli tool. Also, I integrate AI chat support so that users can have a single platform to ask for any query as well. &lt;br&gt;
The name &lt;strong&gt;OpenSourceSmith&lt;/strong&gt; is from the idea that I'm providing a setup to the user to &lt;strong&gt;forge&lt;/strong&gt; their project, which is similar to Anvil (a forging tool) that can be used to create a wide variety of things and tools.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>neonchallenge</category>
      <category>postgres</category>
      <category>database</category>
    </item>
    <item>
      <title>From Docker to Kubernetes: A Journey with Cyclops UI</title>
      <dc:creator>Md Abid Hussain</dc:creator>
      <pubDate>Thu, 01 Aug 2024 10:57:58 +0000</pubDate>
      <link>https://dev.to/md-abid-hussain/from-docker-to-kubernetes-a-journey-with-cyclops-ui-m9l</link>
      <guid>https://dev.to/md-abid-hussain/from-docker-to-kubernetes-a-journey-with-cyclops-ui-m9l</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;From &lt;strong&gt;"localhost"&lt;/strong&gt; to &lt;strong&gt;cloud's&lt;/strong&gt; vast expanse,&lt;br&gt;
Your app's journey, a cosmic trance.&lt;br&gt;
With &lt;strong&gt;Docker's&lt;/strong&gt; might and &lt;strong&gt;K8s's&lt;/strong&gt; art,&lt;br&gt;
&lt;strong&gt;Cyclops UI&lt;/strong&gt; gives it a flying start.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Table of content:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Intorduction&lt;/li&gt;
&lt;li&gt;Prerequisites&lt;/li&gt;
&lt;li&gt;Pizza shop analogy of docker, kubernetes and cyclopsui&lt;/li&gt;
&lt;li&gt;Dockerization of the RAG App&lt;/li&gt;
&lt;li&gt;Deploying to Kubernetes with Minikube and Cyclops UI&lt;/li&gt;
&lt;/ul&gt;



&lt;h2&gt;
  
  
  Intorduction &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;This guide offers a comprehensive overview of the process involved in transitioning a Python application from a local development environment to a production-ready Kubernetes cluster. By leveraging Docker for containerization and Cyclops UI for simplified cluster management&lt;/p&gt;



&lt;h2&gt;
  
  
  Prerequisites &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What are we going to use&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A simple rag project built using langchain, google-gemini and streamlit. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker:&lt;/strong&gt; For containerizing the application and its dependencies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;minikube:&lt;/strong&gt; To simulate a Kubernetes cluster for local development and testing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;kubectl:&lt;/strong&gt; To interact with the Kubernetes cluster and manage deployed applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cyclops UI:&lt;/strong&gt; To simplify Kubernetes cluster management and application deployment.&lt;/li&gt;
&lt;li&gt;Gemini Api key&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ensure you have Docker, Minikube, and Kubectl installed on your system before proceeding with this guide.&lt;/p&gt;

&lt;p&gt;Project repo: &lt;a href="'https://github.com/md-abid-hussain/your-rag'"&gt;Github&lt;/a&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  Pizza shop analogy of docker, kubernetes and cyclopsui &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Docker: The Pizza Box&lt;/strong&gt; 🍕&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think of Docker as a perfect pizza box. It neatly packages your delicious pizza (application) with all its flavorful toppings (dependencies) to ensure a consistent taste (performance) no matter where you enjoy it. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Kubernetes: The Pizza Delivery Fleet&lt;/strong&gt; 🚚&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Kubernetes is like a fleet of speedy delivery cars. It manages and coordinates the delivery of your tasty pizzas (containers) to hungry customers (servers). It can even automatically add more delivery cars when the orders pile up!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cyclops UI: The Delivery Manager&lt;/strong&gt; 🧑‍💻&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cyclops UI is the savvy delivery manager overseeing the entire pizza operation. It helps you manage your fleet of delivery cars (Kubernetes cluster), track pizza orders (container status), and make adjustments to keep customers happy.&lt;/p&gt;



&lt;h2&gt;
  
  
  Dockerization of the RAG App &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;This section describes the process of containerizing your RAG application using Docker.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Required Libraries:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The application utilizes the following libraries:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;langchain&lt;/li&gt;
&lt;li&gt;langchain_community&lt;/li&gt;
&lt;li&gt;langchain-google-genai&lt;/li&gt;
&lt;li&gt;streamlit&lt;/li&gt;
&lt;li&gt;python-dotenv&lt;/li&gt;
&lt;li&gt;pymupdf&lt;/li&gt;
&lt;li&gt;faiss-cpu&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Default Port:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By default, the Streamlit application runs on port 8501.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dockerfile:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here's the provided Dockerfile with some enhancements:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="c"&gt;# Base image with required Python version&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; python:3.12-slim-bookworm&lt;/span&gt;

&lt;span class="c"&gt;# Working directory for the application&lt;/span&gt;
&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /app&lt;/span&gt;

&lt;span class="c"&gt;# Copy requirements file&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; requirements.txt requirements.txt&lt;/span&gt;

&lt;span class="c"&gt;# Install dependencies based on requirements&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt

&lt;span class="c"&gt;# Copy all application files&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; . .&lt;/span&gt;

&lt;span class="c"&gt;# Expose Streamlit port (optional, depending on deployment scenario)&lt;/span&gt;
&lt;span class="k"&gt;EXPOSE&lt;/span&gt;&lt;span class="s"&gt; 8501&lt;/span&gt;

&lt;span class="c"&gt;# Run the Streamlit application&lt;/span&gt;
&lt;span class="k"&gt;CMD&lt;/span&gt;&lt;span class="s"&gt; ["streamlit", "run", "main.py"]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Dockerfile Breakdown:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The provided Dockerfile defines the steps to create a containerized version of your application. Here's a breakdown of each line:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Base Image:&lt;/strong&gt; &lt;code&gt;FROM python:3.12-slim-bookworm&lt;/code&gt; - This line specifies the base image for the container. We use &lt;code&gt;python:3.12-slim-bookworm&lt;/code&gt; because it provides a lightweight Python 3.12 environment.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Working Directory:&lt;/strong&gt; &lt;code&gt;WORKDIR /app&lt;/code&gt; - This sets the working directory within the container to &lt;code&gt;/app&lt;/code&gt;. This directory will hold all your application files.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Copy Requirements:&lt;/strong&gt; &lt;code&gt;COPY requirements.txt requirements.txt&lt;/code&gt; - This copies the &lt;code&gt;requirements.txt&lt;/code&gt; file, which lists all the Python libraries your application needs, into the container's &lt;code&gt;/app&lt;/code&gt; directory.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Install Dependencies:&lt;/strong&gt; &lt;code&gt;RUN pip install -r requirements.txt&lt;/code&gt; - This line installs all the required libraries listed in &lt;code&gt;requirements.txt&lt;/code&gt; using &lt;code&gt;pip&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Copy Application Files:&lt;/strong&gt; &lt;code&gt;COPY . .&lt;/code&gt; - This copies all files and directories from your current directory (where the Dockerfile resides) into the container's &lt;code&gt;/app&lt;/code&gt; directory. This includes your Python script (&lt;code&gt;main.py&lt;/code&gt;), models, and any other application files.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Expose Port (Optional):&lt;/strong&gt; &lt;code&gt;EXPOSE 8501&lt;/code&gt; (Optional) - This line exposes port 8501, which is the default port used by the Streamlit application. This allows you to access the application from outside the container if needed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Run Streamlit:&lt;/strong&gt; &lt;code&gt;CMD ["streamlit", "run", "main.py"]&lt;/code&gt; - This sets the default command for the container. It instructs the container to run &lt;code&gt;streamlit run main.py&lt;/code&gt; when it starts, launching your Streamlit application.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Building the Docker Image:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To create the Docker image for your RAG application, run the following command in your terminal (replace &lt;code&gt;your-rag&lt;/code&gt; with your desired image name):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker build &lt;span class="nt"&gt;-t&lt;/span&gt; your-rag &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Running the app&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Locally&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;streamlit run main.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Using Docker&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nv"&gt;GOOGLE_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;your_gemini_api_key &lt;span class="nt"&gt;-p&lt;/span&gt; 8501:8501 your-rag
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now your app is running:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdnp6gwo068r7wk5r822d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdnp6gwo068r7wk5r822d.png" alt="RAG app ui" width="800" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Upload and chat with document.&lt;/p&gt;



&lt;h2&gt;
  
  
  Deploying to Kubernetes with Minikube and Cyclops UI &lt;a&gt;&lt;/a&gt;&lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Installing Cyclops UI and running it locally&lt;/strong&gt;&lt;br&gt;
Make sure minikube and kubectl are installed and running. Installation guide for cyclops can be found at &lt;a href=""&gt;Cyclops Docs&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To install Cyclops in your cluster, run commands below:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; https://raw.githubusercontent.com/cyclops-ui/cyclops/v0.8.2/install/cyclops-install.yaml &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; https://raw.githubusercontent.com/cyclops-ui/cyclops/v0.8.2/install/demo-templates.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;To run cyclops, run command below:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl port-forward svc/cyclops-ui 3000:3000 &lt;span class="nt"&gt;-n&lt;/span&gt; cyclops
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Cyclops UI is now running at &lt;a href=""&gt;http://localhost:3000&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fac3wn7omo5jge8hwa6sf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fac3wn7omo5jge8hwa6sf.png" alt="Cyclops UI running at localhost" width="800" height="392"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Steps to deploy app&lt;/strong&gt;&lt;br&gt;
The docker image of app is already published at docker hub &lt;a href=""&gt;hub.docker.com/mdabidhussain/your-rag&lt;/a&gt;. You can also use this image or create one and publish to docker hub by following documentation. &lt;a href=""&gt;Docker Workshop&lt;/a&gt;. It will be great if you try to deploy your own dockerize application&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click on button &lt;strong&gt;Add module&lt;/strong&gt; and new page will open
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsq3wz9fzenbjghaqons1.png" alt="Module section" width="800" height="390"&gt;
&lt;/li&gt;
&lt;li&gt;In module select drop down select &lt;strong&gt;app-template&lt;/strong&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fntmrbauoeu41fbiasozw.png" alt="Screen after selecting app-template" width="800" height="375"&gt;
&lt;/li&gt;
&lt;li&gt;Add name for module&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;general&lt;/strong&gt; options under &lt;strong&gt;Define Module&lt;/strong&gt; section. Fill the name of image you want to use (&lt;code&gt;mdabidhussain/your-rag&lt;/code&gt; in this case) and the tag of that image you want to use (&lt;code&gt;latest&lt;/code&gt; in this case). Add environment variables if needed (in this case we need &lt;code&gt;GOOGLE_API_KEY&lt;/code&gt;)
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8u34r8z1ug4uofnl1r0u.png" alt="Configuration for app" width="800" height="381"&gt;
&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Scaling&lt;/strong&gt; options add the necessary scaling configuration. For this app I have gone with default.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsf4wqzi6w3aw26eyzgsy.png" alt="Scaling config" width="800" height="302"&gt;
&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Network&lt;/strong&gt; option expose the port on which your app run (&lt;code&gt;8501&lt;/code&gt; in this case for streamlit app).
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz5nc0eg43sl20nzmtdrg.png" alt="Network configuration" width="800" height="314"&gt;
&lt;/li&gt;
&lt;li&gt;Finally click on &lt;strong&gt;Save&lt;/strong&gt; button.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftoks6luoe4lwc3u39vrt.png" alt="Module created" width="800" height="455"&gt;
Module status will updated to green if you have properly configure the app deployment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now all that is left is to expose &lt;code&gt;your-rag&lt;/code&gt; application outside the cluster:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl port-forward svc/your-rag 8501:8501
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which follow syntax like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl port-forward svc/&amp;lt;module_name&amp;gt; &amp;lt;port_to_exposed&amp;gt;:&amp;lt;port_to_map&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now your application is running on &lt;a href=""&gt;localhost:8501&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdnp6gwo068r7wk5r822d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdnp6gwo068r7wk5r822d.png" alt="RAG app ui" width="800" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Upload document and chat.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>kubernetes</category>
      <category>cyclopsui</category>
      <category>python</category>
    </item>
  </channel>
</rss>
