# badarbuilds/openexplee architecture

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

- Interactive diagram: https://gitdiagram.com/badarbuilds/openexplee
- Repository: https://github.com/badarbuilds/openexplee

## Overview

OpenExplee is a local-first, human-approved agentic go-to-market platform. Users describe a product and goal, build a target segment, research and score leads, then generate outreach that remains pending until approved; connected mailboxes support reply handling. Supporting capabilities include website knowledge, shared memory, model-provider selection, diagnostics, and a researched tools catalog. The source index and excerpts establish several internal calls; other links below rely on README-documented capabilities and workflows, not inspection of unsampled implementation.

Main entry points: [`frontend/app.js`](https://github.com/badarbuilds/openexplee/blob/main/frontend/app.js) (Web UI), [`app/gtm/research.py`](https://github.com/badarbuilds/openexplee/blob/main/app/gtm/research.py) (Project research), [`app/search/router.py`](https://github.com/badarbuilds/openexplee/blob/main/app/search/router.py) (Web search), [`app/providers/registry.py`](https://github.com/badarbuilds/openexplee/blob/main/app/providers/registry.py) (Model providers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App and API"]
  node_web["Web UI<br/>[app.js]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_gtm_api["GTM API<br/>[gtm_api.py]"]
  node_email_api["Email API<br/>[email_api.py]"]
  node_memory_api["Memory API<br/>[memory_api.py]"]
  node_diagnostics["Doctor<br/>[checks.py]"]
  node_catalog["Tools Directory<br/>[tools_api.py]"]
end

subgraph group_gtm["GTM workflow"]
  node_projects["Projects<br/>[projects.py]"]
  node_goals["Goals and segments<br/>[segments.py]"]
  node_research["Project research<br/>[research.py]"]
  node_leads["Lead discovery and scoring<br/>[leads.py]"]
  node_outreach["Outreach approval<br/>[outreach.py]"]
end

subgraph group_agents["Agent runtime"]
  node_runner["Agent runner<br/>[runner.py]"]
  node_tasks[("Task queue<br/>[tasks.py]")]
  node_scheduler["Task scheduler<br/>[scheduler.py]"]
end

subgraph group_knowledge["Research and memory"]
  node_website["Website knowledge<br/>[knowledge.py]"]
  node_search["Web search<br/>[router.py]"]
  node_memory[("Shared memory<br/>[store.py]")]
  node_db[("Local SQLite<br/>[db.py]")]
end

subgraph group_integrations["Accounts and integrations"]
  node_providers["Model providers<br/>[registry.py]"]
  node_mailbox["Mailbox connection<br/>[accounts.py]"]
  node_email_assistant["Email assistant<br/>[assistant.py]"]
end

node_user(("Operator"))
node_external_mail{{"SMTP and IMAP"}}
node_model_services{{"Model services and local CLIs"}}
node_search_services{{"Search providers"}}

node_user -->|"uses"| node_web
node_web -.->|"authenticates"| node_auth
node_web -.->|"manages GTM"| node_gtm_api
node_web -.->|"manages inbox"| node_email_api
node_web -.->|"searches memory"| node_memory_api
node_web -.->|"checks health"| node_diagnostics
node_web -.->|"browses tools"| node_catalog
node_gtm_api -.->|"manages projects"| node_projects
node_projects -->|"sets targeting"| node_goals
node_goals -->|"starts research"| node_research
node_research -->|"indexes site"| node_website
node_research -->|"runs searches"| node_search
node_research -->|"stores findings"| node_memory
node_goals -->|"defines segment"| node_leads
node_leads -->|"searches prospects"| node_search
node_leads -->|"feeds prospects"| node_outreach
node_outreach -->|"uses account"| node_mailbox
node_outreach -->|"requests approval"| node_user
node_scheduler -->|"queues work"| node_tasks
node_runner -->|"claims tasks"| node_tasks
node_runner -->|"requests completions"| node_providers
node_runner -->|"invokes search"| node_search
node_website -->|"writes knowledge"| node_memory
node_search -->|"queries providers"| node_search_services
node_providers -->|"selects backend"| node_model_services
node_mailbox -->|"connects mailbox"| node_external_mail
node_email_api -.->|"handles replies"| node_email_assistant
node_email_assistant -->|"reads and sends"| node_mailbox
node_email_assistant -->|"drafts replies"| node_providers
node_memory_api -.->|"accesses memory"| node_memory
node_diagnostics -->|"checks providers"| node_providers
node_catalog -->|"lists tools"| node_user

click node_web "https://github.com/badarbuilds/openexplee/blob/main/frontend/app.js"
click node_auth "https://github.com/badarbuilds/openexplee/blob/main/app/api/auth.py"
click node_gtm_api "https://github.com/badarbuilds/openexplee/blob/main/app/api/gtm_api.py"
click node_email_api "https://github.com/badarbuilds/openexplee/blob/main/app/api/email_api.py"
click node_memory_api "https://github.com/badarbuilds/openexplee/blob/main/app/api/memory_api.py"
click node_diagnostics "https://github.com/badarbuilds/openexplee/blob/main/app/diagnostics/checks.py"
click node_catalog "https://github.com/badarbuilds/openexplee/blob/main/app/api/tools_api.py"
click node_projects "https://github.com/badarbuilds/openexplee/blob/main/app/gtm/projects.py"
click node_goals "https://github.com/badarbuilds/openexplee/blob/main/app/gtm/segments.py"
click node_research "https://github.com/badarbuilds/openexplee/blob/main/app/gtm/research.py"
click node_leads "https://github.com/badarbuilds/openexplee/blob/main/app/gtm/leads.py"
click node_outreach "https://github.com/badarbuilds/openexplee/blob/main/app/gtm/outreach.py"
click node_runner "https://github.com/badarbuilds/openexplee/blob/main/app/agents/runner.py"
click node_tasks "https://github.com/badarbuilds/openexplee/blob/main/app/agents/tasks.py"
click node_scheduler "https://github.com/badarbuilds/openexplee/blob/main/app/agents/scheduler.py"
click node_website "https://github.com/badarbuilds/openexplee/blob/main/app/crawl/knowledge.py"
click node_search "https://github.com/badarbuilds/openexplee/blob/main/app/search/router.py"
click node_memory "https://github.com/badarbuilds/openexplee/blob/main/app/memory/store.py"
click node_db "https://github.com/badarbuilds/openexplee/blob/main/app/db.py"
click node_providers "https://github.com/badarbuilds/openexplee/blob/main/app/providers/registry.py"
click node_mailbox "https://github.com/badarbuilds/openexplee/blob/main/app/email/accounts.py"
click node_email_assistant "https://github.com/badarbuilds/openexplee/blob/main/app/email/assistant.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_web,node_auth,node_gtm_api,node_email_api,node_memory_api,node_diagnostics,node_catalog toneBlue
class node_projects,node_goals,node_research,node_leads,node_outreach toneAmber
class node_runner,node_tasks,node_scheduler toneMint
class node_website,node_search,node_memory,node_db toneRose
class node_providers,node_mailbox,node_email_assistant,node_user,node_external_mail,node_model_services,node_search_services toneIndigo
```

## Components

### App and API

- [Web UI](https://github.com/badarbuilds/openexplee/blob/main/frontend/app.js): `frontend/app.js`
- [Authentication](https://github.com/badarbuilds/openexplee/blob/main/app/api/auth.py): `app/api/auth.py`
- [GTM API](https://github.com/badarbuilds/openexplee/blob/main/app/api/gtm_api.py): `app/api/gtm_api.py`
- [Email API](https://github.com/badarbuilds/openexplee/blob/main/app/api/email_api.py): `app/api/email_api.py`
- [Memory API](https://github.com/badarbuilds/openexplee/blob/main/app/api/memory_api.py): `app/api/memory_api.py`
- [Doctor](https://github.com/badarbuilds/openexplee/blob/main/app/diagnostics/checks.py): `app/diagnostics/checks.py`
- [Tools Directory](https://github.com/badarbuilds/openexplee/blob/main/app/api/tools_api.py): `app/api/tools_api.py`

### GTM workflow

- [Projects](https://github.com/badarbuilds/openexplee/blob/main/app/gtm/projects.py): `app/gtm/projects.py`
- [Goals and segments](https://github.com/badarbuilds/openexplee/blob/main/app/gtm/segments.py): `app/gtm/segments.py`
- [Project research](https://github.com/badarbuilds/openexplee/blob/main/app/gtm/research.py): `app/gtm/research.py`
- [Lead discovery and scoring](https://github.com/badarbuilds/openexplee/blob/main/app/gtm/leads.py): `app/gtm/leads.py`
- [Outreach approval](https://github.com/badarbuilds/openexplee/blob/main/app/gtm/outreach.py): `app/gtm/outreach.py`

### Agent runtime

- [Agent runner](https://github.com/badarbuilds/openexplee/blob/main/app/agents/runner.py): `app/agents/runner.py`
- [Task queue](https://github.com/badarbuilds/openexplee/blob/main/app/agents/tasks.py): `app/agents/tasks.py`
- [Task scheduler](https://github.com/badarbuilds/openexplee/blob/main/app/agents/scheduler.py): `app/agents/scheduler.py`

### Research and memory

- [Website knowledge](https://github.com/badarbuilds/openexplee/blob/main/app/crawl/knowledge.py): `app/crawl/knowledge.py`
- [Web search](https://github.com/badarbuilds/openexplee/blob/main/app/search/router.py): `app/search/router.py`
- [Shared memory](https://github.com/badarbuilds/openexplee/blob/main/app/memory/store.py): `app/memory/store.py`
- [Local SQLite](https://github.com/badarbuilds/openexplee/blob/main/app/db.py): `app/db.py`

### Accounts and integrations

- [Model providers](https://github.com/badarbuilds/openexplee/blob/main/app/providers/registry.py): `app/providers/registry.py`
- [Mailbox connection](https://github.com/badarbuilds/openexplee/blob/main/app/email/accounts.py): `app/email/accounts.py`
- [Email assistant](https://github.com/badarbuilds/openexplee/blob/main/app/email/assistant.py): `app/email/assistant.py`

### Other components

- **Operator**
- **SMTP and IMAP**
- **Model services and local CLIs**
- **Search providers**

## Connections

- Operator → Web UI: uses (evidence: `README.md`)
- Web UI → Authentication: authenticates
- Web UI → GTM API: manages GTM
- Web UI → Email API: manages inbox
- Web UI → Memory API: searches memory
- Web UI → Doctor: checks health
- Web UI → Tools Directory: browses tools
- GTM API → Projects: manages projects
- Projects → Goals and segments: sets targeting (evidence: `README.md`)
- Goals and segments → Project research: starts research (evidence: `README.md`)
- Project research → Website knowledge: indexes site (evidence: `app/gtm/research.py`)
- Project research → Web search: runs searches (evidence: `app/gtm/research.py`)
- Project research → Shared memory: stores findings (evidence: `README.md`)
- Goals and segments → Lead discovery and scoring: defines segment (evidence: `README.md`)
- Lead discovery and scoring → Web search: searches prospects (evidence: `app/gtm/leads.py`)
- Lead discovery and scoring → Outreach approval: feeds prospects (evidence: `README.md`)
- Outreach approval → Mailbox connection: uses account (evidence: `README.md`)
- Outreach approval → Operator: requests approval (evidence: `README.md`)
- Task scheduler → Task queue: queues work (evidence: `app/agents/scheduler.py`)
- Agent runner → Task queue: claims tasks (evidence: `app/agents/runner.py`)
- Agent runner → Model providers: requests completions (evidence: `app/agents/runner.py`)
- Agent runner → Web search: invokes search (evidence: `app/agents/runner.py`)
- Website knowledge → Shared memory: writes knowledge (evidence: `README.md`)
- Web search → Search providers: queries providers (evidence: `app/search/router.py`)
- Model providers → Model services and local CLIs: selects backend (evidence: `app/providers/registry.py`)
- Mailbox connection → SMTP and IMAP: connects mailbox (evidence: `README.md`)
- Email API → Email assistant: handles replies
- Email assistant → Mailbox connection: reads and sends (evidence: `app/email/assistant.py`)
- Email assistant → Model providers: drafts replies (evidence: `app/email/assistant.py`)
- Memory API → Shared memory: accesses memory
- Doctor → Model providers: checks providers (evidence: `app/diagnostics/checks.py`)
- Tools Directory → Operator: lists tools (evidence: `README.md`)
