Architecture & Infrastructure

How Journetta Works

Journetta is more than a chat interface. Behind it runs its own infrastructure: Supabase Edge Functions, a multi-layer prompt pipeline, and a memory system built on real vector search rather than a simple chat window. Here's a look at how that actually works behind the scenes.

System-Prompt Pipeline

One response, six layers of context assembled on the fly

The chat runs through its own Supabase Edge Function. On every message, the system prompt is rebuilt from scratch - not from a fixed template, but from up to six layers pulled together in real time from different sources before any request ever reaches the language model.

System identity & phase logic

Fixed rules for conversation flow, tone, and coaching-phase transitions - written once, independent of the user's language.

Persona settings

Name, tone of voice, and special instructions from the user's own settings, loaded fresh from the database on every request.

The right coach

One of six specialized coach personas, chosen automatically based on the topic (multi-agent routing).

Profile & goals

Goals, vision, and open commitments straight from the user's own data - no separate lookup, part of the same request.

Memories via vector search

The most relevant memories, found through similarity search over embeddings (Retrieval-Augmented Generation) instead of plain keyword matching.

Summary & recent messages

A continuously updated conversation summary plus the last messages verbatim, so the model's context window never overflows.

Together, this adds up to a freshly built, fitting system prompt for every single reply.

Memory & RAG

A memory that actually searches instead of just storing

Journetta's long-term memory is built on Retrieval-Augmented Generation: Postgres with the pgvector extension as the vector database, plus an HNSW index for fast similarity search. Memories aren't created during the chat itself - they come from a separate pipeline running in the background.

Automatic pattern recognition

New conversations are automatically scanned for recurring themes and insights - no one has to actively flag or save anything.

Vector-based, not keyword search

Memories are stored as vectors, so content with the same meaning gets found even when it's phrased differently.

Deduplication instead of duplicates

Memories that already exist in substance get recognized and reinforced instead of saved again - robust, recurring patterns emerge over time as a result.

Context-aware retrieval

On every new message, exactly the memories most relevant to the current conversation get pulled in.

Memory in several layers

More than individual memories

Beyond individual memories, Journetta builds a few more layers of memory - from condensed summaries spanning weeks and months to careful hypotheses about the user. Behind that sit several small, specialized background processes instead of one big one.

Weekly & monthly summaries

Alongside the running conversation summary, a separate workflow aggregates memories over longer stretches of time into higher-level reports - making recurring themes visible across weeks and months.

Deeper understanding, not just facts

A weekly process derives careful hypotheses about the user from the memories gathered so far - visible and explicitly contestable, not silent profiling in the background.

Overnight conversation impulses

Another background process detects moments where someone seems stuck and turns them into its own conversation impulses for the next proactive message - independent of any active chat session.

Many small extractions instead of one big one

Fact extraction, writing-style learning, summarization, and overnight impulses all run as separate workflows, each with its own focused AI call - instead of a single do-everything prompt.

Several coaches, one conversation

Automatic topic detection instead of manual selection

Instead of one generic system prompt, Journetta keeps six independent coach personas in the database. A classification step figures out which one fits each message and switches mid-conversation the moment the topic noticeably changes.

Career Coach

Professional topics, conflicting priorities, decisions

Discipline Coach

Habits, routines, procrastination

Mental Coach

Stress, self-doubt, inner blocks

Relationship Coach

Conflict, communication, closeness

Reflection Coach

Values, identity, open questions

Generalist

Everything in between - the most common case

Automation in the background

n8n as its own automation layer

A lot of what makes Journetta work doesn't happen during the chat itself, but afterwards: a separate network of n8n workflows, running on schedules, accessing the same data as the chat through the Supabase API.

Memory pipeline

Runs automatically in the background, processes new conversations with an AI call, and writes the results back into the database.

Proactive messages

Dedicated schedules regularly check for recurring patterns or open commitments and trigger a push message when it makes sense.

Weekly & monthly reflection

Dedicated jobs summarize the week or month, have a language model write a synthesis, and store the result.

Versioned like the rest of the code

Every workflow lives as its own file in the same repository as the rest of the code - traceable instead of scattered.

Native App & Push

One codebase, one real native app

At its core, Journetta is a Nuxt application embedded into a native Android app via Capacitor. Instead of maintaining two separate codebases, the app loads the live web version - native features like push notifications still run through real native bridges.

Capacitor instead of a second codebase

One single Nuxt codebase, extended with native plugins and an Android build through Capacitor.

Push through OneSignal

Notifications run through a dedicated edge function and OneSignal, including their own device management - not directly through Firebase.

One pipeline for web & app

Proactive messages and reminders run through the same code for both web push and native push - one path instead of two.

Infrastructure & Privacy

Built on a modern, proven stack

The entire infrastructure runs on Supabase. Only the content users write themselves ever reaches the AI models - never a name, email address, or other directly identifying data. That's built into the system, not just a policy.

Nuxt 4 (SSR)Supabase (Postgres, Auth, Edge Functions, RLS)pgvector + HNSW indexn8n (workflow orchestration)Self-Hosted LLMsCapacitor (native Android wrapper)Cloudflare (hosting)Stripe (billing)