# intuition-lab/personal-model architecture

> Architecture diagram of the GitHub repository intuition-lab/personal-model, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/intuition-lab/personal-model
- Repository: https://github.com/intuition-lab/personal-model

## Overview

Personal Model is a local-first memory runtime for coding agents. Its main flow is owner-authorized Mac activity capture, conversion into evidence-linked observations and evolving memory, then retrieval and inspection through MCP and the local API. The graph also preserves the model viewer and optional mobile/Apple Health paths visible in the repository tree. Edges are limited to README statements and SOURCE INDEX references; unsampled integrations are shown only as unverified dashed links.

Main entry points: [`src/persome/writer`](https://github.com/intuition-lab/personal-model/tree/main/src/persome/writer) (Memory writer), [`src/persome/store/fts.py`](https://github.com/intuition-lab/personal-model/blob/main/src/persome/store/fts.py) (Memory and search store), [`src/persome/capture`](https://github.com/intuition-lab/personal-model/tree/main/src/persome/capture) (Capture pipeline), [`src/persome/mcp/server.py`](https://github.com/intuition-lab/personal-model/blob/main/src/persome/mcp/server.py) (MCP server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Activity capture"]
  node_capture_pipeline["Capture pipeline"]
  node_privacy["Privacy scrubbing<br/>[scrub.py]"]
  node_source_import["Source import<br/>[source_import.py]"]
  node_event_dispatcher["Event dispatch"]
end

subgraph group_memory["Memory construction"]
  node_writer["Memory writer"]
  node_llm["LLM provider<br/>[llm.py]"]
  node_evo["Memory evolution<br/>[engine.py]"]
  node_model_build["Model builder<br/>[build.py]"]
  node_evidence["Evidence receipts<br/>[evidence.py]"]
  node_memory_store[("Memory and search store<br/>[fts.py]")]
  node_relation_edges[("Relationship graph<br/>[relation_edges.py]")]
  node_timeline[("Timeline<br/>[store.py]")]
end

subgraph group_interfaces["Runtime interfaces"]
  node_mcp_server["MCP server<br/>[server.py]"]
  node_api["Local HTTP API<br/>[routes.py]"]
  node_auth["Owner authentication<br/>[auth.py]"]
  node_model_api["Model inspection API<br/>[model_view.py]"]
  node_viewer["3D model viewer<br/>[viewer.js]"]
end

subgraph group_clients["Companion integrations"]
  node_companion["iOS companion"]
  node_share_extension["Share extension"]
  node_health_relay["Apple Health relay<br/>[main.swift]"]
end

node_owner(("Owner"))
node_mac_apps["Mac activity"]
node_mcp_clients(("Trusted MCP clients"))
node_runtime(("Local runtime"))

node_owner -->|"authorizes capture"| node_capture_pipeline
node_mac_apps -->|"supplies activity"| node_capture_pipeline
node_capture_pipeline -.->|"feeds observations"| node_writer
node_capture_pipeline -.->|"scrubs data"| node_privacy
node_owner -.->|"selects sources"| node_source_import
node_source_import -.->|"imports documents"| node_writer
node_event_dispatcher -.->|"dispatches events"| node_capture_pipeline
node_writer -->|"requests generation"| node_llm
node_writer -.->|"writes memories"| node_memory_store
node_writer -.->|"reconciles memories"| node_evo
node_evo -->|"reads and updates"| node_memory_store
node_writer -.->|"builds model"| node_model_build
node_evidence -->|"sources observations"| node_model_build
node_memory_store -->|"supports relations"| node_relation_edges
node_memory_store -->|"uses timeline data"| node_timeline
node_mcp_clients -->|"requests context"| node_mcp_server
node_mcp_server -->|"searches memories"| node_memory_store
node_mcp_server -->|"projects model"| node_model_build
node_runtime -->|"serves locally"| node_api
node_api -->|"checks access"| node_auth
node_api -->|"queries index"| node_memory_store
node_model_api -.->|"feeds visualization"| node_viewer
node_owner -.->|"shares content"| node_share_extension
node_share_extension -->|"queues mobile event"| node_companion
node_companion -.->|"forwards events"| node_runtime
node_health_relay -.->|"forwards health data"| node_runtime

click node_capture_pipeline "https://github.com/intuition-lab/personal-model/tree/main/src/persome/capture"
click node_privacy "https://github.com/intuition-lab/personal-model/blob/main/src/persome/privacy/scrub.py"
click node_source_import "https://github.com/intuition-lab/personal-model/blob/main/src/persome/source_import.py"
click node_event_dispatcher "https://github.com/intuition-lab/personal-model/blob/main/src/persome/capture/event_dispatcher.py"
click node_writer "https://github.com/intuition-lab/personal-model/tree/main/src/persome/writer"
click node_llm "https://github.com/intuition-lab/personal-model/blob/main/src/persome/writer/llm.py"
click node_evo "https://github.com/intuition-lab/personal-model/blob/main/src/persome/evomem/engine.py"
click node_model_build "https://github.com/intuition-lab/personal-model/blob/main/src/persome/model/build.py"
click node_evidence "https://github.com/intuition-lab/personal-model/blob/main/src/persome/evidence.py"
click node_memory_store "https://github.com/intuition-lab/personal-model/blob/main/src/persome/store/fts.py"
click node_relation_edges "https://github.com/intuition-lab/personal-model/blob/main/src/persome/store/relation_edges.py"
click node_timeline "https://github.com/intuition-lab/personal-model/blob/main/src/persome/timeline/store.py"
click node_mcp_server "https://github.com/intuition-lab/personal-model/blob/main/src/persome/mcp/server.py"
click node_api "https://github.com/intuition-lab/personal-model/blob/main/src/persome/api/routes.py"
click node_auth "https://github.com/intuition-lab/personal-model/blob/main/src/persome/security/auth.py"
click node_model_api "https://github.com/intuition-lab/personal-model/blob/main/src/persome/api/model_view.py"
click node_viewer "https://github.com/intuition-lab/personal-model/blob/main/resources/model_assets/viewer.js"
click node_companion "https://github.com/intuition-lab/personal-model/blob/main/clients/persome-companion/Sources/PersomeCompanionCore/CompanionClient.swift"
click node_share_extension "https://github.com/intuition-lab/personal-model/blob/main/clients/persome-companion/ShareExtension/ShareViewController.swift"
click node_health_relay "https://github.com/intuition-lab/personal-model/blob/main/connectors/apple-health/Sources/PersomeHealthRelay/main.swift"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_capture_pipeline,node_privacy,node_source_import,node_event_dispatcher,node_mcp_clients toneBlue
class node_writer,node_llm,node_evo,node_model_build,node_evidence,node_memory_store,node_relation_edges,node_timeline toneAmber
class node_mcp_server,node_api,node_auth,node_model_api,node_viewer toneMint
class node_companion,node_share_extension,node_health_relay toneRose
class node_owner,node_mac_apps,node_runtime toneIndigo
```

## Components

### Activity capture

- [Capture pipeline](https://github.com/intuition-lab/personal-model/tree/main/src/persome/capture): `src/persome/capture`
- [Privacy scrubbing](https://github.com/intuition-lab/personal-model/blob/main/src/persome/privacy/scrub.py): `src/persome/privacy/scrub.py`
- [Source import](https://github.com/intuition-lab/personal-model/blob/main/src/persome/source_import.py): `src/persome/source_import.py`
- [Event dispatch](https://github.com/intuition-lab/personal-model/blob/main/src/persome/capture/event_dispatcher.py): `src/persome/capture/event_dispatcher.py`

### Memory construction

- [Memory writer](https://github.com/intuition-lab/personal-model/tree/main/src/persome/writer): `src/persome/writer`
- [LLM provider](https://github.com/intuition-lab/personal-model/blob/main/src/persome/writer/llm.py): `src/persome/writer/llm.py`
- [Memory evolution](https://github.com/intuition-lab/personal-model/blob/main/src/persome/evomem/engine.py): `src/persome/evomem/engine.py`
- [Model builder](https://github.com/intuition-lab/personal-model/blob/main/src/persome/model/build.py): `src/persome/model/build.py`
- [Evidence receipts](https://github.com/intuition-lab/personal-model/blob/main/src/persome/evidence.py): `src/persome/evidence.py`
- [Memory and search store](https://github.com/intuition-lab/personal-model/blob/main/src/persome/store/fts.py): `src/persome/store/fts.py`
- [Relationship graph](https://github.com/intuition-lab/personal-model/blob/main/src/persome/store/relation_edges.py): `src/persome/store/relation_edges.py`
- [Timeline](https://github.com/intuition-lab/personal-model/blob/main/src/persome/timeline/store.py): `src/persome/timeline/store.py`

### Runtime interfaces

- [MCP server](https://github.com/intuition-lab/personal-model/blob/main/src/persome/mcp/server.py): `src/persome/mcp/server.py`
- [Local HTTP API](https://github.com/intuition-lab/personal-model/blob/main/src/persome/api/routes.py): `src/persome/api/routes.py`
- [Owner authentication](https://github.com/intuition-lab/personal-model/blob/main/src/persome/security/auth.py): `src/persome/security/auth.py`
- [Model inspection API](https://github.com/intuition-lab/personal-model/blob/main/src/persome/api/model_view.py): `src/persome/api/model_view.py`
- [3D model viewer](https://github.com/intuition-lab/personal-model/blob/main/resources/model_assets/viewer.js): `resources/model_assets/viewer.js`

### Companion integrations

- [iOS companion](https://github.com/intuition-lab/personal-model/blob/main/clients/persome-companion/Sources/PersomeCompanionCore/CompanionClient.swift): `clients/persome-companion/Sources/PersomeCompanionCore/CompanionClient.swift`
- [Share extension](https://github.com/intuition-lab/personal-model/blob/main/clients/persome-companion/ShareExtension/ShareViewController.swift): `clients/persome-companion/ShareExtension/ShareViewController.swift`
- [Apple Health relay](https://github.com/intuition-lab/personal-model/blob/main/connectors/apple-health/Sources/PersomeHealthRelay/main.swift): `connectors/apple-health/Sources/PersomeHealthRelay/main.swift`

### Other components

- **Owner**
- **Mac activity**
- **Trusted MCP clients**
- **Local runtime**

## Connections

- Owner → Capture pipeline: authorizes capture (evidence: `README.md`)
- Mac activity → Capture pipeline: supplies activity (evidence: `README.md`)
- Capture pipeline → Memory writer: feeds observations
- Capture pipeline → Privacy scrubbing: scrubs data
- Owner → Source import: selects sources
- Source import → Memory writer: imports documents
- Event dispatch → Capture pipeline: dispatches events
- Memory writer → LLM provider: requests generation (evidence: `src/persome/writer/llm.py`)
- Memory writer → Memory and search store: writes memories (evidence: `src/persome/store/fts.py`)
- Memory writer → Memory evolution: reconciles memories
- Memory evolution → Memory and search store: reads and updates (evidence: `src/persome/evomem/engine.py`)
- Memory writer → Model builder: builds model
- Evidence receipts → Model builder: sources observations (evidence: `src/persome/evidence.py`)
- Memory and search store → Relationship graph: supports relations (evidence: `src/persome/store/fts.py`)
- Memory and search store → Timeline: uses timeline data (evidence: `src/persome/store/fts.py`)
- Trusted MCP clients → MCP server: requests context (evidence: `README.md`)
- MCP server → Memory and search store: searches memories (evidence: `src/persome/mcp/server.py`)
- MCP server → Model builder: projects model (evidence: `src/persome/mcp/server.py`)
- Local runtime → Local HTTP API: serves locally (evidence: `src/persome/api/routes.py`)
- Local HTTP API → Owner authentication: checks access (evidence: `src/persome/api/routes.py`)
- Local HTTP API → Memory and search store: queries index (evidence: `src/persome/api/routes.py`)
- Model inspection API → 3D model viewer: feeds visualization
- Owner → Share extension: shares content
- Share extension → iOS companion: queues mobile event (evidence: `clients/persome-companion/ShareExtension/ShareViewController.swift`)
- iOS companion → Local runtime: forwards events
- Apple Health relay → Local runtime: forwards health data (evidence: `connectors/apple-health/Sources/PersomeHealthRelay/main.swift`)
