Platform

Architecture

How Reins is built - from core infrastructure to client applications. The projects, patterns, and systems that power the platform.

Abstract visualization of the Reins platform architecture
System Overview

One platform, every surface

Reins is a unified assistant platform that works across terminal, desktop, and mobile. Powered by a shared runtime and connected through a single API layer.

Reins is built around a single engine that runs everywhere. Reins Core is a TypeScript runtime library that handles conversations, model routing, tool execution, plugin management, and persistent memory. Every client shares this engine - when you switch from terminal to desktop to phone, the assistant carries the same context, capabilities, and plugin ecosystem.

How the pieces connect

Foundation

Core Runtime provides the shared engine - conversation management, multi-provider model routing with bring-your-own-key support, a tool registry with built-in and plugin-defined tools, memory with embeddings and retrieval, and streaming response handling. Every project in the platform depends on this library.

Infrastructure

Backend handles cloud persistence - user accounts, team management, conversation history, calendar, notes, reminders, and encrypted credential storage. Runs on Convex with Clerk for authentication, supporting multi-device sync and role-based access.

Gateway sits between clients and model providers - exposes an OpenAI-compatible API, routes requests to Anthropic, OpenAI, Google, or Fireworks based on availability, and handles metering, rate limiting, and credit-based billing through Stripe.

Clients

Three clients share the core runtime and connect through the gateway - TUI is a terminal interface built with React-based rendering, with command palette, rich cards, and daemon integration. Desktop uses Tauri for native macOS, Windows, and Linux. Mobile runs on Expo and React Native for iOS and Android.

Extensibility

SDK for building plugins and tools that work across every client - provides definePlugin and defineTool helpers with full type safety, sandboxed execution, and testing utilities. Plugins written once run everywhere the core engine does.

Architectural principles

  • Shared runtime, not shared UI. Clients own their interface but share conversation logic, memory, and tool execution through the core library.
  • Provider-agnostic by design. Model routing supports multiple providers simultaneously. Users bring their own keys or use managed access through the gateway.
  • Plugin system with boundaries. Plugins declare permissions, run in sandboxed contexts, and are audited at install. The same plugin works in terminal, desktop, and mobile.
  • Local-first with cloud sync. Core functionality works offline with SQLite storage. The backend provides optional sync for multi-device continuity.
Platform Projects

Project catalog

Every project in the Reins platform - what it does, how it's built, and the systems that define its architecture. All projects are in active development. Planned features are marked separately from implemented architecture.

Core Runtime Shared engine powering every client

Reins Core

Active Development
@reins/core

Shared TypeScript runtime library powering all Reins clients with conversation, providers, tools, plugins, memory, and streaming

TypeScript Bun SQLite WebSocket
Architecture
  • Conversation engine with session persistence and compaction
  • Multi-provider model routing with BYOK credential management
  • Tool registry and execution pipeline with built-in tools
  • Plugin lifecycle with manifest, sandbox, permissions, and audit
  • Memory store with embeddings, RAG, and proactive capture
  • Streaming response primitives
  • Agent harness with retry policy and doom-loop guard
  • Background daemon with WebSocket stream registry
Infrastructure Cloud services and API routing

Reins Backend

Active Development
@reins/backend

Cloud backend services handling user data, authentication, teams, conversations, and app features on Convex serverless infrastructure

TypeScript Convex Clerk Svix
Architecture
  • 22-table data model with comprehensive indexing
  • Clerk OIDC authentication with device code flow
  • Team management with role-based access
  • Multi-platform session tracking
  • Encrypted credential storage with sync checkpoints
  • Calendar with RFC-compliant recurrence
  • Svix webhook delivery
  • Billing sync and team billing

Reins Gateway

Active Development
@reins/gateway

Model API gateway exposing an OpenAI-compatible API with key validation, metering, rate limiting, and multi-provider upstream routing

TypeScript Bun Stripe
Architecture
  • Bun native HTTP server with middleware pipeline
  • OpenAI-compatible chat completions API
  • Multi-provider routing (Anthropic, OpenAI, Google, Fireworks)
  • Virtual API key generation and validation
  • Token-based metering and spend tracking
  • Credit billing with Stripe integration
  • Rate limiting and CORS middleware
Client Applications User-facing applications across platforms

Reins TUI

Active Development
@reins/tui

Terminal UI client and primary developer-facing interface built with a React-based terminal rendering framework

TypeScript Bun React 19 OpenTUI
Architecture
  • React-based terminal rendering via OpenTUI
  • 21 components with screen-based navigation
  • Command palette pattern
  • Daemon client with WebSocket transport and reconnect
  • Rich card rendering system
  • Tool lifecycle and inline display
  • Theme system
  • State management via dedicated store modules

Reins Desktop

Early Development
@reins/desktop

Native desktop client for macOS, Windows, and Linux using a Tauri hybrid architecture with a React web frontend

TypeScript Rust Tauri v2 React 19 Vite
Architecture
  • Tauri v2 hybrid architecture (Rust shell + web frontend)
  • React 19 with Vite bundling
  • Rust commands for native operations (tray, updater)
  • Capability-based permissions (Tauri security model)
  • Context-based state management
Planned
  • Auto-update distribution via GitHub releases
  • Full native notification integration

Reins Mobile

Early Development
@reins/mobile

Mobile client for iOS and Android providing conversation, calendar, notes, reminders, and account management

TypeScript Expo SDK 54 React Native 0.83 React 19
Architecture
  • Expo managed workflow
  • React Navigation v7 (bottom tabs + native stack)
  • 10 screens with screen-based architecture
  • Service layer for notifications and offline queue
  • Streaming indicator for real-time responses
Planned
  • Voice input with speech recognition
  • Offline-first data queue
  • EAS build and app store submission pipeline
Developer Tools Tools for extending the platform

Reins SDK

Active Development
@reins/sdk

TypeScript SDK for third-party plugin development with helper APIs and type re-exports from the core runtime

TypeScript Bun
Architecture
  • definePlugin() helper for plugin manifest and lifecycle
  • defineTool() helper for tool definitions with JSON Schema
  • Mock-first testing support (MockPluginContext, MockPluginDataAccess)
  • Published package structure with declaration files