smallgavin / pi-device-diagnostic
git clone https://github.com/smallgavin/pi-device-diagnostic.git
基于 Pi Agent 的边缘设备诊断 PoC
+33
stars, 24h · #255
+33
stars, 7 days · #1,240
+33
stars, 30 days · #8,325
33
★ total · +33% this week
0
forks · 0 open issues
Star history starts 2026-10-20; the chart appears after the second daily snapshot.
LanguageTypeScript
License—
Created2026-10-19 (1d ago)
Last pushtoday
Watchers0
OwnerUser
Links
README excerpt
# Pi Edge Device Diagnostic Agent PoC **Pi Agent Core + TypeScript/Node.js · 6 read-only tools · 5 mock diagnostic cases.** Ask about a simulated edge device, watch the agent inspect observations, and get an evidence-backed diagnosis. This is a personal technical feasibility PoC built with Pi Agent Core and Pi AI. > **Scope:** I do not currently have a real NVIDIA Jetson. Telemetry, processes, logs, and changes are mock data; this project has not been validated on real hardware. ## Web UI preview These screenshots were captured from the running local web app with the `thermal` mock case. They show the **scripted offline mode**: Pi executes the tools and returns observations, while the next tool choice is scripted. They do not represent a live Jetson or an LLM reasoning benchmark. The dashboard lets you choose a case, inspect its simulated telemetry, and ask a diagnostic question. After running the thermal case, the result panel reports high-temperature throttling with evidence and human-operated recommendations. The trace lists the four read-only tools called in this offline run. It shows tool observations, not private model reasoning. ## Try it locally With Node.js **>=22.19**, you can explore the five mock cases without an API key: [code] Open `http://127.0.0.1:4173`, select a case, and click **运行诊断**. The default **离线演示** mode is scripted; live model setup is optional and still uses mock device data. ## Tech stack at a glance | Role | Technology | Used for | | --- | --- | --- | | Agent harness | **Pi Agent Core** (`@earendil-works/pi-agent-core`) | Agent loop, tool calls, in-memory sessions, events, and safety hooks | | Model integration | **Pi AI** (`@earendil-works/pi-ai`) | DeepSeek/OpenAI live providers and a scripted offline provider | | Backend | **TypeScript + Node.js** | Agent, tools, mock simulator, local HTTP API, CLI, and evaluation runner | | Data contracts | **TypeBox** | Tool and report schemas with runtime validation | | Browser demo | Plain JavaScript, HTML, and CSS | Local interface for trying the same backend agent | The agent receives a question, calls a read-only mock tool, observes its result, and chooses whether to investigate further or return a diagnosis. The live model makes those choices through Pi's agent loop; the offline demo follows a scripted observation consumer. See `src/agent.ts` for the Pi session and `src/tools.ts` for the tool boundary. ## Why this project I have used LangChain `create_agent` and Deep Agents. Here I want to inspect a smaller agent harness directly: tool calling, observation-driven next steps, session reuse, termination, tool errors, and a strict read-only capability set. ## Why Edge Device Diagnostics Inference latency can worsen for different reasons that look similar in a user report. Temperature, memory, storage, and software changes provide distinct evidence paths. A diagnostic agent is a useful way to test whether the next inspection follows the latest observation instead of a single