FamilyTreeAI GitHub
Open Source · Self-Hostable · Bring Your Own LLM

Your family history.
Written by you, with AI on call.

A self-hostable family tree app with an interactive visualizer, AI bio writing, smart record import, and grounded family narratives. Free Gemini built in — or plug in your own OpenAI, Anthropic, GLM, or Kimi key. API keys are encrypted at rest with AES-256-GCM. Your data stays in your Postgres.

5
LLM providers supported
AES-256
Keys encrypted at rest
Postgres
Your database, your control
GEDCOM
Standard export, no lock-in
familytree.local
Descendants Ancestors 🔍 Search…
👨 Arthur Vance
👩 Mae Vance
Eleanor
Thomas
Margaret
Features

A genealogy app for the people who'd rather own their data.

Built around a fast, draggable tree, real AI helpers, and a refreshing absence of subscription dialogs.

Interactive Family Tree

Pan, zoom, and drag any node. Toggle between descendants and ancestors. Search to jump to anyone in your tree instantly.

AI Bio Writer

Generate a respectful, grounded biography for any person from the basics you've recorded — names, dates, places.

Smart Import from Text

Paste an obituary or a sentence and the AI extracts a structured person record — name, gender, dates, places — ready to add.

AI Family Narrative

Pick a focus person and get a 350–600 word narrative woven from your records — strictly grounded, no fabrication.

Bring Your Own LLM

Built-in Google Gemini for the fastest start, plus OpenAI, Anthropic, Zhipu GLM, and Moonshot Kimi via your own API key.

Encrypted API Keys at Rest

Your provider keys are encrypted with AES-256-GCM, bound to your user via AAD, and decrypted only at the moment of an LLM call.

Multi-User with Invitations

Clerk-powered auth out of the box. Admins can invite collaborators by email (optional AgentMail integration).

GEDCOM Export

Download your tree as a standard GEDCOM file at any time. Take it to any other genealogy program — no lock-in.

Postgres-backed

Your records live in the Postgres of your choice — Replit, Neon, Supabase, or your own server. Standard schema, no exotic ORM.

Security

No keys in the browser. Encrypted in the database.

All AI calls are dispatched from the server. Your provider API keys never reach the browser bundle, and the only place they're decrypted is the exact moment we're about to make an LLM request on your behalf.

AES-256-GCM at rest

Authenticated encryption from Node's built-in crypto. Each ciphertext is bound to (userId, provider) via AAD — rows can't be shuffled between users or providers.

Server-only AI dispatch

Every /api/ai/* route sits behind Clerk authentication. The browser never sees provider keys, only the model's response.

Decrypt only on demand

Settings reads return booleans. Decryption fires once per request, immediately before the LLM call, and the plaintext is never logged or persisted.

Boot-time self-check

On startup the server runs an encrypt → decrypt round-trip and logs a loud, unmissable error if the master key is missing or wrong, so misconfiguration never goes unnoticed.

Encryption flow
Your API key (in memory only)
sk-proj-aBcD1234…ZyXw
↓ AES-256-GCM + AAD(userId, provider) ↓
Stored in Postgres
v1:o4DPGe//UHVtSqW9:tZ1kJp…:Q2lwaGVydGV4dEhlcmU=
↓ decrypt only inside /api/ai/* ↓
LLM request to OpenAI / Anthropic / GLM / Kimi
Authorization: Bearer ••••••••••••••
Self-hosting

Run it on your laptop, your VPS, or your Raspberry Pi.

Standard Node.js + Postgres. No Docker required. Five env vars and you're up.

  1. 1
    Clone & install

    Node.js 20+ and a Postgres URL is all you need. Vite handles the dev server.

  2. 2
    Add your secrets

    Clerk for auth, a Postgres URL for storage, a Gemini key for the built-in AI default. Everything else is optional.

  3. 3
    Start it up

    One command runs the Express + Vite server on port 5000. Schema is bootstrapped automatically on first boot.

  4. 4
    Invite your family

    Sign in, add a few people, and (optionally) wire up AgentMail to send invite emails to relatives.

terminal bash
# 1. Clone the repo
git clone https://github.com/nzicecool/FamliyTreeAI.git
cd familytreeai

# 2. Install dependencies
npm install

# 3. Set environment variables
export DATABASE_URL="postgres://user:pw@host/db"
export CLERK_SECRET_KEY="sk_…"
export VITE_CLERK_PUBLISHABLE_KEY="pk_…"
export GEMINI_API_KEY="AIza…"

# Optional
export ENCRYPTION_KEY="$(openssl rand -base64 32)"
export AGENTMAIL_API_KEY="…"

# 4. Run it
npm run dev

# Open http://localhost:5000

Environment variables

Variable Required? What it does
DATABASE_URLRequiredPostgres connection string for your tree, settings, and invites.
CLERK_SECRET_KEYRequiredServer-side Clerk key for verifying user sessions.
VITE_CLERK_PUBLISHABLE_KEYRequiredClient-side Clerk key for the sign-in UI.
GEMINI_API_KEYRecommendedPowers the built-in AI default. Without it, only BYO providers work.
ENCRYPTION_KEYOptionalBase64-encoded 32 bytes. If absent, derived deterministically from your Clerk secret.
AGENTMAIL_API_KEYOptionalSends invite emails when admins invite collaborators.
Tech stack

Built on tools you already trust.

React 19 Vite TypeScript Tailwind CSS Express PostgreSQL Clerk Auth D3 Hierarchy Lucide Icons Google Gemini OpenAI Anthropic Zhipu GLM Moonshot Kimi

Ready to own your family history?

Open source, self-hostable, and private by design. Set it up in a few minutes — no subscription, no upsell.