kbot_app

Version 1.1 (1.79 KB) by Selva Karna
kbot_app Basic: 🧠 🔥 What this KBot Demo Will Do ✔ Ask questions about standards ✔ Validate simple “drawing data” (JSON input) ✔ Show erro
1 Download
Updated 3 Apr 2026

View License

🧠 🔥 What this KBot Demo Will Do
✔ Ask questions about standards
✔ Validate simple “drawing data” (JSON input)
✔ Show errors + suggestions
✔ Run locally in browser
🏗 Tech Used
  • Streamlit → UI
  • Python → logic
  • Optional: OpenAI / local LLM later
📦 Step 1: Install Requirements
Open terminal:
pip install streamlit
▶ Step 3: Run the App
streamlit run kbot_app.py
🎯 What You Can Test
🔹 QC Check Tab
Enter:
  • Tolerance = 0.8
  • GD&T = No
  • Material = empty
👉 You’ll see errors like real QC tool
🔹 Ask KBot Tab
Try:
  • “What is tolerance?”
  • “Weld specification?”
Pseudo code;
import streamlit as st
st.set_page_config(page_title="KBot Demo", layout="wide")
st.title("🤖 KBot - CAD Standards Assistant (Demo)")
# ------------------------------
# Sample CAT Rules (Basic)
# ------------------------------
def check_rules(data):
errors = []
# Rule 1: Tolerance check
if data["tolerance"] > 0.5:
errors.append("❌ Tolerance too high (Max allowed: 0.5)")
# Rule 2: GD&T present
if not data["gdt"]:
errors.append("❌ Missing GD&T symbol")
# Rule 3: Material defined
if data["material"] == "":
errors.append("❌ Material not specified")
return errors
# ------------------------------
# UI Tabs
# ------------------------------
tab1, tab2 = st.tabs(["📊 QC Check", "💬 Ask KBot"])
# ------------------------------
# QC CHECK TAB
# ------------------------------
with tab1:
st.header("Auto QC Check")
tolerance = st.number_input("Tolerance", value=0.3)
gdt = st.selectbox("GD&T Present?", ["Yes", "No"])
material = st.text_input("Material")
if st.button("Run QC Check"):
input_data = {
"tolerance": tolerance,
"gdt": True if gdt == "Yes" else False,
"material": material
}
errors = check_rules(input_data)
if errors:
st.error("QC FAILED ❌")
for e in errors:
st.write(e)
else:
st.success("QC PASSED ✅")
# ------------------------------
# KBot CHAT TAB
# ------------------------------
with tab2:
st.header("Ask KBot")
question = st.text_input("Ask about standards")
if question:
if "tolerance" in question.lower():
st.write("📘 Standard: Max tolerance = 0.5 mm")
elif "weld" in question.lower():
st.write("📘 Weld Spec: Fillet weld 6mm recommended")
elif "gdt" in question.lower():
st.write("📘 GD&T required for critical dimensions")
else:
st.write("🤖 KBot: Standard not found in demo DB")

Cite As

Selva Karna (2026). kbot_app (https://se.mathworks.com/matlabcentral/fileexchange/183559-kbot_app), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2025b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Version Published Release Notes
1.1

1.1

1.0.0