DEV Community

Mohammad Sami shaikh
Mohammad Sami shaikh

Posted on

NeuroPulse a ai/ml chatbot

Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady Submission 🦥

NeuroPulse: The Sloth's Guide to Mastering AI/ML with 100% Local Open-Source AI

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady


What I Built

Keeping up with Artificial Intelligence and Machine Learning feels like a full-time job. Between 80-page whitepapers, convoluted mathematical equations, 3-hour video tutorials, and endless forum debates, understanding even basic concepts like backpropagation, contrastive loss, or transformer attention usually takes hours of digging.

In honor of International Sloth Day and this week’s "Slow and Steady" challenge, I built NeuroPulse — a local, privacy-first Retrieval-Augmented Generation (RAG) assistant designed to reward intellectual laziness.

Instead of wading through dozens of open browser tabs, reading bloated medium articles, or paying monthly subscription fees to proprietary AI APIs, NeuroPulse does all the heavy reading for you. You ask a direct question, and it retrieves grounded knowledge from a curated vector database, validates the topic, and synthesizes a punchy, accurate answer with verifiable source citations — running 100% offline on your own machine.

Developers, students, and engineers who dread information overload get to be a whole lot lazier without falling behind.


Demo

NeuroPulse features both a clean, modern conversational web interface and a terminal CLI:

![NeuroPulse Chatbot Interface]


Code

The complete source code is open source under the MIT License:
https://github.com/Mohammad1sami/AI-ML-chatbot

Project Architecture at a Glance

AI Chatbot/
├── aiml_knowledge_base.csv       # 118 verified AI/ML knowledge entries & categories
├── chroma_langchain_db/          # Persistent local Chroma vector database
├── chroma_langchain_db.csv.sha256# SHA-256 change detector for zero-waste indexing
├── vector.py                     # Chunking, mxbai embeddings, and Chroma retriever setup
├── server.py                     # FastAPI server with SSE streaming & REST endpoints
├── main.py                       # CLI interactive runner
└── static/                       # Fast, minimalist frontend (HTML5/CSS3/Vanilla JS)
    ├── index.html
    ├── style.css
    └── app.js
Enter fullscreen mode Exit fullscreen mode

How I Built It

NeuroPulse is built exclusively on top of open-source AI and open-weight models — no closed cloud endpoints or commercial APIs:

1. The Open-Weight AI Stack

  • Open-Weight Reasoning & Generation: Meta's Llama 3.2 (llama3.2), executed locally via Ollama. Llama 3.2 provides exceptional reasoning and conversational capabilities while running comfortably on consumer laptop hardware.
  • Open-Weight Embeddings: mxbai-embed-large (Mixedbread AI via Ollama). A top-tier, high-dimensional open embedding model tailored for dense retrieval tasks.
  • Open-Source Vector Database: ChromaDB (langchain-chroma), persisted directly to disk in ./chroma_langchain_db.
  • RAG Orchestration: LangChain (langchain-ollama, langchain-text-splitters, langchain-core) chaining the prompt templates, topic classification, and document retrieval.
  • Backend API: FastAPI & Uvicorn with asynchronous Server-Sent Events (SSE) streaming and REST endpoints.

2. Dual-Stage Guardrail Pipeline

To keep things fast and prevent hallucinated ramblings, the system implements two LangChain chains:

  1. Topic Classifier Chain: Uses llama3.2 to classify whether the incoming query is genuine AI/ML. Unrelated questions (sports, celebrity gossip, recipes) are politely deflected before doing expensive vector math.
  2. Context-Grounded Answer Chain: Constrains the model strictly to verified context chunks retrieved from ChromaDB, ensuring direct and accurate answers.
# Automatic SHA-256 change detection: only re-index when your knowledge base edits!
with open("aiml_knowledge_base.csv", "rb") as f:
    csv_hash = hashlib.sha256(f.read()).hexdigest()

if csv_hash != previous_hash:
    # Split, embed with mxbai-embed-large, and persist into ChromaDB
    chunks = splitter.split_documents(source_documents)
    vector_store.add_documents(documents=chunks, ids=ids)
    with open(HASH_PATH, "w", encoding="utf-8") as f:
        f.write(csv_hash)
Enter fullscreen mode Exit fullscreen mode

Why Does Open Innovation Matter?

Open innovation is what makes this project practical, trustworthy, and sustainable:

  1. Zero Cost & Infinite Free Queries: Proprietary LLM APIs charge per token. A developer querying an API 200 times a day faces monthly bills and credit card limits. With open-weight models via Ollama and ChromaDB, the marginal cost per query is exactly $0.00.
  2. 100% Offline & Absolute Privacy: Many developers and researchers study proprietary algorithms or confidential datasets. Because NeuroPulse runs completely on localhost, no prompt, question, or document ever leaves the device. It functions seamlessly on an airplane, in a remote cabin, or behind strict enterprise firewalls with zero internet connection.
  3. Auditability & Explainability: Closed AI systems are black boxes that frequently change their behavior without warning. With an open CSV dataset, open embeddings, and inspectable ChromaDB vectors, every answer points back to a transparent source topic and row ID.
  4. No Vendor Lock-In: If a newer open-weight model drops tomorrow (like Mistral, DeepSeek, or Gemma), swapping it in takes a single line change in server.py (model = OllamaLLM(model="new-model")).

The Lazy Payoff

Here is the sloth math on how much effort NeuroPulse saves:

  • Searching 15 Browser Tabs vs. 1 Query: Traditional research for a concept like L1 vs. L2 Regularization requires searching Google, skipping sponsored ads, dodging cookie popups, and parsing multiple contradictory StackOverflow answers (typically 12–18 minutes). NeuroPulse delivers the synthesized definition and mathematical trade-off in under 3 seconds.
  • Automated SHA-256 Knowledge Maintenance: You never have to manually rebuild vector indexes or run maintenance scripts. The lazy system checks file hashes on startup — if the CSV hasn't changed, it boots instantaneously using the cached index.
  • Estimated Savings: Over a week of studying machine learning topics, asking 10 questions a day saves approximately 2 hours of reading fluff and tab clutter.

Prize Categories

  • Open-Source AI / Open Weights Track (Powered by Ollama, Llama 3.2, mxbai-embed-large, ChromaDB, and LangChain)
  • Slow and Steady (Week 3 Challenge)

Built with ❤️ for Hacktoberfest 2026. Happy Sloth Day — work less, build open, and let the local models do the heavy lifting!

Top comments (0)