Skip to content

mihaibc/PrivacyCopilot

Privacy Copilot

Rust CI Frontend CI License Rust Tauri

Privacy Copilot is a fast, local-first desktop AI assistant built with Rust, Tauri, and React.

The product goal is simple: keep user data local by default, let the user bring their own model provider, and provide the basics a copilot needs: chats, image attachments, history, provider/API settings, user settings, local artifact management, and a local vector foundation for retrieval.

What It Does

  • Chat with local or hosted model providers.
  • Configure Ollama, OpenAI-compatible/vLLM, Azure OpenAI, and Gemini endpoints.
  • Send image attachments to providers that support multimodal requests.
  • Keep chat history, settings, provider metadata, artifacts, and vector records in local SQLite.
  • Store provider API keys and the local data-encryption key in the OS keychain.
  • Encrypt user-entered SQLite text fields plus artifact payload and metadata files.
  • Index text artifacts locally and inject relevant retrieval context into provider-bound chat requests.

Current Architecture

  • crates/privacycopilot-core: Rust domain/core crate for chats, messages, provider metadata, settings, artifacts, SQLite storage, and vector search primitives.
  • crates/privacycopilot-desktop: Tauri desktop shell, command wrappers, keychain secret storage, and HTTP provider client.
  • frontend: React/Vite UI for chat, history, provider settings, data sources, and documents/artifacts.
  • docs: Architecture, API command contract, deployment, and user guide notes for the Rust desktop direction.

The old Go backend, Python AI service, Docker, Kubernetes, Terraform, and MLOps placeholders were removed because the app is no longer a multi-service Python/Go cloud scaffold.

Run Locally

Prerequisites:

  • Rust stable toolchain.
  • Node.js 20 or newer.
  • npm.
  • Platform dependencies for Tauri. On Linux, install GTK/WebKit packages; the Rust CI workflow shows the exact Ubuntu packages.
  • Optional: Ollama for local model execution.

Install dependencies:

npm install
npm --prefix frontend install

Start the full desktop app:

npm run desktop:dev

Run only the browser preview:

npm --prefix frontend run dev

Run a local Ollama model:

ollama pull llama3.1
ollama serve

The desktop app stores real local state in the OS app-data directory resolved by Tauri. Browser preview uses local browser storage.

Rust Principles

The Rust code should stay:

  • Idiomatic: explicit ownership, small modules, clear error types, Result over panics.
  • SOLID where useful: separate storage, provider routing, artifacts, vectors, and models.
  • KISS/YAGNI: no generic abstractions unless the next product step needs them.
  • Local-first: no telemetry by default, no client-side secrets, no provider calls unless explicitly configured.
  • Secret-safe: provider API keys and the local data-encryption key are handled through a desktop SecretStore boundary backed by the OS keychain by default.
  • Locally protected: user-entered SQLite text fields plus artifact payload and metadata files are encrypted at rest when the desktop app initializes with its keychain-held data key.
  • Retrieval-ready: text artifacts can be indexed with a local deterministic Rust embedder and retrieved into chat context without Python services.

Developer Commands

Check the Rust workspace:

cargo check --workspace
cargo test --workspace
cargo clippy --workspace --all-targets -- -D warnings

Build the desktop app in debug mode without packaging installers:

npm run desktop:build -- --no-bundle --debug

Run the Tauri desktop app in development mode:

npm run desktop:dev

Build the frontend:

npm --prefix frontend run build

Repository Layout

crates/privacycopilot-core      Rust domain, SQLite, crypto, artifacts, vectors
crates/privacycopilot-desktop   Tauri runtime, commands, keychain, provider HTTP client
frontend                        React/Vite interface
docs                            Architecture, command contract, deployment, provider notes

CI Notes

Rust CI compiles the full Tauri workspace on Ubuntu. Tauri needs native Linux desktop libraries such as GLib, GTK, WebKitGTK, AppIndicator, librsvg, pkg-config, and patchelf. These are installed in .github/workflows/rust-ci.yml before cargo check.

Next Build Steps

  1. Add streaming responses and cancellation.
  2. Add key rotation and export/delete flows.
  3. Replace the deterministic local embedder with optional provider/model-backed embeddings.
  4. Harden packaged app signing/notarization and installer settings.

About

Local-first Rust/Tauri desktop AI assistant with encrypted storage, provider settings, image chat, artifacts, SQLite history, and vector search.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors