← Back to Part 1

Local AI Architecture Deep Dive / Part 2

The Backend Bridge: Connecting Web to Local Intelligence

Discover how the Signal Share Super Suite bridges the gap between a standard web browser and powerful local AI inference engines like LM Studio and Ollama.

Node.js / Express

1. Node.js Orchestration

While the Signal Share frontend runs in your browser, it cannot directly control your operating system or talk to local servers without bypassing security restrictions. To solve this, we use a Local Bridge Server written in Node.js.

sequenceDiagram participant Browser as Web Browser (Frontend) participant Node as Node.js Bridge (Backend) participant LLM as LM Studio / Ollama participant OS as Windows Media (PowerShell) Browser->>Node: POST /api/llm/chat (Message + Context) Node->>LLM: Proxy Request (Inference) LLM-->>Node: AI Reply (with [TOOLS]) Node->>OS: Execute System Commands Node-->>Browser: Final AI Response
API Integration

2. The LLM API Pipeline

The backend module chatbot.js handles the intelligence fallback. It attempts to connect to local servers in a prioritized sequence:

// prioritized connection logic try { const response = await fetch('http://localhost:1234/v1/chat/completions'); // LM Studio } catch (e) { const response = await fetch('http://localhost:11434/api/chat'); // Ollama Fallback }
System Control

3. The PowerShell Media Bridge

One of the most powerful features of the Signal Share AI is its ability to control your hardware. We use PowerShell scripts triggered by the Node.js server to interact with the Windows Runtime (WinRT) media controls.

# Backend executes this to control Spotify/System media Start-Process "spotify:search:Kendrick Lamar" # Or triggers system keys like Next/Previous

This allows the AI to perform physical actions on your computer that a normal website simply cannot do, effectively turning the Companion into a system-level assistant.

Back to Part 1 Next: AI Tools & Context →