# bcoslearningapp-glitch/searcher-system architecture

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

- Interactive diagram: https://gitdiagram.com/bcoslearningapp-glitch/searcher-system
- Repository: https://github.com/bcoslearningapp-glitch/searcher-system

## Overview

Product B is a local-first research operating system: researchers organize projects, govern sources and foundational references, develop claims and evidence, plan and run research, and produce reviewable outputs with human approvals and an audit trail. The web app is the user-facing desk; the API exposes bounded research domains, while a worker handles long-running work. The README documents AI-provider adapters, semantic search, selective cloud workspace, and portability. Several domain paths are unsampled, so those capabilities are represented at their existing module directories; dashed links mark runtime relationships not demonstrated by the excerpts.

Main entry points: [`services/api/research_api/main.py`](https://github.com/bcoslearningapp-glitch/searcher-system/blob/main/services/api/research_api/main.py) (API application), [`services/api/research_api/modules/sources_library/service.py`](https://github.com/bcoslearningapp-glitch/searcher-system/blob/main/services/api/research_api/modules/sources_library/service.py) (Source library), [`services/api/research_api/modules/claims_evidence/service.py`](https://github.com/bcoslearningapp-glitch/searcher-system/blob/main/services/api/research_api/modules/claims_evidence/service.py) (Claims and evidence), [`services/api/research_api/modules/design_experiments`](https://github.com/bcoslearningapp-glitch/searcher-system/tree/main/services/api/research_api/modules/design_experiments) (Experiment design)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Research desk"]
  node_web["Web application<br/>[page.tsx]"]
end

subgraph group_research["Research domains"]
  node_project["Project workflow<br/>[service.py]"]
  node_sources["Source library<br/>[service.py]"]
  node_foundations["Foundational references"]
  node_claims["Claims and evidence<br/>[service.py]"]
  node_planning["Research planning"]
  node_orchestration["Research orchestration"]
  node_hypotheses["Hypothesis lab"]
  node_experiments["Experiment design"]
  node_knowledge["Knowledge and terminology"]
  node_ai["AI gateway and tools"]
  node_semantic["Semantic search"]
end

subgraph group_governance["Trust and outputs"]
  node_reliability["AI reliability"]
  node_policy["Governance and audit<br/>[service.py]"]
  node_outputs["Output integrity"]
  node_portability["Project portability"]
  node_workspace["Cloud workspace"]
end

subgraph group_runtime["Runtime services"]
  node_api["API application<br/>[main.py]"]
  node_worker["Background worker<br/>[tasks.py]"]
  node_db[("Canonical database<br/>[db.py]")]
  node_objectstore[("Local object store<br/>[storage.py]")]
end

node_researcher(("Researcher"))
node_provider{{"Cloud AI provider"}}

node_researcher -.->|"uses"| node_web
node_web -.->|"requests"| node_api
node_api -->|"routes to"| node_project
node_api -->|"routes to"| node_sources
node_api -->|"routes to"| node_foundations
node_api -->|"routes to"| node_claims
node_api -.->|"routes to"| node_planning
node_api -.->|"routes to"| node_orchestration
node_api -->|"routes to"| node_hypotheses
node_api -->|"routes to"| node_experiments
node_api -->|"routes to"| node_knowledge
node_api -->|"routes to"| node_ai
node_api -->|"routes to"| node_reliability
node_api -->|"routes to"| node_outputs
node_api -.->|"routes to"| node_portability
node_api -->|"routes to"| node_workspace
node_worker -->|"runs tasks"| node_orchestration
node_worker -->|"ingests sources"| node_sources
node_claims -->|"checks project"| node_project
node_claims -->|"uses sources"| node_sources
node_claims -->|"records governance"| node_policy
node_project -->|"records audit"| node_policy
node_foundations -->|"uses sources"| node_sources
node_foundations -->|"records governance"| node_policy
node_experiments -->|"checks project"| node_project
node_experiments -->|"records governance"| node_policy
node_experiments -->|"checks references"| node_foundations
node_outputs -->|"uses evidence"| node_claims
node_outputs -->|"uses hypotheses"| node_hypotheses
node_outputs -->|"uses terminology"| node_knowledge
node_sources -.->|"stores content"| node_objectstore
node_api -.->|"persists state"| node_db
node_ai -.->|"calls provider"| node_provider
node_semantic -.->|"searches sources"| node_sources
node_workspace -.->|"selectively syncs"| node_db
node_portability -.->|"packages project"| node_db

click node_web "https://github.com/bcoslearningapp-glitch/searcher-system/blob/main/apps/web/src/app/%5Blocale%5D/page.tsx"
click node_api "https://github.com/bcoslearningapp-glitch/searcher-system/blob/main/services/api/research_api/main.py"
click node_worker "https://github.com/bcoslearningapp-glitch/searcher-system/blob/main/services/worker/research_worker/tasks.py"
click node_project "https://github.com/bcoslearningapp-glitch/searcher-system/blob/main/services/api/research_api/modules/project_workflow/service.py"
click node_sources "https://github.com/bcoslearningapp-glitch/searcher-system/blob/main/services/api/research_api/modules/sources_library/service.py"
click node_foundations "https://github.com/bcoslearningapp-glitch/searcher-system/tree/main/services/api/research_api/modules/reference_governance"
click node_claims "https://github.com/bcoslearningapp-glitch/searcher-system/blob/main/services/api/research_api/modules/claims_evidence/service.py"
click node_planning "https://github.com/bcoslearningapp-glitch/searcher-system/tree/main/services/api/research_api/modules/research_planning"
click node_orchestration "https://github.com/bcoslearningapp-glitch/searcher-system/tree/main/services/api/research_api/modules/research_orchestrator"
click node_hypotheses "https://github.com/bcoslearningapp-glitch/searcher-system/tree/main/services/api/research_api/modules/hypothesis_lab"
click node_experiments "https://github.com/bcoslearningapp-glitch/searcher-system/tree/main/services/api/research_api/modules/design_experiments"
click node_knowledge "https://github.com/bcoslearningapp-glitch/searcher-system/tree/main/services/api/research_api/modules/knowledge_memory"
click node_ai "https://github.com/bcoslearningapp-glitch/searcher-system/tree/main/services/api/research_api/modules/ai_gateway"
click node_reliability "https://github.com/bcoslearningapp-glitch/searcher-system/tree/main/services/api/research_api/modules/ai_reliability"
click node_policy "https://github.com/bcoslearningapp-glitch/searcher-system/blob/main/services/api/research_api/modules/governance_audit/service.py"
click node_outputs "https://github.com/bcoslearningapp-glitch/searcher-system/tree/main/services/api/research_api/modules/outputs_integrity"
click node_portability "https://github.com/bcoslearningapp-glitch/searcher-system/tree/main/services/api/research_api/modules/portability"
click node_workspace "https://github.com/bcoslearningapp-glitch/searcher-system/tree/main/services/api/research_api/modules/cloud_workspace"
click node_db "https://github.com/bcoslearningapp-glitch/searcher-system/blob/main/services/api/research_api/platform/db.py"
click node_objectstore "https://github.com/bcoslearningapp-glitch/searcher-system/blob/main/services/api/research_api/platform/storage.py"
click node_semantic "https://github.com/bcoslearningapp-glitch/searcher-system/tree/main/services/api/research_api/modules/search_retrieval"

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 toneBlue
class node_project,node_sources,node_foundations,node_claims,node_planning,node_orchestration,node_hypotheses,node_experiments,node_knowledge,node_ai,node_semantic toneAmber
class node_reliability,node_policy,node_outputs,node_portability,node_workspace toneMint
class node_api,node_worker,node_db,node_objectstore toneRose
class node_researcher,node_provider toneIndigo
```

## Components

### Research desk

- [Web application](https://github.com/bcoslearningapp-glitch/searcher-system/blob/main/apps/web/src/app/%5Blocale%5D/page.tsx): `apps/web/src/app/[locale]/page.tsx`

### Research domains

- [Project workflow](https://github.com/bcoslearningapp-glitch/searcher-system/blob/main/services/api/research_api/modules/project_workflow/service.py): `services/api/research_api/modules/project_workflow/service.py`
- [Source library](https://github.com/bcoslearningapp-glitch/searcher-system/blob/main/services/api/research_api/modules/sources_library/service.py): `services/api/research_api/modules/sources_library/service.py`
- [Foundational references](https://github.com/bcoslearningapp-glitch/searcher-system/tree/main/services/api/research_api/modules/reference_governance): `services/api/research_api/modules/reference_governance`
- [Claims and evidence](https://github.com/bcoslearningapp-glitch/searcher-system/blob/main/services/api/research_api/modules/claims_evidence/service.py): `services/api/research_api/modules/claims_evidence/service.py`
- [Research planning](https://github.com/bcoslearningapp-glitch/searcher-system/tree/main/services/api/research_api/modules/research_planning): `services/api/research_api/modules/research_planning`
- [Research orchestration](https://github.com/bcoslearningapp-glitch/searcher-system/tree/main/services/api/research_api/modules/research_orchestrator): `services/api/research_api/modules/research_orchestrator`
- [Hypothesis lab](https://github.com/bcoslearningapp-glitch/searcher-system/tree/main/services/api/research_api/modules/hypothesis_lab): `services/api/research_api/modules/hypothesis_lab`
- [Experiment design](https://github.com/bcoslearningapp-glitch/searcher-system/tree/main/services/api/research_api/modules/design_experiments): `services/api/research_api/modules/design_experiments`
- [Knowledge and terminology](https://github.com/bcoslearningapp-glitch/searcher-system/tree/main/services/api/research_api/modules/knowledge_memory): `services/api/research_api/modules/knowledge_memory`
- [AI gateway and tools](https://github.com/bcoslearningapp-glitch/searcher-system/tree/main/services/api/research_api/modules/ai_gateway): `services/api/research_api/modules/ai_gateway`
- [Semantic search](https://github.com/bcoslearningapp-glitch/searcher-system/tree/main/services/api/research_api/modules/search_retrieval): `services/api/research_api/modules/search_retrieval`

### Trust and outputs

- [AI reliability](https://github.com/bcoslearningapp-glitch/searcher-system/tree/main/services/api/research_api/modules/ai_reliability): `services/api/research_api/modules/ai_reliability`
- [Governance and audit](https://github.com/bcoslearningapp-glitch/searcher-system/blob/main/services/api/research_api/modules/governance_audit/service.py): `services/api/research_api/modules/governance_audit/service.py`
- [Output integrity](https://github.com/bcoslearningapp-glitch/searcher-system/tree/main/services/api/research_api/modules/outputs_integrity): `services/api/research_api/modules/outputs_integrity`
- [Project portability](https://github.com/bcoslearningapp-glitch/searcher-system/tree/main/services/api/research_api/modules/portability): `services/api/research_api/modules/portability`
- [Cloud workspace](https://github.com/bcoslearningapp-glitch/searcher-system/tree/main/services/api/research_api/modules/cloud_workspace): `services/api/research_api/modules/cloud_workspace`

### Runtime services

- [API application](https://github.com/bcoslearningapp-glitch/searcher-system/blob/main/services/api/research_api/main.py): `services/api/research_api/main.py`
- [Background worker](https://github.com/bcoslearningapp-glitch/searcher-system/blob/main/services/worker/research_worker/tasks.py): `services/worker/research_worker/tasks.py`
- [Canonical database](https://github.com/bcoslearningapp-glitch/searcher-system/blob/main/services/api/research_api/platform/db.py): `services/api/research_api/platform/db.py`
- [Local object store](https://github.com/bcoslearningapp-glitch/searcher-system/blob/main/services/api/research_api/platform/storage.py): `services/api/research_api/platform/storage.py`

### Other components

- **Researcher**
- **Cloud AI provider**

## Connections

- Researcher → Web application: uses
- Web application → API application: requests
- API application → Project workflow: routes to (evidence: `services/api/research_api/main.py`)
- API application → Source library: routes to (evidence: `services/api/research_api/main.py`)
- API application → Foundational references: routes to (evidence: `services/api/research_api/main.py`)
- API application → Claims and evidence: routes to (evidence: `services/api/research_api/main.py`)
- API application → Research planning: routes to (evidence: `services/api/research_api/main.py`)
- API application → Research orchestration: routes to (evidence: `services/api/research_api/main.py`)
- API application → Hypothesis lab: routes to (evidence: `services/api/research_api/main.py`)
- API application → Experiment design: routes to (evidence: `services/api/research_api/main.py`)
- API application → Knowledge and terminology: routes to (evidence: `services/api/research_api/main.py`)
- API application → AI gateway and tools: routes to (evidence: `services/api/research_api/main.py`)
- API application → AI reliability: routes to (evidence: `services/api/research_api/main.py`)
- API application → Output integrity: routes to (evidence: `services/api/research_api/main.py`)
- API application → Project portability: routes to (evidence: `services/api/research_api/main.py`)
- API application → Cloud workspace: routes to (evidence: `services/api/research_api/main.py`)
- Background worker → Research orchestration: runs tasks (evidence: `services/worker/research_worker/tasks.py`)
- Background worker → Source library: ingests sources (evidence: `services/worker/research_worker/tasks.py`)
- Claims and evidence → Project workflow: checks project (evidence: `services/api/research_api/modules/claims_evidence/service.py`)
- Claims and evidence → Source library: uses sources (evidence: `services/api/research_api/modules/claims_evidence/service.py`)
- Claims and evidence → Governance and audit: records governance (evidence: `services/api/research_api/modules/claims_evidence/service.py`)
- Project workflow → Governance and audit: records audit (evidence: `services/api/research_api/modules/project_workflow/service.py`)
- Foundational references → Source library: uses sources (evidence: `services/api/research_api/modules/reference_governance/service.py`)
- Foundational references → Governance and audit: records governance (evidence: `services/api/research_api/modules/reference_governance/service.py`)
- Experiment design → Project workflow: checks project (evidence: `services/api/research_api/modules/design_experiments/experiment_service.py`)
- Experiment design → Governance and audit: records governance (evidence: `services/api/research_api/modules/design_experiments/experiment_service.py`)
- Experiment design → Foundational references: checks references (evidence: `services/api/research_api/modules/design_experiments/experiment_service.py`)
- Output integrity → Claims and evidence: uses evidence (evidence: `services/api/research_api/modules/outputs_integrity/pipeline.py`)
- Output integrity → Hypothesis lab: uses hypotheses (evidence: `services/api/research_api/modules/outputs_integrity/pipeline.py`)
- Output integrity → Knowledge and terminology: uses terminology (evidence: `services/api/research_api/modules/outputs_integrity/pipeline.py`)
- Source library → Local object store: stores content (evidence: `services/api/research_api/modules/sources_library/service.py`)
- API application → Canonical database: persists state
- AI gateway and tools → Cloud AI provider: calls provider
- Semantic search → Source library: searches sources
- Cloud workspace → Canonical database: selectively syncs
- Project portability → Canonical database: packages project
