Pia-Ai-dev/Pia.Wpf

How can I help you today?

C#

0

1,617 commits

updated Oct 3, 2026

See the code

README

Pia

Personal Intelligent Assistant

An AI-powered Windows desktop assistant that optimizes your text
and chats with you — only one hotkey away.

.NET 10 WPF-UI Windows


What is Pia?

Pia sits in your system tray and activates instantly with a global hotkey. Select text in any app, press Ctrl+Alt+O, and Pia optimizes it on the spot. Need more? Switch to Assistant mode for a full AI chat.

Two Modes - only one hotkey away

ModeWhat it doesDefault Hotkey
OptimizeTransform text using templates — make an email professional, rewrite for clarity, adjust toneCtrl+Alt+O
AssistantChat with an AI that remembers your preferences, manages todos and reminders, and stores knowledge in a personal memoryCtrl+Alt+P

Key Features

  • Multiple AI providers — Pia Cloud, OpenAI, Anthropic, Azure OpenAI, OpenRouter, Mistral, Ollama, or any OpenAI-compatible API
  • Speech-to-text — Dictate instead of typing, powered by local Whisper transcription (no data leaves your machine)
  • Text-to-speech — Listen to responses with offline Piper TTS — multiple downloadable voice models, no cloud required
  • Voice mode — Hands-free voice conversation overlay: speak your request, hear the answer
  • Smart memory — Pia learns your preferences and context over time, with semantic search powered by embeddings
  • Todo & task management — Create, prioritize (Low/Medium/High), and track tasks with optional due dates and notes — plus a drag-and-drop Kanban board view
  • Reminders — Set one-time or recurring reminders (Daily, Weekly, Monthly, Yearly) with natural language — Pia notifies you via Windows toast notifications
  • MCP plugins — Extend Assistant mode with Model Context Protocol tools from third-party servers
  • Templates — Built-in templates (Business Email, Community Article, Message to Friend) plus custom ones you create
  • Auto-type — Optimized text can be typed directly into the previously focused window, or copied to clipboard
  • Cloud sync with optional E2EE — Sync settings, templates, and memory across devices, optionally end-to-end encrypted with a printable recovery code
  • Enterprise policy settings — Layered preset policy files for managed deployments
  • Multi-language — Interface available in English, German, and French
  • Dark theme with Mica — Modern Windows 11 look and feel via WPF-UI

Assistant Tools

In Assistant mode, Pia has access to built-in tools that it uses automatically during conversation:

Tool GroupCapabilities
MemoryStore and recall personal facts, contacts, preferences, and notes — with semantic search via embeddings
TodosCreate tasks with priorities (Low/Medium/High), due dates, and notes — query, update, complete, or delete them
RemindersSchedule one-time or recurring reminders (Daily, Weekly, Monthly, Yearly) with natural language parsing — background notifications keep you on track
FilesRead, summarize, update and delete text files — only inside a sandbox folder you configure
GitLocal git operations on the working directory (status, log, diff, branch, show, init, add, commit, switch, restore, stash) — no network operations
ScreenLook at one window or one display as a picture, on request
Vault ingestCompile raw documents from the vault's sources folder into recallable topic pages
Chat historySearch and read your past conversations with the assistant
RoutinesSchedule recurring jobs whose answers arrive as chats
AssignmentsFollow background work the Pia server runs remotely on records you select
MCP pluginsAny tool exposed by a Model Context Protocol server you connect

Each group can be switched off entirely in Settings.

How tool permissions work

Looking something up runs as part of the conversation. Anything that changes something — a file, a commit, a reminder — and anything that captures your screen passes a permission gate first. What the gate does depends on where the request came from:

SituationBehaviour
You are in the chatAn action card shows what is about to happen. Allow once, always allow, or decline
Voice modeWrites are refused — there is no card to answer, so Pia tells you what to do instead
Unattended run (scheduled or background)Writes are refused unless you granted that tool beforehand — nobody is watching

"Always allow" is a standing grant you can withdraw in Settings at any time. Screen capture and background assignments are never covered by a general grant — they always need one of their own. Every decision is recorded together with the permission that allowed it, so a run's timeline shows exactly why each action was able to run.

One exception worth naming: vault ingest runs inline and shows no card. It writes only inside your vault's own memory folder, turning documents you put in sources into topic pages.


Quick Start

Prerequisites

Build & Run

git clone https://github.com/Pia-Ai-dev/Pia.Wpf.git
cd Pia.Wpf
dotnet build
dotnet run --project src/Pia.Wpf/Pia.Wpf.csproj

First Launch

On first run, a setup wizard walks you through everything:

  1. Welcome — Meet Pia and see what it can do
  2. Account Setup — Optionally sign in and set up a recovery code for E2EE sync
  3. Provider Setup — Configure an AI provider (shown only when needed)
  4. Modes Overview — Learn about Optimize and Assistant modes
  5. Your Profile — Optionally tell Pia your name and preferred tone (Personal or Business)
  6. Ready — Quick-start tips so you can be productive immediately

All fields are optional — you can skip the entire wizard and configure everything later in Settings.


Getting Started in 60 Seconds

  1. Configure a provider — Open Settings and add your OpenAI API key (or connect Azure, Ollama, etc.)
  2. Press Ctrl+Alt+P — Pia appears, ready for input
  3. Type or dictate your text, pick a template, and hit Optimize
  4. Result auto-types into your previous window, or copies to clipboard

That's it. Pia stays in your system tray, ready whenever you need it.


AI Providers

Pia works with multiple AI backends — pick what suits you:

ProviderSetup
Pia CloudBuilt-in first-party provider — no configuration required
OpenAIPaste your API key in Settings (custom endpoint/model optional)
Azure OpenAIEnter endpoint, deployment name, and API key
OpenRouterAPI key (defaults to https://openrouter.ai/api/v1)
AnthropicPaste your API key in Settings
MistralAPI key (defaults to https://api.mistral.ai/v1)
OllamaPoint to your local Ollama instance — no API key needed, fully offline
OpenAI-compatibleAny OpenAI-compatible endpoint (LM Studio, vLLM, and similar)

The provider edit dialog can auto-fetch available models from any configured endpoint. API keys are encrypted locally using Windows DPAPI — they never leave your machine unencrypted.


Project Structure

Pia.Wpf.slnx
├── src/
│   ├── Pia.Wpf/             # WPF desktop client
│   │   ├── Behaviors/       # XAML attached behaviors (autocomplete, drag/drop, kanban)
│   │   ├── Controls/        # Custom WPF controls
│   │   ├── Converters/      # Value converters
│   │   ├── Helpers/         # Utility helpers
│   │   ├── Infrastructure/  # DPAPI, SQLite, P/Invoke
│   │   ├── Localization/    # i18n resources
│   │   ├── Models/          # Data models and enums
│   │   ├── Navigation/      # View navigation
│   │   ├── Services/        # Application services (incl. Plugins/ for MCP)
│   │   ├── ViewModels/      # MVVM ViewModels
│   │   └── Views/           # XAML views and dialogs
│   └── Pia.Shared/          # Shared DTOs for sync
└── tests/
    └── Pia.Wpf.Tests/       # Unit tests

Tech Stack

LayerTechnology
UI FrameworkWPF + WPF-UI 4.2.0 (Fluent Design)
Runtime.NET 10.0
MVVMCommunityToolkit.Mvvm
AI IntegrationAzure.AI.OpenAI, Microsoft.Extensions.AI
MCPModelContextProtocol
Speech-to-TextWhisper.NET (local, offline)
Text-to-SpeechPiperSharp (local, offline)
AudioNAudio
DatabaseMicrosoft.Data.Sqlite
EncryptionWindows DPAPI (API keys), E2EE for sync
MarkdownMdXaml (NuGet)
InstallerVelopack

Data Storage

LocationContents
%AppData%/Pia/settings.json, templates.json, providers.json
%LocalAppData%/Pia/history.db (SQLite), Whisper models

Your data is stored locally. Nothing in the tables above is uploaded on its own, and Pia builds no analytics or usage profile. The only call it makes without being asked is the update check; every external host the app can contact is listed in docs/external_endpoints/. Two things do leave the machine on purpose, and both are your choice:

  • Your prompts go to the AI provider you picked. That is inherent to using a cloud model — pick Ollama or another local endpoint and nothing leaves the machine at all. Speech-to-text and text-to-speech run on your machine either way — no audio is uploaded, whichever provider you use.
  • Cloud sync is opt-in and needs a companion server (ours, or one you host). End-to-end encryption can be enabled on top, protected by a printable recovery code — with it on, the server stores ciphertext it cannot read.

Rating an answer sends that one message to the Pia server, and only when you press the button; the answer text is included only if you tick the box. The rating buttons appear only for Pia Cloud answers — when you use your own provider key there is nobody for a report to reach, so Pia does not show them.


Building

# Debug build
dotnet build

# Release build
dotnet build -c Release

# Run
dotnet run --project src/Pia.Wpf/Pia.Wpf.csproj

# Clean
dotnet clean

Contributing

  1. Fork the repo and create a feature branch from main:
    git checkout main
    git checkout -b feature/your-feature-name
    
  2. Make your changes following the code style defined in .editorconfig
  3. Submit a pull request targeting main

Branch Workflow

BranchPurpose
mainProduction releases
feature/*Feature development

Code Style Highlights

  • 4-space indent (C#), 2-space indent (XAML)
  • var for apparent types, expression-bodied members preferred
  • PascalCase for public members, _camelCase for private fields
  • All business logic in ViewModels, never in code-behind

License

Copyright © 2026 Pia-Ai-dev

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 3, as published by the Free Software Foundation.

It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

LGPL-3.0 incorporates the terms of the GNU General Public License, version 3: LICENSE holds the former and GPL-3.0.txt the latter.

Licences for the models and components Pia downloads at runtime — speech models and text-to-speech voices among them — are listed in THIRD-PARTY-NOTICES.md.

Pia-Ai-dev/Pia.Wpf

How can I help you today?

C#

0

1,617 commits

updated Oct 3, 2026

See the code

README

Pia

Personal Intelligent Assistant

An AI-powered Windows desktop assistant that optimizes your text
and chats with you — only one hotkey away.

.NET 10 WPF-UI Windows


What is Pia?

Pia sits in your system tray and activates instantly with a global hotkey. Select text in any app, press Ctrl+Alt+O, and Pia optimizes it on the spot. Need more? Switch to Assistant mode for a full AI chat.

Two Modes - only one hotkey away

ModeWhat it doesDefault Hotkey
OptimizeTransform text using templates — make an email professional, rewrite for clarity, adjust toneCtrl+Alt+O
AssistantChat with an AI that remembers your preferences, manages todos and reminders, and stores knowledge in a personal memoryCtrl+Alt+P

Key Features

  • Multiple AI providers — Pia Cloud, OpenAI, Anthropic, Azure OpenAI, OpenRouter, Mistral, Ollama, or any OpenAI-compatible API
  • Speech-to-text — Dictate instead of typing, powered by local Whisper transcription (no data leaves your machine)
  • Text-to-speech — Listen to responses with offline Piper TTS — multiple downloadable voice models, no cloud required
  • Voice mode — Hands-free voice conversation overlay: speak your request, hear the answer
  • Smart memory — Pia learns your preferences and context over time, with semantic search powered by embeddings
  • Todo & task management — Create, prioritize (Low/Medium/High), and track tasks with optional due dates and notes — plus a drag-and-drop Kanban board view
  • Reminders — Set one-time or recurring reminders (Daily, Weekly, Monthly, Yearly) with natural language — Pia notifies you via Windows toast notifications
  • MCP plugins — Extend Assistant mode with Model Context Protocol tools from third-party servers
  • Templates — Built-in templates (Business Email, Community Article, Message to Friend) plus custom ones you create
  • Auto-type — Optimized text can be typed directly into the previously focused window, or copied to clipboard
  • Cloud sync with optional E2EE — Sync settings, templates, and memory across devices, optionally end-to-end encrypted with a printable recovery code
  • Enterprise policy settings — Layered preset policy files for managed deployments
  • Multi-language — Interface available in English, German, and French
  • Dark theme with Mica — Modern Windows 11 look and feel via WPF-UI

Assistant Tools

In Assistant mode, Pia has access to built-in tools that it uses automatically during conversation:

Tool GroupCapabilities
MemoryStore and recall personal facts, contacts, preferences, and notes — with semantic search via embeddings
TodosCreate tasks with priorities (Low/Medium/High), due dates, and notes — query, update, complete, or delete them
RemindersSchedule one-time or recurring reminders (Daily, Weekly, Monthly, Yearly) with natural language parsing — background notifications keep you on track
FilesRead, summarize, update and delete text files — only inside a sandbox folder you configure
GitLocal git operations on the working directory (status, log, diff, branch, show, init, add, commit, switch, restore, stash) — no network operations
ScreenLook at one window or one display as a picture, on request
Vault ingestCompile raw documents from the vault's sources folder into recallable topic pages
Chat historySearch and read your past conversations with the assistant
RoutinesSchedule recurring jobs whose answers arrive as chats
AssignmentsFollow background work the Pia server runs remotely on records you select
MCP pluginsAny tool exposed by a Model Context Protocol server you connect

Each group can be switched off entirely in Settings.

How tool permissions work

Looking something up runs as part of the conversation. Anything that changes something — a file, a commit, a reminder — and anything that captures your screen passes a permission gate first. What the gate does depends on where the request came from:

SituationBehaviour
You are in the chatAn action card shows what is about to happen. Allow once, always allow, or decline
Voice modeWrites are refused — there is no card to answer, so Pia tells you what to do instead
Unattended run (scheduled or background)Writes are refused unless you granted that tool beforehand — nobody is watching

"Always allow" is a standing grant you can withdraw in Settings at any time. Screen capture and background assignments are never covered by a general grant — they always need one of their own. Every decision is recorded together with the permission that allowed it, so a run's timeline shows exactly why each action was able to run.

One exception worth naming: vault ingest runs inline and shows no card. It writes only inside your vault's own memory folder, turning documents you put in sources into topic pages.


Quick Start

Prerequisites

Build & Run

git clone https://github.com/Pia-Ai-dev/Pia.Wpf.git
cd Pia.Wpf
dotnet build
dotnet run --project src/Pia.Wpf/Pia.Wpf.csproj

First Launch

On first run, a setup wizard walks you through everything:

  1. Welcome — Meet Pia and see what it can do
  2. Account Setup — Optionally sign in and set up a recovery code for E2EE sync
  3. Provider Setup — Configure an AI provider (shown only when needed)
  4. Modes Overview — Learn about Optimize and Assistant modes
  5. Your Profile — Optionally tell Pia your name and preferred tone (Personal or Business)
  6. Ready — Quick-start tips so you can be productive immediately

All fields are optional — you can skip the entire wizard and configure everything later in Settings.


Getting Started in 60 Seconds

  1. Configure a provider — Open Settings and add your OpenAI API key (or connect Azure, Ollama, etc.)
  2. Press Ctrl+Alt+P — Pia appears, ready for input
  3. Type or dictate your text, pick a template, and hit Optimize
  4. Result auto-types into your previous window, or copies to clipboard

That's it. Pia stays in your system tray, ready whenever you need it.


AI Providers

Pia works with multiple AI backends — pick what suits you:

ProviderSetup
Pia CloudBuilt-in first-party provider — no configuration required
OpenAIPaste your API key in Settings (custom endpoint/model optional)
Azure OpenAIEnter endpoint, deployment name, and API key
OpenRouterAPI key (defaults to https://openrouter.ai/api/v1)
AnthropicPaste your API key in Settings
MistralAPI key (defaults to https://api.mistral.ai/v1)
OllamaPoint to your local Ollama instance — no API key needed, fully offline
OpenAI-compatibleAny OpenAI-compatible endpoint (LM Studio, vLLM, and similar)

The provider edit dialog can auto-fetch available models from any configured endpoint. API keys are encrypted locally using Windows DPAPI — they never leave your machine unencrypted.


Project Structure

Pia.Wpf.slnx
├── src/
│   ├── Pia.Wpf/             # WPF desktop client
│   │   ├── Behaviors/       # XAML attached behaviors (autocomplete, drag/drop, kanban)
│   │   ├── Controls/        # Custom WPF controls
│   │   ├── Converters/      # Value converters
│   │   ├── Helpers/         # Utility helpers
│   │   ├── Infrastructure/  # DPAPI, SQLite, P/Invoke
│   │   ├── Localization/    # i18n resources
│   │   ├── Models/          # Data models and enums
│   │   ├── Navigation/      # View navigation
│   │   ├── Services/        # Application services (incl. Plugins/ for MCP)
│   │   ├── ViewModels/      # MVVM ViewModels
│   │   └── Views/           # XAML views and dialogs
│   └── Pia.Shared/          # Shared DTOs for sync
└── tests/
    └── Pia.Wpf.Tests/       # Unit tests

Tech Stack

LayerTechnology
UI FrameworkWPF + WPF-UI 4.2.0 (Fluent Design)
Runtime.NET 10.0
MVVMCommunityToolkit.Mvvm
AI IntegrationAzure.AI.OpenAI, Microsoft.Extensions.AI
MCPModelContextProtocol
Speech-to-TextWhisper.NET (local, offline)
Text-to-SpeechPiperSharp (local, offline)
AudioNAudio
DatabaseMicrosoft.Data.Sqlite
EncryptionWindows DPAPI (API keys), E2EE for sync
MarkdownMdXaml (NuGet)
InstallerVelopack

Data Storage

LocationContents
%AppData%/Pia/settings.json, templates.json, providers.json
%LocalAppData%/Pia/history.db (SQLite), Whisper models

Your data is stored locally. Nothing in the tables above is uploaded on its own, and Pia builds no analytics or usage profile. The only call it makes without being asked is the update check; every external host the app can contact is listed in docs/external_endpoints/. Two things do leave the machine on purpose, and both are your choice:

  • Your prompts go to the AI provider you picked. That is inherent to using a cloud model — pick Ollama or another local endpoint and nothing leaves the machine at all. Speech-to-text and text-to-speech run on your machine either way — no audio is uploaded, whichever provider you use.
  • Cloud sync is opt-in and needs a companion server (ours, or one you host). End-to-end encryption can be enabled on top, protected by a printable recovery code — with it on, the server stores ciphertext it cannot read.

Rating an answer sends that one message to the Pia server, and only when you press the button; the answer text is included only if you tick the box. The rating buttons appear only for Pia Cloud answers — when you use your own provider key there is nobody for a report to reach, so Pia does not show them.


Building

# Debug build
dotnet build

# Release build
dotnet build -c Release

# Run
dotnet run --project src/Pia.Wpf/Pia.Wpf.csproj

# Clean
dotnet clean

Contributing

  1. Fork the repo and create a feature branch from main:
    git checkout main
    git checkout -b feature/your-feature-name
    
  2. Make your changes following the code style defined in .editorconfig
  3. Submit a pull request targeting main

Branch Workflow

BranchPurpose
mainProduction releases
feature/*Feature development

Code Style Highlights

  • 4-space indent (C#), 2-space indent (XAML)
  • var for apparent types, expression-bodied members preferred
  • PascalCase for public members, _camelCase for private fields
  • All business logic in ViewModels, never in code-behind

License

Copyright © 2026 Pia-Ai-dev

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 3, as published by the Free Software Foundation.

It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

LGPL-3.0 incorporates the terms of the GNU General Public License, version 3: LICENSE holds the former and GPL-3.0.txt the latter.

Licences for the models and components Pia downloads at runtime — speech models and text-to-speech voices among them — are listed in THIRD-PARTY-NOTICES.md.