This is a proof of concept. It is not intended for commercial use, public deployment, or any production purpose.
The goal of this project was to explore how far you can push modern AI techniques to simulate a real person's texting style from a conversation export — without fine-tuning a model. It was built as a personal experiment to understand:
- How to extract a detailed persona from raw conversation data using an LLM
- How to ground a language model's responses in real memories via a vector database (RAG)
- How to shape model behaviour entirely through system prompt engineering — style constraints, biographical facts, anti-hallucination rules
- How SSE streaming works end-to-end from an API to a browser UI
- The limits and failure modes of each approach (hallucination, context window, style drift, emoji over-use…)
No model was fine-tuned. Everything runs on prompt + retrieval.
| Layer | What |
|---|---|
| API | Fastify v5 + Zod + TypeScript |
| Database | PostgreSQL 17 + pgvector (via Docker) |
| Embeddings | Ollama (nomic-embed-text) — runs locally |
| Persona + Chat | Claude (Anthropic API) — claude-sonnet-4-6 |
| Frontend | Next.js 16 + Tailwind CSS v4 |
- Node.js v20+
- Docker + Docker Compose
- Ollama — ollama.com — for local embeddings
- Anthropic API key — for persona extraction and chat
git clone <repo>
cd revive
npm installdocker compose up -dThis starts PostgreSQL 17 with the pgvector extension on port 5432.
cp revive-api/.env.example revive-api/.envEdit revive-api/.env and fill in your Anthropic API key:
DATABASE_URL=postgres://revive:revive@localhost:5432/revive
OLLAMA_BASE_URL=http://localhost:11434
ANTHROPIC_API_KEY=sk-ant-...npm run db:migrate -w revive-apiollama pull nomic-embed-textnpm run devThis starts:
- API on
http://localhost:1997 - Frontend on
http://localhost:3000
- Export a WhatsApp conversation as
.txt(Chat > Export Chat > Without media) - Open
http://localhost:3000 - Drop the file, select who you want to talk to, enter your name
- Wait for the pipeline to run (chunking + embedding + persona extraction)
- Review the extracted persona, adjust if needed
- Start chatting
Upload .txt
│
▼
Parse messages ──► Temporal chunking ──► Embed (nomic-embed-text) ──► pgvector
│
▼
Sample 6 time windows ──► Claude extracts partial PersonaCard × 6 (parallel)
│
▼
Claude merges partials ──► Final PersonaCard (style, quirks, slang, key facts…)
│
▼
User sends message
│
├──► pgvector cosine search ──► top-K relevant excerpts
│
└──► System prompt = PersonaCard + key facts + excerpts + chat history
│
▼
Claude streams response
- Only WhatsApp
.txtexports are supported (bracket and dash formats) - Quality depends entirely on the volume and richness of the source conversation
- The model will sometimes refuse to answer in character — this is expected
- This is not a replacement for human connection