← Projects

twin

A self-hosted AI assistant running on personal data exports. It routes prompts between local open-weight models and cloud APIs based on strict data privacy tiers.

Status
Paused
Started
Sept 2026
Stack
Python · FastAPI · MCP · Qdrant · Ollama · Go · whatsmeow · XTTS-v2

Core design constraint

The knowledge base consists of private digital exports: Google Takeout, messaging history, and notes. Because sensitive personal data must not leave local storage, routing decisions prioritize data privacy over raw model performance.

Privacy tier classification

Every document, tool, and connector is assigned a data tier:

TierData sensitivityExfiltration allowed
T0Public information, weather, open codeYes
T1Personal data: calendar, contacts, messagesNo
T2Sensitive data: financial records, credentialsNo, logging disabled

Request classification occurs locally prior to routing. The system computes the highest tier among the user query, retrieved facts, and active connectors. External LLM APIs are invoked exclusively for T0 queries with zero personal context. Any routing error favoring local execution degrades output quality; a routing error toward external APIs constitutes a data leak.

Architecture

A FastAPI gateway coordinates three components: query classifier, hybrid RAG pipeline (dense e5-large combined with BM25 using Reciprocal Rank Fusion and cross-encoder reranking), and an MCP connector hub. Connectors declare privacy tiers and scopes in manifest files. External tool outputs are wrapped inside [DATA] blocks to prevent prompt injection. Actions that modify data require explicit human in the loop confirmation.

Performance measurements

Benchmarking on RTX 2070 Max-Q under WSL2:

  1. External T0 queries respond in approximately 5 seconds. Local T1 queries take 15 to 25 seconds (retrieval: 2 to 4 s, 3.5k token prompt processing: 8 s, generation speed: 10 tokens per second).
  2. GPU power draw remains at 20 W (885 MHz) during local inference due to WSL2 kernel invocation overhead.
  3. Total system memory usage reaches 9.3 GB out of a 12 GB allocation, preventing concurrent re-indexing.
  4. Running concurrent CUDA workloads (LLM generation and cross-encoder reranking) causes GPU lockup under WSL2. Reranking was shifted to CPU execution to maintain stability.

Achieving voice interaction latency under 1.5 seconds requires dedicated host hardware.

Current state

Development paused in mid September. Text processing pipeline functions end to end. Voice client, human in the loop write operations, and evaluation suites remain unbuilt. Repository remains private due to personal data content.