株式会社オブライト
AI2026-03-04

Building an Internal Chatbot with Qwen3.5-9B: Zero-Cost AI Assistant Development Guide

A comprehensive guide to building a zero-cost internal chatbot using Qwen3.5-9B. Covers architecture design with vector databases, Gradio/Streamlit web UI construction, system prompt engineering for business use, conversation memory management, RAG-based document Q&A integration, Slack/Teams/LINE connectivity, multi-turn dialogue optimization, response quality tuning, deployment options, and monitoring strategies.


Why Local Chatbots Are Gaining Momentum

Enterprise demand for internal chatbots continues to grow, but cloud API-powered chatbots face three persistent challenges: escalating costs from pay-per-use pricing, privacy risks from sending data to external servers, and service outages during internet disruptions. With the arrival of Qwen3.5-9B, local chatbots that solve all three problems have become a practical reality. Running on just 5GB of RAM while outperforming previous-generation 30B models, Qwen3.5-9B operates completely offline on in-house PCs or servers. For businesses in Shinagawa and Minato Ward automating customer inquiries that involve proprietary information and trade secrets, a local chatbot that never transmits data externally is the optimal solution. This article provides a hands-on guide to designing, building, and operating an internal chatbot powered by Qwen3.5-9B.

Architecture Design: Qwen3.5-9B + Vector DB + Web UI

An effective internal chatbot architecture consists of three core components. First, Qwen3.5-9B serves as the backend inference engine, deployed as an API server via Ollama or llama.cpp. Second, a vector database (ChromaDB, Qdrant, or Milvus) stores vectorized representations of internal documents. Third, a web frontend built with Gradio or Streamlit provides the user interface. This three-layer architecture enables a RAG (Retrieval-Augmented Generation) pipeline: user questions first trigger a vector similarity search in the database to retrieve relevant document chunks, which are then passed as context to Qwen3.5-9B for answer generation. SaaS companies in Shibuya and consulting firms in Setagaya Ward are increasingly adopting this architecture for internal knowledge search systems. Managing all components through Docker Compose significantly simplifies both initial setup and ongoing operations.

Building the Web Frontend with Gradio/Streamlit

The chatbot user interface can be built quickly using Python's Gradio or Streamlit frameworks. With Gradio, the "gr.ChatInterface" component enables a complete chat UI implementation in roughly 20 lines of Python code. The backend simply sends HTTP requests to the Ollama API and displays streaming responses. With Streamlit, combine "st.chat_message" and "st.chat_input" components to construct the interface. Streamlit's advantage lies in its sidebar capability, where you can place system prompt editing panels and model parameter adjustment sliders (temperature, top_p, etc.). Both frameworks require only standard Python knowledge, making them accessible for IT staff at SMBs in Shinagawa and Ota Ward to deploy in relatively short timeframes. When authentication is required, Gradio's "auth" parameter or Streamlit's st-authentication module enables password-based access control.

System Prompt Engineering for Business Use

System prompt design significantly determines chatbot response quality. For business applications, start by clearly defining the bot's role (e.g., "You are the internal IT helpdesk assistant for [Company Name]"). Next, establish response style guidelines specifying formality level, target response length, and policies for explaining technical terminology. Critically important is defining fallback behavior for unanswerable questions. Instructions like "If you don't know the answer, honestly say 'Let me connect you with the relevant department'" significantly reduce hallucination risk. Security rules for handling confidential information (e.g., never output personal names, never reference salary data) should also be embedded in the prompt to mitigate security risks. Financial companies in Minato Ward and telecommunications firms in Shinagawa have established processes where legal departments collaborate on system prompt development. Regular prompt reviews and updates enable continuous improvement of answer quality over time.

Conversation Memory Management: Optimizing Multi-Turn Dialogue

Natural chatbot dialogue requires effective conversation memory management. The simplest approach is the "sliding window" method, including the most recent N conversation turns in the context. Qwen3.5-9B's 262K context window can accommodate extensive conversation history, but since inference speed decreases with context length, limiting to the last 10-20 exchanges is practical for business use. A more sophisticated approach is "summary memory," which automatically generates and maintains conversation summaries. This preserves important information from long sessions in compressed form, balancing memory efficiency with contextual understanding. Frameworks like LangChain and LlamaIndex provide built-in implementations of these memory management patterns, requiring minimal code. Customer service companies in Shibuya and Meguro Ward have reported significant improvements in customer interaction quality through conversation memory optimization.

Building a Document Q&A System with RAG

RAG (Retrieval-Augmented Generation) dramatically enhances chatbot utility for enterprise applications. Internal documents—manuals, FAQs, meeting minutes, policy documents—are split into chunks of approximately 500-1000 tokens, vectorized using an embedding model, and stored in a vector database. User questions are vectorized with the same embedding model, and cosine similarity search retrieves the top 3-5 most relevant chunks. These chunks are included in Qwen3.5-9B's prompt to generate answers grounded in company-specific information. Recommended embedding models with Japanese support include BGE-M3 and Multilingual-E5-Large. Companies in Shinagawa have loaded thousands of pages of internal manuals into RAG systems, automating new employee onboarding queries and achieving 30% reductions in training costs. Manufacturing firms in Ota Ward have also seen strong results applying RAG to technical document search.

Integrating with Slack, Teams, and LINE

Connecting your chatbot to communication tools employees use daily dramatically increases adoption rates. For Slack integration, use Slack Bolt (Python SDK) to create a Bot App that triggers Qwen3.5-9B API requests on mentions (@bot) or direct messages. Configure event subscriptions in Slack's App Manifest for real-time channel responses. For Microsoft Teams, Bot Framework SDK with Azure Bot Service is the standard approach. To leverage local inference, use ngrok or Cloudflare Tunnel to temporarily expose internal servers, or utilize Teams Webhooks. For LINE integration, build a webhook server combining the LINE Messaging API with Flask or FastAPI. B2C companies in Shinagawa and Minato Ward building customer-facing LINE Bots appreciate Qwen3.5-9B's ability to protect customer data through local inference. Educational institutions in Setagaya Ward have built systems that handle student inquiries 24/7 through LINE Bot interfaces.

Response Quality Tuning and Prompt Engineering

Here are tuning techniques to improve chatbot response quality. Temperature parameter adjustment is essential: use low temperature (0.1-0.3) for FAQ and fact-verification responses, and higher temperature (0.7-0.9) for creative suggestions and brainstorming. A top_p (nucleus sampling) value around 0.9 generally produces stable output. To control response formatting, include explicit constraints in the system prompt such as "Summarize your answer in 3 bullet points" or "Respond concisely within 200 characters." Few-shot prompting—including examples of ideal Q&A pairs in the system prompt—dramatically improves output style consistency. Marketing agencies in Shibuya have prepared 10 few-shot example patterns aligned with brand tone to achieve response uniformity. IT companies in Meguro Ward have incorporated technical support response templates as few-shot examples, achieving both accuracy and consistency in their support bot's answers.

Deployment Options: On-Premises Server and Docker

Production chatbot deployment typically follows one of two approaches: on-premises server or Docker-based. The on-premises approach installs Ollama or vLLM on physical servers or virtual machines, running as systemd services for persistent operation. This approach offers simple network configuration and direct IT administrator control. The Docker approach defines four services in docker-compose.yml—model server (Ollama), web frontend (Gradio/Streamlit), vector database (ChromaDB), and reverse proxy (Nginx)—launching everything with "docker compose up -d." Docker's advantages include high environment reproducibility and straightforward backup and migration. For systems integration companies in Shinagawa managing customized chatbots for multiple clients, Docker Compose-based configurations offer superior efficiency. For manufacturing companies in Ota Ward, operation on air-gapped factory networks is also possible. SSL certificate configuration and firewall rules are essential considerations for production deployments.

Monitoring, Logging, and Continuous Improvement

Post-launch chatbot operations require robust monitoring and logging infrastructure. At minimum, record all question-answer pairs with timestamps to files or databases. This log serves as an essential data source for evaluating and improving response quality. For inference performance monitoring, the Prometheus and Grafana combination effectively provides real-time dashboards displaying response time, token generation speed, and memory usage. Implementing user feedback mechanisms (thumbs up/down buttons) and regularly reviewing low-rated responses enables continuous improvement of system prompts and RAG documents. Financial companies in Minato Ward conduct weekly log reviews, establishing PDCA cycles that improve answer accuracy by 5-10% monthly. Customer support companies in Shibuya have expanded FAQ documents based on log analysis, raising chatbot self-resolution rates above 80%.

Let Oflight Inc. Build Your Internal AI Chatbot

Struggling to figure out where to start with an internal chatbot? Looking to build an AI-powered search system leveraging your existing FAQs and manuals? Need an AI assistant integrated with Slack, Teams, or LINE? Oflight Inc., headquartered in Shinagawa Ward, provides end-to-end internal chatbot planning, design, development, and operations for businesses across Minato, Shibuya, Setagaya, Meguro, and Ota Ward throughout Tokyo. From RAG system construction and communication tool integration to prompt engineering and operational monitoring infrastructure, our experienced expert team provides thorough, hands-on support at every stage. Contact us for a free consultation to get started. Our team is ready to help you build an AI chatbot that drives operational efficiency and elevates customer service quality for your organization.

Feel free to contact us

Contact Us