Introduction: The Edge AI Bottleneck
The Intel Neural Compute Stick 2 (NCS2) is a powerful USB accelerator that brings deep learning inference to edge devices like Raspberry Pi, NVIDIA Jetson, or even a standard laptop. With a peak performance of up to 1 TFLOPS (FP16) and support for OpenVINO™ toolkit, it can run real-time object detection, pose estimation, and classification without cloud dependence. Yet, taming this hardware remains a challenge: you must set up OpenVINO, write inference pipelines, handle camera streams, and integrate results into your automation workflows. Every change — swapping a model, adjusting a threshold, adding a new trigger — requires manual code editing.
What if you could simply tell an AI agent what you need, and it writes, deploys, and runs the entire integration? That is exactly what ASI Biont does. In this article, we show how to connect the Intel Neural Compute Stick to ASI Biont's AI agent using SSH, enabling you to execute edge inference on demand, react to detections in real time, and automate actions — all through a chat conversation.
Why Connect an NCS to an AI Agent?
An AI agent like ASI Biont does not replace the NCS; it orchestrates it. Typical manual workflow:
- Write an OpenVINO Python script for object detection.
- Hardcode the model path, confidence threshold, and output display.
- Manually trigger it each time you need detection.
- Parse logs to get results and manually act (e.g., send a notification).
With ASI Biont:
- You describe the task: "When a person is detected on the Raspberry Pi camera, alert me via Telegram and log the timestamp."
- The AI agent generates a complete Python script that uses OpenVINO on the Pi, streams results back, and executes the action — in seconds.
- Integration happens via SSH, one of the many protocols ASI Biont supports out of the box.
The Connection Method: SSH via Paramiko
ASI Biont connects to any SSH-enabled device (Raspberry Pi, Jetson, Linux PC) using paramiko inside execute_python. The user provides the host IP, username, password (or key), and the AI agent writes a Python script that:
- Opens an SSH session to the remote machine.
- Checks if OpenVINO and the NCS are present.
- Optionally copies an inference script to the remote device.
- Runs the script and captures stdout/stderr.
- Returns the results directly to the chat.
This method is ideal for the NCS because the USB accelerator is attached to the remote host, and all inference happens locally on the edge. The sandbox in ASI Biont (cloud) only manages orchestration, never touching the raw hardware.
Real-World Use Case: Real-Time People Detection with Telegram Alerts
Scenario: You have a Raspberry Pi 4 with an Intel NCS2 and a USB camera mounted at your workshop entrance. You want to detect when a person enters and send you an instant Telegram message with the timestamp.
Step 1 – Tell the AI Agent
In the ASI Biont chat, write:
Connect to my Raspberry Pi at 192.168.1.100 via SSH (user: pi, password: raspberry). Detect people using the Intel NCS2 with OpenVINO's MobileNet-SSD model. If a person is detected, send me a Telegram alert to chat ID 123456789 using your Telegram bot token XXX. Run the detection every 10 seconds.
Step 2 – AI Generates the Integration
The agent immediately writes two scripts:
1. A remote inference script (detect_person.py) that runs on the Pi, loads the OpenVINO model, captures frames, and prints detection results.
2. An orchestration script (executed in the sandbox) that SSHs into the Pi, runs the inference script, parses the output, and triggers the Telegram alert.
Step 3 – Code Example (What the AI writes)
Below is an abbreviated version of the orchestration script that ASI Biont would generate. Note: this runs in the sandbox and uses only approved libraries.
import paramiko
import json
import time
from telegram_send import send_message # hypothetical; real code uses requests to Telegram API
def run_ssh_command(host, username, password, command):
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(host, username=username, password=password)
stdin, stdout, stderr = client.exec_command(command)
output = stdout.read().decode()
client.close()
return output
host = "192.168.1.100"
user = "pi"
password = "raspberry"
# First, ensure the remote script exists – we can SCP it using paramiko SFTP
transport = paramiko.Transport((host, 22))
transport.connect(username=user, password=password)
sftp = paramiko.SFTPClient.from_transport(transport)
sftp.put("detect_person.py", "/home/pi/detect_person.py") # local file generated by AI
transport.close()
# Now run inference once
command = "cd /home/pi && python3 detect_person.py --confidence 0.5"
result = run_ssh_command(host, user, password, command)
# Parse result – script outputs JSON like {"detections": [{"label": "person", "confidence": 0.87}]}
try:
data = json.loads(result)
for det in data.get("detections", []):
if det["label"] == "person":
send_message("Person detected! Timestamp: " + str(time.time()))
except Exception as e:
print("Parse error:", e)
The remote script detect_person.py would be a complete OpenVINO inference script. The AI also generates that:
# detect_person.py – runs on the Raspberry Pi
import cv2
import numpy as np
from openvino.runtime import Core
import sys, json
# Load model
ie = Core()
model = ie.read_model(model="ssd_mobilenet_v2_fp16.xml")
compiled_model = ie.compile_model(model, "MYRIAD") # MYRIAD = Intel NCS
# Open camera
cap = cv2.VideoCapture(0)
ret, frame = cap.read()
if not ret:
print(json.dumps({"error": "No frame"}))
sys.exit(1)
# Preprocess
input_tensor = np.expand_dims(cv2.resize(frame, (300, 300)).transpose(2,0,1), 0).astype(np.float32)
# Inference
result = compiled_model([input_tensor])
# Extract detections – simplified
output = result[0][0][0]
detections = []
for i in range(100):
conf = output[i, 2]
if conf > float(sys.argv[2]) if len(sys.argv)>2 else 0.5:
class_id = int(output[i, 1])
if class_id == 1: # person in COCO
detections.append({"label": "person", "confidence": float(conf)})
print(json.dumps({"detections": detections}))
cap.release()
Step 4 – Execution and Result
The sandbox runs the orchestration script, which SSHs into the Pi, runs detection, and sends a Telegram message. If the camera sees a person, you receive an alert. The AI agent shows the entire output in the chat, including any errors (e.g., missing model file), and you can then ask it to adjust the confidence threshold or schedule periodic runs.
Why This Integration is Revolutionary
- Zero manual coding of the integration layer. You don't write paramiko, parse JSON, or handle Telegram APIs. The AI does it all.
- Dynamic adaptation. Need to detect a different object? Just say: "Change detection to 'car' and increase confidence to 0.7." The AI updates both scripts instantly.
- One chat, any device. The same method works with MQTT, Modbus, HTTP APIs – any protocol ASI Biont supports. For the NCS, SSH is the natural fit, but if your host also exposes an HTTP API, you could use that instead.
Other Scenarios with Intel NCS
| Scenario | Connection | AI Agent's Role |
|---|---|---|
| Count people entering a room | SSH + camera | AI runs inference every minute, logs count to Google Sheets |
| Detect defects on assembly line | SSH with wired camera | AI triggers a siren (via MQTT to a PLC) if defect detected |
| Face recognition door unlock | SSH + NCS + relay | AI matches face to known database, sends command to relay board via COM port |
The AI agent seamlessly combines multiple protocols. For example, detection via SSH and then sending an unlock command via Modbus/TCP to a PLC is done in one script.
Getting Started
To integrate your Intel Neural Compute Stick with ASI Biont today:
- Connect your NCS to a Raspberry Pi or Linux machine and install OpenVINO. Ensure you can run a basic inference manually.
- Go to asibiont.com and sign up.
- Open the chat and describe your integration. For example: "Connect to my Raspberry Pi at 192.168.1.50, user pi, password 'hello'. Use the NCS to detect cats from the USB camera and send me a message on Telegram when one appears. My Telegram chat ID is 987654321, bot token is ABC123."
- Wait seconds. ASI Biont will generate the code, execute it, and start detecting. You see live results in the chat.
No need to write a single line of Python yourself. The AI agent understands OpenVINO, paramiko, and your hardware, bridging the gap between edge compute and intelligent automation.
Conclusion
The Intel Neural Compute Stick brings powerful edge inference to your projects, but managing it manually is tedious and error-prone. ASI Biont’s AI agent automates the entire integration: connecting via SSH, deploying inference scripts, parsing results, and triggering actions. With a chat-based interface, you can adapt your detection logic in real time, combine it with other devices, and focus on what matters — the problem you are solving, not the code.
Try it yourself: describe your NCS setup to ASI Biont at asibiont.com and see how fast an AI can turn your edge device into a smart, responsive system.
Comments