PersonalAI
lucianhanga/personal-ai
ChatGPT/Claude local com modelos abertos, RAG e segurança zero-trust
Ver no GitHubAssistente de IA local-first que executa modelos open-source no seu próprio hardware, sem dependência de provedores externos. Oferece ingestão de documentos com RAG, histórico persistente, memória cross-chat, gateway seguro de ferramentas/MCP com aprovações, e orquestração multi-agente via LangGraph.
Instalação
npx convez-ai lucianhanga/personal-ai1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Rodar assistente IA privado sem enviar dados para cloud
- Ingerir e questionar documentos locais com RAG e citações
- Orquestrar múltiplos agentes (planejador, pesquisador, crítico) com aprovação humana
- Integrar ferramentas e MCP servers com controle granular de permissões e auditoria
Veredito

Projeto maduro (M8.1) focado em privacidade, segurança e autonomia do usuário. Ideal para desenvolvedores que querem IA local completa com orquestração multi-agente, RAG e zero-trust, mas exige infraestrutura Postgres/Ollama e experiência técnica.
README
A tradução para o português deste README ainda está na fila.
PersonalAI
A local-first, omni-capable AI assistant — like ChatGPT/Claude, but it runs open-source models on your hardware, works with your files and tools, and reaches external providers only when you explicitly configure and approve it.
PersonalAI is extensible (tools + MCP), structured-output-first (schemas everywhere), open-source-first (verified provenance only), and security-first (zero-trust toward tools, files, prompts, model outputs, and MCP servers).
Current state: M0–M8.1 complete (Identity/multi-tenancy + the M8 multi-agent graph); M8.2 next. Streaming chat in a React UI over local Ollama models or remote OpenAI-compatible providers; chat-with-your-documents (file ingestion → pgvector RAG with citations); persistent conversation history; memory (per-chat short-term summary + cross-chat long-term memory you can view/edit/erase); a security-first Tool/MCP gateway (permissions, egress allowlist, schema-validated I/O, risk approval, audit) with live MCP server management (M7); a single-agent loop that autonomously calls tools and streams reasoning + answer, plus an opt-in multi-agent graph on LangGraph (planner → researcher → critic) with a durable human approval gate (M8.1, ADR-0012); and always-on multi-tenancy (ADR-0010) — Postgres Row-Level Security, an
IdentityProvider(argon2id passwords + cookie sessions), and per-request tenant isolation. Local runs zero-login (app_mode=local); hosted mode adds real login + CSRF. The HTTP API is versioned under/api/v1(see CHANGELOG). See the architecture report, the local chat guide, remote providers, files + RAG, memory, tools, the agent loop, and MCP servers.
Quickstart (local chat)
make setup
make db # local Postgres + pgvector (docker compose)
# terminal 1 — backend (local mode = zero-login; multi-tenancy runs as tenant #1)
PERSONALAI_DEFAULT_MODEL=qwen3:14b make run-backend
# terminal 2 — UI -> http://localhost:5173 (no token needed in local mode)
pnpm --filter @personalai/ui dev
Requires a local Ollama with a model pulled. app_mode defaults to local
(zero-login dev). For multi-tenant hosted mode (real login + cookies + CSRF) set
PERSONALAI_APP_MODE=hosted. Full guide: docs/guides/local-chat.md;
all env vars are in .env.example.
Principles
| Principle | Meaning |
|---|---|
| Local-first, cloud-optional | Full core works offline; any egress is opt-in, per-provider, and visible. |
| Structured-output-first | All agent ↔ backend ↔ tool ↔ UI messages are schema-validated. |
| Zero-trust I/O | Files, prompts, model outputs, tool results, and MCP servers are treated as adversarial. |
| Least privilege + explicit consent | Tools are off by default; grants are narrow, scoped, and revocable. |
| Verified provenance | Every dependency has a known reputable maintainer, license, maturity, and a documented reason. |
| Portability | Swap local ↔ remote models and storage backends behind stable interfaces. |
| Auditable & reproducible | Append-only audit log, SBOM, signed releases, reproducible builds where feasible. |
High-level architecture
A single-host modular monolith (hexagonal: ports & adapters + registries) fronting isolated runtimes — local model servers and sandboxed tools/MCP servers — with security, audit, and secrets as cross-cutting layers.
Clients (Tauri UI + MV3 extension, loopback)
│
API Gateway ── Auth/Settings
│
API Gateway ── Auth (IdentityProvider) + per-request tenant context (SecurityContext)
│
Conversation ── Agent Orchestration (single-agent loop; opt-in LangGraph multi-agent graph, ADR-0012) ── Structured-Output Validation
│ │
File Ingestion Tool/MCP Gateway ── Security Engine ── Sandbox (container/gVisor/WASM)
│ │
Retrieval (RAG) Model Abstraction/Router ── Ollama | llama.cpp | vLLM | remote (LiteLLM, opt-in)
│
Storage: PostgreSQL + pgvector · object store · secrets vault · append-only audit
Full diagram and rationale: architecture report.
Selected stack (planned, vetted)
| Area | Choice | License |
|---|---|---|
| Backend | Python + FastAPI (modular monolith) | — |
| UI | Tauri shell + web SPA (React/Svelte) | MIT/Apache-2.0 |
| Local model runtime | Ollama (default) · llama.cpp · vLLM | MIT / MIT / Apache-2.0 |
| Remote provider gateway | LiteLLM (opt-in) | MIT |
| Agent orchestration | Single-agent loop + opt-in LangGraph multi-agent graph over the existing seams (ADR-0012) | MIT |
| Auth / multi-tenancy | argon2id + server sessions + Postgres RLS (ADR-0010) | — |
| Schemas | Pydantic / Zod + JSON Schema | MIT |
| Storage / RAG | PostgreSQL + pgvector | PostgreSQL License |
| Ingestion | Apache Tika / IBM Docling | Apache-2.0 |
| Audio | faster-whisper (STT) / Piper (TTS) | MIT |
The complete, maintained provenance register (maintainer, license, maturity, security notes,
reason, alternatives) lives in
docs/supply-chain/SUPPLY-CHAIN.md.
Roadmap (high horizon)
Foundation → Talk → Know → Act → Reason → Sense → Reach → (Connect) → Harden
| Milestone | Delivers | Status |
|---|---|---|
| M0 | Skeleton + contracts (all ports defined, CI/SBOM/signing skeleton) | done |
| M1–M2 | Local chat (Ollama) → provider portability | done |
| M3 | Files + vector RAG (pgvector) | done |
| M4 | Memory (short-term summary + long-term, semantic) | done |
| M5 | Tool/MCP gateway + sandbox | done |
| M6 | Single-agent loop + tools (streamed reasoning + answer) | done |
| M7 | MCP plug-in/out + verification | done |
| Identity + multi-tenancy | Always-on auth + Postgres RLS tenant isolation (ADR-0010) | done |
| Pre-M8 hardening | Audit-driven fixes (run_turn seam, unit-of-work, tenant tests, ...) | done |
| M8.1 | Multi-agent graph on LangGraph (planner → researcher → critic) + durable human gate (ADR-0012) | done |
| M8.2 | Tiered verification ladder + bounded schema-repair + accuracy-mode | next |
| M9 | Multimodal (vision / STT / TTS) | planned |
| M10 | Browser extension (MV3) | planned |
| M11 | KAG / graph memory (graph upgrade of M4) | planned |
| M12 | Hardening, signing, packaging, docs | planned |
Details: §22 Modular Implementation Roadmap.
Documentation
| Doc | Purpose |
|---|---|
| Architecture report | The full research + high-level architecture (22 sections). |
| ADRs | Architecture Decision Records. |
| Threat model | Trust boundaries and threats (v1). |
| Security policy | Reporting and security posture. |
| Dependency policy | Provenance, verification, SBOM, scanning rules. |
| Supply-chain register | Living inventory of every dependency + creator. |
| Onboarding / dev guide | How to work in this repo. |
| Contributing | GitHub flow, branching, commits, PRs. |
| Changelog | Versioning policy (semver in VERSION) and per-release history. |
Contributing & workflow
This repo uses GitHub flow: main is protected; all work happens on short-lived
feature branches merged via pull request. See CONTRIBUTING.md.
License
Apache-2.0 © 2026 Lucian Hanga.