Welcome to PersonalAI. This guide gets you oriented. PersonalAI is a working, local-first modular
monolith: a FastAPI backend, a React SPA + Tauri shell, stable contracts, and the seam packages
(providers, retrieval, storage, modalities, tools, agents) wired together through registries. This
guide explains the mental model and how to start contributing.
A local-first, omni-capable AI assistant. Read these first, in order:
- README — the elevator pitch and current state.
- Architecture report — the full design.
- Threat model — how we think about security.
- ADRs — the decisions and why.
Everything is built around stable contracts in /contracts, with concrete implementations
plugged in as adapters discovered via registries. The golden rule:
New capability = new adapter behind an existing port + register it + declare its schema. The core does not change.
The seams (extension points) you will work in:
| Seam | You add… |
|---|---|
| Model providers | a ModelProvider adapter |
| Tools / MCP | a manifest + sandboxed handler |
| Retrieval | a Retriever strategy |
| Storage | a repository adapter |
| Modalities | a ModalityHandler |
| Agents / roles | a graph node + typed messages |
| UI renderers | a component keyed by output type |
The ports behind these seams are defined in personalai_contracts. For exact signatures, value
objects, the reference fakes, and the step-by-step "how to add an adapter" workflow, see the
Contracts & ports reference. For the rules you must follow
while writing code, see Coding standards and the
Toolchain & monorepo guide.
/contracts # schemas, ports, message envelopes (the stable core API)
/core # orchestration, gateway, security engine, validation
/providers/* # ollama, llamacpp, vllm, remote-litellm
/retrieval/* # vector-pgvector, graph-age, keyword
/storage/* # postgres, qdrant, object-store
/modalities/* # files-tika, files-docling, stt-whisper, tts-piper, vision
/tools/* # internal tools + MCP adapters
/agents/* # planner, researcher, critic, ...
/apps/backend # FastAPI wiring (DI from registries)
/apps/ui # Tauri + SPA
/apps/extension # MV3 browser extension
contractsis the stable core API;coreholds the orchestration, gateway, and validation;appswires everything into the backend and UI; the seam packages (providers,retrieval,storage,modalities,tools,agents) provide the concrete adapters.
- GitHub flow, protected
main, PRs required. See CONTRIBUTING.md. - Conventional Commits.
- Supply chain: every dependency is vetted and recorded in SUPPLY-CHAIN.md. See Dependency Policy.
- Set up the workspace:
make setup(uv + pnpm). See Toolchain & monorepo. - Run it locally:
make run-backendfor the backend andpnpm --filter @personalai/ui devfor the UI — see the Local chat guide. - Find the seam your change belongs behind (the table above) and read the Contracts & ports reference and Dependency injection & registries for the "how to add an adapter" workflow.
- Follow the rules in Coding standards — typed under mypy strict, structured-output-first, inward-only dependencies (enforced by import-linter).
- Run the checks before a PR:
make check(lint + types + tests + architecture + JS).
The golden rule keeps changes contained: a new capability is a new adapter behind an existing port, registered and schema-declared — the core stays stable.