How to Build a Private AI Assistant on Windows: Integrating LLMs with a Collaboration Platform
This guide walks through building a private AI assistant on Windows by integrating a large language model with a team collaboration platform. It breaks the system into four layers—model inference, collaboration entry point, local runtime, and configuration/credential management—and explains why you should first confirm the model can respond before connecting the platform. You will find practical steps for preparing model API credentials, configuring a self-built app and long-connection event subscription on the platform, choosing a native terminal environment, installing dependencies, fixing common PATH and permission errors, and running an acceptance checklist, along with security and cost-control recommendations.
1. Breaking Down the Requirements: What Layers Make Up a “Private AI Assistant”
Many people treat building an AI assistant as “installing a piece of software,” then get stuck during actual deployment. The root cause is that they never separate the system into layers first. A private assistant that genuinely works in daily tasks usually consists of four layers:
- Model inference layer: Responsible for natural language understanding and generation. It needs a callable large model service and a valid access credential (API Key).
- Collaboration entry layer: The place where you talk every day, such as the instant collaboration platform your team commonly uses. To make the assistant “show up in the group,” it must connect to the platform as an application.
- Local runtime layer: A gateway/orchestration process running on your own computer. It receives platform events, assembles prompts, calls the model, and writes results back.
- Configuration and credential management layer: Credentials, allowlists, logs, rate limiting, and failure retries.
The approach in the original text is essentially correct: first make sure “the model can reply,” then make sure “the platform can receive the reply.” These two things are independent of each other. If either one is missing, the final symptom is “the assistant stays silent,” but the troubleshooting direction is completely different. The sections below follow this order.
2. Step 1: Prepare the Model Conversation Capability
Before you start on Windows, get the model side ready first. This is a hard prerequisite for a minimum viable system.
- Register an account on any compliant model service platform and create an access credential. Most platforms use prepaid or pay-as-you-go billing, so a small top-up for joint debugging is enough to avoid large charges at the start.
- The credential is sensitive information. Keep it only in local environment variables or a local configuration file. Do not commit it to a code repository, and do not paste it into a chat window.
- If a platform has unstable network latency, you can switch to another model service that provides a compatible interface, such as general-purpose large model services like Qwen, Kimi, or Doubao. The key is not which one you choose, but making sure “the model side can return one conversation normally.”
It is recommended to do a “minimum command-line verification” first to confirm the credential works before moving on:
# Note: request body fields differ slightly across platforms; this only shows the call shapecurl -X POST "$MODEL_ENDPOINT/chat/completions" \-H "Authorization: Bearer $MODEL_API_KEY" \-H "Content-Type: application/json" \-d '{"model":"<model name>","messages":[{"role":"user","content":"Hello"}]}'
Getting a normal reply means the model layer is ready.
3. Step 2: Prepare the Application on the Collaboration Platform Side
The work on the collaboration platform side cannot be done by any local tool. You must do it yourself in the developer console. This is the most underestimated part of the whole process:
- Register a collaboration platform account and create a self-built organization (the free tier for personal use is usually enough).
- Create a self-built application in the developer console and obtain the application credentials.
- Enable message-related permissions, especially read-only permissions like “read @bot messages in groups.” When permissions are insufficient, the typical symptom is that events are received but the content is empty.
- Configure event subscription. For a personal test environment, prefer the long-connection mode to avoid the hassle of a public callback address and port mapping.
- Confirm the long-connection status shows “connected,” then do the first pairing to bind the local gateway to the application.
The original text mentions that a single wrong permission identifier breaks the entire chain. This reminder is critical: the permission name, event type, and subscription status must all align at the same time. Missing any one of them shows up as “the bot ignores people.”
4. Step 3: Choosing a Local Runtime Environment
On Windows there are usually three options, each with trade-offs:
- Unix-like subsystem option: Good isolation and smooth dependency installation, but network isolation brings proxy pass-through and port forwarding problems, making troubleshooting costly. Not suitable for a first attempt.
- Native command-line terminal option: Directly reuses the Windows network with intuitive configuration; the cost is that you must manually handle runtime dependencies, native module compilation, and Windows-specific permission issues.
- GUI-based intelligent coding/assistant client: Automatically installs the runtime and basic dependencies, and the model side can be configured with a few clicks; but the platform side still has to be configured by yourself, and if the underlying dependencies come from overseas sources, installation can also get stuck.
For most people, the native terminal option is the most cost-effective choice. The complete steps below follow this path.
5. Step 4: Install Basic Dependencies and Solve “Slow Downloads”
You need three things: the Node.js runtime, the Git version control tool, and the assistant itself (installed via a package manager).
- Choose the LTS (Long-Term Support) version for the runtime, and check “Add to PATH” during installation.
- Use the official installer for Git; the default options are fine.
- When downloads are slow, do not retry repeatedly. Switch to a mirror registry directly—this is the most effective move:
npm config set registry https://registry.npmmirror.comnpm config get registry
Install the assistant itself:
npm install -g openclaw
Verify after installation:
node -vnpm -vopenclaw --version
6. Step 5: Troubleshooting Environment Variables and Permission Errors
The “npm command not found” issue in the original text is an extremely typical problem. The root cause is that the global directory is not in PATH. The steps to handle it:
- Press
Win + R, typesysdm.cpl, then go to “Advanced” → “Environment Variables.” - In user variables, find
Path, edit it, and add a new entry for the global package directory, in the form:
C:\Users\<your username>\AppData\Roaming\npm
- After saving, reopen the terminal (old windows do not refresh environment variables automatically).
- Run the terminal as administrator to avoid being denied when compiling native modules or writing to protected directories.
If native module compilation fails during installation, install the build toolchain for the corresponding platform first, then retry. If it still fails, switch to a precompiled package or downgrade the runtime major version.
7. Step 6: Joint Debugging and Acceptance Checklist
Accept in order, so that any problem can be quickly located to a layer:
- The model side returns a conversation via the command line;
- The platform side shows the long connection as connected;
- The application has the group message read-only permission enabled;
- The credentials in the local gateway configuration match the platform;
- @bot in the group gets a reply;
- The log service shows request and response records.
8. Security and Cost Recommendations
- Keep credentials local, inject them via environment variables, and rotate them regularly.
- Restrict the assistant to specific groups and a user allowlist to avoid being pulled into unrelated groups and incurring charges.
- Add a layer of rate limiting and timeout retries on the gateway side to prevent model-side jitter from triggering an avalanche.
- Connect runtime logs to a local log file for easy review; if multiple people need to share it, then consider migrating to a cloud container platform with monitoring and alerting capabilities.
Following this path, it is realistic for an ordinary Windows user to complete deployment within an hour. The real difficulty has never been the installation commands, but the method of locating problems by layer: if the model does not work, check the credentials; if the platform does not work, check permissions and subscription; if the local side does not work, check PATH and the compilation environment.
