Skip to content

Satan2049/persona-ai

Repository files navigation

Persona AI logo

Persona AI

Offline-first psychologist avatar — supportive chat, local Piper TTS, lip-sync, and FAQ-grounded RAG

License: MIT Python 3.10-3.12 Tauri 2 FastAPI Backend CI

Installation · Development · Build · Verify releases · Contributing


Description

Persona AI is an open-source research demo: a supportive psychologist-style assistant with a 2D avatar, lip-sync, and local text-to-speech. A FastAPI backend connects to an OpenAI-compatible LLM, optional FAQ-grounded retrieval (RAG), and Piper for offline speech synthesis. A Tauri desktop app packages the same stack for Windows.

Disclaimer: This is a research / demo assistant. It does not diagnose or replace professional mental-health care. Configure emergency and researcher contact numbers in apps/backend/.env.


Features

  • Bilingual UI — Persian and English with locale-locked system prompts
  • Offline TTS — Piper voices discovered from disk; WAV output with viseme timelines
  • Lip-sync avatar — mouth animation driven by returned viseme data
  • FAQ-grounded RAG — retrieval over data/faq_dataset.json (on by default)
  • Safety layer — high-risk content detection and escalation replies
  • Desktop app — Tauri shell + PyInstaller Python sidecar (Windows installers)
  • Themeable UI — multiple color themes and voice / face-age controls

Screenshots

Chat session Avatar and lip-sync

Voice library Settings panel


Demo video

Watch the demo → — screen recording of chat, Piper TTS, lip-sync, and the Windows desktop app.


Installation

Prerequisites

Requirement Notes
Python 3.10–3.12 Recommended; 3.14 may break pydantic wheels
Node.js 20+ Desktop build only
Rust Desktop build only
LLM API Ollama, vLLM, or any OpenAI-compatible chat endpoint
Embeddings API For RAG (defaults to same base as LLM)
Piper Binary + voice models — docs/piper-setup.md

Quick start (web / dev server)

git clone https://github.com/Satan2049/persona-ai.git
cd persona-ai/apps/backend
python -m venv .venv

Windows: .venv\Scripts\activate · Linux/macOS: source .venv/bin/activate

pip install -r requirements.txt
cp .env.example .env    # Windows: copy .env.example .env

Edit apps/backend/.env — set MODEL_*, PIPER_BIN, and paths. Then from the repo root:

scripts\start-backend.bat        # Windows
./scripts/start-backend.ps1      # PowerShell

Open http://127.0.0.1:8000/ · Health check: http://127.0.0.1:8000/health

Desktop app (release)

Download the latest installer from GitHub Releases.

Verify downloads with docs/TRUST.md (SHA256 checksums and VirusTotal scans).


Development

persona-ai/
├── apps/
│   ├── backend/          # FastAPI, RAG, Piper
│   └── desktop/          # Tauri + sidecar packaging
├── assets/               # Icons, screenshots, config
├── data/                 # FAQ corpus, RAG index
├── docs/                 # Architecture, trust, Piper setup
├── scripts/              # Dev and release helpers
└── ui/                   # Static avatar chat frontend
Task Command
Start API (dev) scripts/start-backend.bat
Backend docs apps/backend/README.md
Desktop docs apps/desktop/README.md
Contributing CONTRIBUTING.md
Security SECURITY.md

Not in git: Piper binary, voice .onnx files, API keys, generated audio/ and data/rag_index/.


Build

Python sidecar (PyInstaller)

npm run sidecar:build
# or: .\scripts\build-sidecar.ps1

Output: apps/desktop/src-tauri/binaries/persona-backend-x86_64-pc-windows-msvc.exe

Desktop installers (Tauri)

npm install
npm run desktop:build
# or: .\scripts\build-desktop.ps1

Installers: apps/desktop/src-tauri/target/release/bundle/

Release checksums

Copy release .exe / .zip / .msi files into dist/release/, then:

.\scripts\generate-sha256.ps1 -ReleaseDir "dist\release"

Upload SHA256.txt with the release. See docs/TRUST.md.


Tech stack

Layer Technology
Frontend HTML, CSS, vanilla JavaScript (ui/)
API FastAPI + Uvicorn
RAG NumPy vector store, OpenAI-compatible embeddings
TTS Piper (subprocess)
LLM OpenAI-compatible HTTP (Ollama, etc.)
Desktop shell Tauri 2 (Rust)
Sidecar PyInstaller

Documentation


License

MIT — see LICENSE.

Third-party components have their own licenses:

About

Offline-first psychologist avatar: bilingual chat, Piper TTS, lip-sync UI, FAQ RAG, and a Tauri 2 Windows desktop app.

Topics

Resources

License

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors