# pankajbishnoi-tech/xpert architecture

> Architecture diagram of the GitHub repository pankajbishnoi-tech/xpert, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pankajbishnoi-tech/xpert
- Repository: https://github.com/pankajbishnoi-tech/xpert

## Overview

Cold Start turns a WhatsApp export into a structured personal map: people and circles, organisations and chat ties, goals, and open loops with suggested help. The main workflow loads and indexes chat data, runs domain-specific extraction, combines the results, and writes output.json; model calls are optional, with rules-based fallback. The README also documents output checking. Relationships follow the README and the shown source/index references; unsampled implementation details are not assumed.

Main entry points: [`solution.py`](https://github.com/pankajbishnoi-tech/xpert/blob/main/solution.py) (Build and combine), [`xpert/data.py`](https://github.com/pankajbishnoi-tech/xpert/blob/main/xpert/data.py) (Load and index), [`xpert/llm.py`](https://github.com/pankajbishnoi-tech/xpert/blob/main/xpert/llm.py) (LLM client), [`xpert/orgs.py`](https://github.com/pankajbishnoi-tech/xpert/blob/main/xpert/orgs.py) (Organisations and chats)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Data ingestion"]
  node_data["Load and index<br/>[data.py]"]
end

subgraph group_analysis["Domain analysis"]
  node_orgs["Organisations and chats<br/>[orgs.py]"]
  node_people["People and circles<br/>[people.py]"]
  node_goals["Goals<br/>[goals.py]"]
  node_loops["Open loops and help<br/>[loops.py]"]
end

subgraph group_runtime["Orchestration and model access"]
  node_builder["Build and combine<br/>[solution.py]"]
  node_llmclient["LLM client<br/>[llm.py]"]
end

subgraph group_validation["Output checking"]
  node_checker["Validate and score<br/>[check.py]"]
end

node_user(("User"))
node_whatsapp["WhatsApp export"]
node_model{{"OpenAI-compatible model API"}}
node_output["output.json"]

node_user -->|"provides"| node_whatsapp
node_whatsapp -->|"loads"| node_data
node_builder -->|"loads"| node_data
node_builder -->|"runs"| node_orgs
node_builder -->|"runs"| node_people
node_builder -->|"runs"| node_goals
node_builder -->|"runs"| node_loops
node_orgs -->|"uses"| node_data
node_people -->|"uses"| node_data
node_goals -->|"uses"| node_data
node_loops -->|"uses"| node_data
node_orgs -->|"requests"| node_llmclient
node_people -->|"requests"| node_llmclient
node_goals -->|"requests"| node_llmclient
node_loops -->|"requests"| node_llmclient
node_llmclient -->|"calls"| node_model
node_builder -->|"writes"| node_output
node_user -->|"runs"| node_checker
node_checker -->|"checks"| node_output

click node_data "https://github.com/pankajbishnoi-tech/xpert/blob/main/xpert/data.py"
click node_orgs "https://github.com/pankajbishnoi-tech/xpert/blob/main/xpert/orgs.py"
click node_people "https://github.com/pankajbishnoi-tech/xpert/blob/main/xpert/people.py"
click node_goals "https://github.com/pankajbishnoi-tech/xpert/blob/main/xpert/goals.py"
click node_loops "https://github.com/pankajbishnoi-tech/xpert/blob/main/xpert/loops.py"
click node_builder "https://github.com/pankajbishnoi-tech/xpert/blob/main/solution.py"
click node_llmclient "https://github.com/pankajbishnoi-tech/xpert/blob/main/xpert/llm.py"
click node_checker "https://github.com/pankajbishnoi-tech/xpert/blob/main/check.py"

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_data,node_user toneBlue
class node_orgs,node_people,node_goals,node_loops toneAmber
class node_builder,node_llmclient,node_model toneMint
class node_checker toneRose
class node_whatsapp,node_output toneIndigo
```

## Components

### Data ingestion

- [Load and index](https://github.com/pankajbishnoi-tech/xpert/blob/main/xpert/data.py): `xpert/data.py`

### Domain analysis

- [Organisations and chats](https://github.com/pankajbishnoi-tech/xpert/blob/main/xpert/orgs.py): `xpert/orgs.py`
- [People and circles](https://github.com/pankajbishnoi-tech/xpert/blob/main/xpert/people.py): `xpert/people.py`
- [Goals](https://github.com/pankajbishnoi-tech/xpert/blob/main/xpert/goals.py): `xpert/goals.py`
- [Open loops and help](https://github.com/pankajbishnoi-tech/xpert/blob/main/xpert/loops.py): `xpert/loops.py`

### Orchestration and model access

- [Build and combine](https://github.com/pankajbishnoi-tech/xpert/blob/main/solution.py): `solution.py`
- [LLM client](https://github.com/pankajbishnoi-tech/xpert/blob/main/xpert/llm.py): `xpert/llm.py`

### Output checking

- [Validate and score](https://github.com/pankajbishnoi-tech/xpert/blob/main/check.py): `check.py`

### Other components

- **User**
- **WhatsApp export**
- **OpenAI-compatible model API**
- **output.json**

## Connections

- User → WhatsApp export: provides (evidence: `README.md`)
- WhatsApp export → Load and index: loads (evidence: `README.md`)
- Build and combine → Load and index: loads (evidence: `solution.py`)
- Build and combine → Organisations and chats: runs (evidence: `solution.py`)
- Build and combine → People and circles: runs (evidence: `solution.py`)
- Build and combine → Goals: runs (evidence: `solution.py`)
- Build and combine → Open loops and help: runs (evidence: `solution.py`)
- Organisations and chats → Load and index: uses (evidence: `xpert/orgs.py`)
- People and circles → Load and index: uses (evidence: `xpert/people.py`)
- Goals → Load and index: uses (evidence: `xpert/goals.py`)
- Open loops and help → Load and index: uses (evidence: `xpert/loops.py`)
- Organisations and chats → LLM client: requests (evidence: `xpert/orgs.py`)
- People and circles → LLM client: requests (evidence: `xpert/people.py`)
- Goals → LLM client: requests (evidence: `xpert/goals.py`)
- Open loops and help → LLM client: requests (evidence: `xpert/loops.py`)
- LLM client → OpenAI-compatible model API: calls (evidence: `xpert/llm.py`)
- Build and combine → output.json: writes (evidence: `README.md`)
- User → Validate and score: runs (evidence: `README.md`)
- Validate and score → output.json: checks (evidence: `README.md`)
