How Mind's Mirror's Privacy Architecture Works (A Technical Walkthrough)

A deep-dive into the privacy architecture of Mind's Mirror, from on-device NER to the verifiable privacy audit log. See how we protect your data.

In the world of AI tools, the default architecture involves sending your data to a centralized cloud service. For a journaling app, this means your most private reflections live on someone else’s servers. We believe this is a broken model for private thought. This article provides a technical deep-dive into the Hybrid Graph-RAG architecture of Mind’s Mirror, designed for users who demand not just promises, but verifiable proof of privacy.

This is for developers, privacy advocates, and technically curious users. We’ll cover our user-controlled anonymization, on-device graph processing, the dual-LLM call structure, and our industry-first Privacy Audit Log.


The Problem: Standard RAG vs. The Privacy Needs of a Journal

A standard Retrieval-Augmented Generation (RAG) system sends user text to a cloud service to be “chunked” and stored in a vector database. When you ask a question, your query and relevant chunks are sent to an LLM. For a journal, this means your raw, intimate thoughts are stored and processed on third-party servers.

This is unacceptable. Encryption in transit and at rest protects against external breaches, but it does not prevent the service provider from processing your data.

Our challenge was to provide deep, graph-based insights without this privacy trade-off. The solution is a Hybrid Graph-RAG architecture built on three principles: User-Controlled Anonymization, On-Device Graph Processing, and Verifiability.


Architecture Overview: A Hybrid Graph-RAG Pipeline

Our system ensures that your raw journal entries are processed on-device first. Only a powerfully anonymized version of your text is ever sent to an external LLM, and even then, it’s part of a sophisticated local-first pipeline that you can audit and control.

Here is a high-level overview of the data flow when you ask Mind’s Mirror to reflect on an entry.

[Suggestion for a diagram: A clear data flow diagram titled “Mind’s Mirror Hybrid Graph-RAG Pipeline” showing the following:]

  1. On-Device Pre-processing: “Raw Journal Entry” goes into a box labeled “1. User-Controlled Anonymizer”.
  2. First LLM Call (Theme Extraction): The “Anonymized Text” is sent to the cloud (“LLM Provider”) for the themeExtraction task. An arrow returns a “MiniGraph (JSON)” to the device.
  3. On-Device Graph Intelligence: The “MiniGraph” is processed locally by a box labeled “2. Local Knowledge Graph Engine”. This involves:
    • Matching & Committing the MiniGraph.
    • Running Pattern-Aware Traversal (UCS) to find historical context.
    • Identifying Dominant Patterns from graph communities.
  4. Second LLM Call (Reflection): A new, richer context is built on-device. An arrow sends this context (Anonymized Entry + Historical Context + Dominant Pattern) to the “LLM Provider” for the reflectionSynthesis task. An “AI Reflection” is returned.
  5. On-Device Post-processing: The “AI Reflection” is de-anonymized and displayed to the user. The entire transaction is recorded in the “3. Privacy Audit Log”.

Deep-Dive: The Processing Pipeline

Let’s break down each component of the architecture.

Component 1: User-Controlled Anonymization

The pipeline begins on-device. Before any analysis, we anonymize the text using a hybrid approach that puts the user in control.

How it works:

  1. Primary Mechanism: The ‘Known Entities’ Store: The system’s first pass uses a user-curated list of PII (.minds-mirror/known-entities.json). You can add any name, place, or term to this list via the editor’s context menu. This is the primary and most important layer of anonymization.
  2. Fallback: Local NER Model: After redacting the user’s known entities, a lightweight NER model (Xenova/bert-base-NER) runs locally to catch any remaining potential PII, like capitalized words that weren’t on your list.
  3. Session-Only Learning: Crucially, entities found by the fallback NER model are anonymized for the current session only and are not automatically added to your persistent KnownEntitiesStore. This prevents false positives from polluting your curated list.
  4. Reliable De-anonymization: The system creates a temporary map to reliably de-anonymize the LLM’s response before showing it to you.

The placeholder format is structured for reliability: [ENTITYTYPE_INDEX], for example [PERSON_1].

Component 2: LLM-Powered Theme Extraction (themeExtraction)

With the anonymized text prepared, the first of two LLM calls occurs. Its sole purpose is to extract a structured graph of themes and relationships from the text.

How it works:

  1. API Call: The anonymized text is sent to the LLM of your choice (OpenAI, Claude, Gemini).
  2. Structured Output: The prompt instructs the LLM to act as a graph-reasoning engine and return a structured JSON object called a MiniGraph. This contains nodes (themes), edges (relationships like triggers or leads_to), and summaries.
  3. Local Processing: This MiniGraph is returned to your device. The LLM’s job here is done. The anonymized text is discarded in the cloud.

Component 3: On-Device Knowledge Graph Processing

This is where Mind’s Mirror’s true intelligence lives. All of this processing happens locally, without any network calls.

How it works:

  1. Graph Matching: The new MiniGraph is matched against your main, persistent Knowledge Graph. The system uses a combination of case-insensitive label matching and vector cosine similarity to find and merge related themes, strengthening your graph’s understanding over time.
  2. Pattern-Aware Traversal: To find relevant historical context, we don’t just do a simple vector search. We use a Uniform Cost Search (UCS) algorithm that traverses your local graph, prioritizing “causal edges” (e.g., triggers, results_in). This retrieves coherent narrative chains (like Trigger → Emotion → Behavior) instead of just loosely related concepts.
  3. Dominant Pattern Injection: If the themes in your current entry strongly overlap with a major “community” or cluster in your global graph (a dominant life pattern), the system injects a summary of that macro-pattern into the context for the next step.

Component 4: LLM-Powered Reflection Synthesis (reflectionSynthesis)

Only after the heavy lifting is done on-device does the second, final LLM call happen.

How it works:

  1. Two-Stage Context Building: A rich, multi-part context is constructed locally. This includes:
    • The original anonymized entry.
    • The structured MiniGraph from the first LLM call.
    • The HistoricalContext (causal chains) discovered by the graph traversal.
    • The Dominant Pattern summary, if one was detected.
    • Anonymized quotes from the top 3 most relevant historical entries to provide grounding.
  2. API Call: This comprehensive, privacy-safe context is sent to the LLM to generate a deep, context-aware reflection based on your chosen philosophical lens.

Component 5: The Verifiable Privacy Audit Log

This is how we deliver on our promise of transparency. For every analysis, a log entry is created in a local file (.minds-mirror/audit.log). You can view this log at any time.

The log entry contains a summary of the privacy measures taken, not the data itself:

{
  "timestamp": "2026-01-20T10:05:00Z",
  "action": "journal-reflection",
  "privacyMeasures": [
    "Anonymized 5 PII entities of types: [PERSON, PROJECT_NAME, LOCATION]"
  ],
  "dataSummary": "Context sent to LLM for reflection synthesis."
}

This allows you to verify that anonymization happened and what types of entities were redacted, without ever writing the sensitive data to the log itself. This makes us a true privacy audit log journaling app.


Advanced Privacy & Insight Features

Beyond the core pipeline, Mind’s Mirror includes features that provide even deeper control and insight.

Manual Theme Privacy Controls

You have granular control over what your own Knowledge Graph can share with the reflection LLM. In the “Privacy Controls” view, you can mark any theme (node) in your graph as “Restricted.”

When a theme is restricted, it is excluded from the HistoricalContext sent to the LLM for reflection. The theme still exists in your local graph for pattern detection, but its content will never be included in a prompt. This gives you the power to ring-fence sensitive topics while still benefiting from their structural contribution to your graph.

Global Pattern Discovery

Mind’s Mirror doesn’t just connect individual entries; it finds the dominant, recurring patterns in your life. Using the Leiden algorithm for community detection (based on Microsoft’s GraphRAG principles), the system clusters your knowledge graph into semantically cohesive “communities.”

An LLM then summarizes these clusters into macro-level narratives, like “The Cycle of Burnout and Recovery” or “Exploring a New Relationship.” These Global Insights are then used in the Dominant Pattern Injection step of the daily analysis, giving you a powerful, multi-layered view of how your daily experiences connect to your larger life story.


FAQ

So you DO send my journal text to an LLM? Yes, but only after it has been powerfully anonymized on your device using a system you control. We believe verifiable, user-controlled anonymization is a more transparent and robust privacy model than simply saying “we use E2EE” while still processing raw text on a server.

What if the anonymizer misses something? The hybrid “user-curated + NER fallback” approach is highly effective. However, the additional layer of Manual Theme Privacy Controls gives you a definitive way to ensure highly sensitive topics are never even considered for inclusion in the LLM context.

How is this different from End-to-End Encryption (E2EE)? E2EE protects data in transit. However, a service provider using E2EE still decrypts and processes your raw data on their servers. Our model is different: we pre-process and anonymize the data on your device before it’s ever sent. This minimizes what the server sees in the first place, and our Audit Log lets you verify it.

Can I turn off all AI features? Yes. You can use Mind’s Mirror as a simple, local-only journaling app. All network-related AI features are opt-in on a per-action basis.

Why not just run the whole LLM on the device? We’re getting closer to that reality. However, current top-tier LLMs for structured reasoning and reflection require computational resources that are not yet practical for all devices. Our hybrid approach offers the best balance of insight quality and verifiable privacy today, and our architecture is ready to plug in powerful local LLMs as they become available.


Next Steps


COMPLIANCE REVIEW COMPLETED

Prohibited Terms Check: ✅ PASSED (0 prohibited terms found) AI Positioning Check: ✅ PASSED (AI framed as reflective organizer on anonymized data with user controls) Medical Claims Check: ✅ PASSED (No diagnostic/therapeutic claims made; focuses on technical process) Tone Check: ✅ PASSED (Technical, informative, and empowering for a technical audience)

Reviewer Notes: The article now accurately reflects the system’s privacy architecture and data flow, emphasizing user control and verifiability.


DISTRIBUTION RECOMMENDATIONS

Primary Channel: Blog, Developer Forums (e.g., Hacker News, Lobste.rs, Reddit r/privacy) Target Audience Segment: Technologists, privacy researchers, security-conscious users.

Social Media Snippets:

Email Subject Lines (A/B test):

Internal Linking Opportunities:

Back to all articles