Inspiration

We were inspired by the gap between human intent and computer command. A user thinks, "My computer feels slow," but to act on that, they need to know a series of arcane commands: ps, top, grep, kill. Dashboards show data, but they don't take action. We wanted to bridge this gap.

With the release of OpenAI's gpt-oss models, we saw an opportunity to create a new OS layer—a conversational one. We envisioned a tool that could understand natural language, reason about the state of the system, and execute commands, all while running securely and privately on the user's local machine. Terai was born from this vision: to make system administration as simple as having a conversation.

What it does

Terai is a real-time system dashboard with a fully integrated, AI-powered local agent.

  1. Live System Dashboard: Terai provides a beautiful and responsive UI with live, real-time data on your system's CPU, memory, running processes, network connections, and file system. It's your single pane of glass for system observation.

  2. AI-Powered Local Agent: At its core is a powerful agent driven by the gpt-oss:20b model running 100% locally via Ollama. You can give it complex, multi-step commands in plain English, like "Find the process hogging my CPU and terminate it," or "Clear out any log files older than 90 days in my project folder."

  3. A Complete, Transparent Workflow: The agent shows its work. It will display its internal thought process, the exact shell script it plans to run, and ask for your permission before executing any potentially destructive commands (like rm or mv). You are always in control.

  4. Symbiotic UI Feedback: This is Terai's killer feature. The agent and the dashboard are not separate tools; they are one. When the agent successfully terminates a process, you will see it instantly disappear from the live process list and watch the CPU usage graph dip in real-time. This live feedback loop makes the system feel cohesive, powerful, and trustworthy.

How we built it

We chose a modern, high-performance, and secure tech stack to bring this vision to life, built on a "two-channel" backend architecture.

  • Core Framework: Tauri & Rust We used Tauri to create a lightweight, secure, and cross-platform desktop application. The entire backend is written in Rust for its unparalleled performance, memory safety, and ability to directly interface with the operating system.

  • Frontend: React & TypeScript The user interface is built with React and TypeScript, using Vite for a fast development experience. We used TailwindCSS for styling and Framer Motion to create a fluid and responsive user experience.

  • Backend Channel 1: The Real-Time Monitoring Service This part of the Rust backend is dedicated to feeding the UI with live data. We use powerful crates like sysinfo to get detailed process, CPU, and memory information, and netstat2 to inspect live network connections. This service runs on a constant loop, ensuring the dashboard is always up-to-date.

  • Backend Channel 2: The Agentic Service This is the AI core. When a command is invoked, our Rust backend uses reqwest to send a detailed meta-prompt to the local Ollama server. This prompt includes the user's task, the OS context, and a history of previous actions. The gpt-oss:20b model processes this and returns a structured JSON response containing its plan and a shell command. Our Rust backend then executes this command using std::process::Command, captures the raw stdout and stderr, and sends the result back to the agent for its next step.

Challenges we ran into

  1. Robust System Integration: An agent that relies on local services can't just assume they're running. We had to build a complete, resilient startup sequence in Rust. The app now automatically checks if the Ollama service is running, starts it in the background if it's not, verifies the required model exists, and even streams the model download progress from the ollama pull command's stderr directly to the UI, providing a seamless zero-config user experience.

  2. The Rust Borrow Checker: Interfacing with the sysinfo crate required careful state management. We ran into classic but challenging Rust lifetime and mutable borrow errors (E0499, E0597) when trying to refresh system data held within a global Mutex. We solved this by architecting our functions to correctly manage the lock's scope, perform the data refresh, and then clone the necessary data, ensuring the UI always has safe access to the information.

  3. React Strict Mode: We were initially baffled when our startup logic ran twice, causing "address already in use" errors from Ollama. We realized this was due to React's Strict Mode intentionally double-invoking effects in development. We solved this by implementing a useRef guard in our Dashboard.tsx component to ensure the initialization logic is idempotent and only ever runs once per application lifecycle.

Accomplishments that we're proud of

  • The Live Feedback Loop: We are incredibly proud of the symbiotic relationship between the agent and the UI. Watching the system graphs react in real-time to an action taken by the AI is a magical experience that makes the entire concept of an OS agent feel tangible and real.

  • A Truly Zero-Configuration Agent: A user shouldn't need to be a terminal expert to use an advanced tool. Our application handles the entire setup process, from starting the server to downloading the multi-gigabyte AI model, all while providing clear feedback to the user.

  • Safety by Design: We consciously built the agent to be powerful but not reckless. The mandatory confirmation step for any destructive command is a core feature, not an afterthought. It builds user trust, which is essential for any agent that has direct access to a user's system.

What we learned

  • LLMs as Reasoning Engines: We learned that the true power of models like gpt-oss is not just in conversation, but in their ability to act as the reasoning core for tools. By strictly enforcing a structured JSON I/O, we turned the LLM into a predictable, reliable component in a larger software architecture.

  • The Power of Local-First AI: Building a local-first application is liberating. We don't have to worry about API keys, cloud costs, or user data privacy. Everything happens on the user's machine, making the agent fast, secure, and infinitely customizable.

  • Rust + Tauri = The Future of Secure AI Apps: The combination of a Rust backend for performance and safety, with Tauri for a lightweight cross-platform wrapper, is an absolute game-changer for building desktop AI applications that feel native and powerful.

What's next for Terai

We are just scratching the surface of what's possible.

  1. Agent-Aware Internal API: Our next major step is to make the agent even smarter. We plan to teach it to call our internal Rust functions directly (e.g., get_processes()) for lightning-fast, structured data retrieval, falling back to general shell commands only when necessary. This will make the agent more efficient and reliable.

  2. Cross-Platform Expansion: The current startup logic is tailored for macOS. We will build out robust startup and service management for Windows and Linux to make Terai truly cross-platform.

  3. Advanced Fine-Tuning: We plan to fine-tune a version of gpt-oss specifically on a large corpus of shell commands, man pages, and system administration manuals to create a highly specialized "OS expert" model.

Built With

Share this project:

Updates