# mbsai/citelume architecture

> Architecture diagram of the GitHub repository mbsai/citelume, 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/mbsai/citelume
- Repository: https://github.com/mbsai/citelume

## Overview

CiteLume is a literature-review assistant: researchers submit a question, optionally configure a review protocol, retrieve and select studies, then inspect synthesis and evidence products or export them. The graph preserves the README’s major capabilities, including database-count gap maps and citation networks. Several implementation links are documented in the README or SOURCE INDEX rather than shown in excerpts; unsampled internals are represented at their exact source paths, with no inferred call-level detail.

Main entry points: [`backend/main.py`](https://github.com/mbsai/citelume/blob/main/backend/main.py) (HTTP API), [`frontend/src/App.jsx`](https://github.com/mbsai/citelume/blob/main/frontend/src/App.jsx) (Review workspace), [`backend/services/synthesis_engine.py`](https://github.com/mbsai/citelume/blob/main/backend/services/synthesis_engine.py) (Cited synthesis), [`frontend/src/utils/api.js`](https://github.com/mbsai/citelume/blob/main/frontend/src/utils/api.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Research interface"]
  node_app["Review workspace<br/>[App.jsx]"]
  node_guided["Guided protocol<br/>[GuidedReview.jsx]"]
  node_api["API client<br/>[api.js]"]
end

subgraph group_retrieval["Question and retrieval"]
  node_backend["HTTP API<br/>[main.py]"]
  node_models["Review data models<br/>[models.py]"]
  node_planning["Query planning<br/>[query_planning.py]"]
  node_sources["Literature sources"]
end

subgraph group_review["Review pipeline"]
  node_selection["Study selection<br/>[paper_selection.py]"]
  node_corpus[("Corpus store<br/>[corpus_store.py]")]
  node_fulltext["Full-text retrieval<br/>[fulltext.py]"]
  node_protocol["Review protocol<br/>[review_protocol.py]"]
end

subgraph group_analysis["Evidence analysis"]
  node_llm["LLM service<br/>[llm_service.py]"]
  node_synthesis["Cited synthesis"]
  node_claims["Claim synthesis<br/>[claim_synthesis.py]"]
  node_verification["Citation checks"]
  node_evidence["Evidence table"]
  node_appraisal["Framework appraisal"]
  node_gaps["Knowledge-gap matrix"]
  node_gapmap["Evidence gap map<br/>[gap_map.py]"]
  node_network["Literature network<br/>[network_engine.py]"]
end

subgraph group_delivery["Results and export"]
  node_results["Review results<br/>[SynthesisPanel.jsx]"]
  node_tableview["Evidence display<br/>[EvidenceTable.jsx]"]
  node_matrixview["Gap display"]
  node_mapview["Gap-map display<br/>[GapMap.jsx]"]
  node_networkview["Network display"]
  node_export["Review exports<br/>[export_service.py]"]
end

node_researcher(("Researcher"))
node_external_sources[("Academic databases")]
node_external_llm["LLM providers"]

node_researcher -->|"asks question"| node_app
node_app -->|"sets protocol"| node_guided
node_guided -->|"submits protocol"| node_api
node_app -->|"requests analysis"| node_api
node_api -->|"calls endpoints"| node_backend
node_backend -->|"prepares query"| node_planning
node_backend -->|"proposes protocol"| node_protocol
node_planning -.->|"plans with model"| node_llm
node_backend -->|"searches sources"| node_sources
node_sources -->|"queries databases"| node_external_sources
node_backend -->|"selects studies"| node_selection
node_backend -->|"stores corpus"| node_corpus
node_backend -->|"retrieves text"| node_fulltext
node_backend -->|"builds review"| node_synthesis
node_synthesis -->|"requests generation"| node_llm
node_llm -->|"calls provider"| node_external_llm
node_synthesis -->|"builds claims"| node_claims
node_synthesis -->|"checks citations"| node_verification
node_synthesis -->|"builds evidence"| node_evidence
node_evidence -->|"routes appraisal"| node_appraisal
node_backend -->|"derives gaps"| node_gaps
node_app -->|"requests counts"| node_gapmap
node_backend -.->|"builds network"| node_network
node_app -->|"shows synthesis"| node_results
node_app -->|"shows evidence"| node_tableview
node_app -->|"shows gaps"| node_matrixview
node_app -->|"shows map"| node_mapview
node_app -->|"shows network"| node_networkview
node_backend -->|"creates exports"| node_export

click node_app "https://github.com/mbsai/citelume/blob/main/frontend/src/App.jsx"
click node_guided "https://github.com/mbsai/citelume/blob/main/frontend/src/components/GuidedReview.jsx"
click node_api "https://github.com/mbsai/citelume/blob/main/frontend/src/utils/api.js"
click node_backend "https://github.com/mbsai/citelume/blob/main/backend/main.py"
click node_models "https://github.com/mbsai/citelume/blob/main/backend/models.py"
click node_planning "https://github.com/mbsai/citelume/blob/main/backend/services/query_planning.py"
click node_sources "https://github.com/mbsai/citelume/tree/main/backend/services"
click node_selection "https://github.com/mbsai/citelume/blob/main/backend/services/paper_selection.py"
click node_corpus "https://github.com/mbsai/citelume/blob/main/backend/services/corpus_store.py"
click node_fulltext "https://github.com/mbsai/citelume/blob/main/backend/services/fulltext.py"
click node_protocol "https://github.com/mbsai/citelume/blob/main/backend/services/review_protocol.py"
click node_llm "https://github.com/mbsai/citelume/blob/main/backend/services/llm_service.py"
click node_synthesis "https://github.com/mbsai/citelume/blob/main/backend/services/synthesis_engine.py"
click node_claims "https://github.com/mbsai/citelume/blob/main/backend/services/claim_synthesis.py"
click node_verification "https://github.com/mbsai/citelume/blob/main/backend/services/verification_gates.py"
click node_evidence "https://github.com/mbsai/citelume/blob/main/backend/services/evidence_table_engine.py"
click node_appraisal "https://github.com/mbsai/citelume/blob/main/backend/frameworks/appraisal_routes.py"
click node_gaps "https://github.com/mbsai/citelume/blob/main/backend/services/gap_matrix_engine.py"
click node_gapmap "https://github.com/mbsai/citelume/blob/main/backend/services/gap_map.py"
click node_network "https://github.com/mbsai/citelume/blob/main/backend/services/network_engine.py"
click node_results "https://github.com/mbsai/citelume/blob/main/frontend/src/components/SynthesisPanel.jsx"
click node_tableview "https://github.com/mbsai/citelume/blob/main/frontend/src/components/EvidenceTable.jsx"
click node_matrixview "https://github.com/mbsai/citelume/blob/main/frontend/src/components/KnowledgeGapMatrix.jsx"
click node_mapview "https://github.com/mbsai/citelume/blob/main/frontend/src/components/GapMap.jsx"
click node_networkview "https://github.com/mbsai/citelume/blob/main/frontend/src/components/LiteratureGraph.jsx"
click node_export "https://github.com/mbsai/citelume/blob/main/backend/services/export_service.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_app,node_guided,node_api toneBlue
class node_backend,node_models,node_planning,node_sources,node_external_sources toneAmber
class node_selection,node_corpus,node_fulltext,node_protocol toneMint
class node_llm,node_synthesis,node_claims,node_verification,node_evidence,node_appraisal,node_gaps,node_gapmap,node_network toneRose
class node_results,node_tableview,node_matrixview,node_mapview,node_networkview,node_export,node_researcher,node_external_llm toneIndigo
```

## Components

### Research interface

- [Review workspace](https://github.com/mbsai/citelume/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Guided protocol](https://github.com/mbsai/citelume/blob/main/frontend/src/components/GuidedReview.jsx): `frontend/src/components/GuidedReview.jsx`
- [API client](https://github.com/mbsai/citelume/blob/main/frontend/src/utils/api.js): `frontend/src/utils/api.js`

### Question and retrieval

- [HTTP API](https://github.com/mbsai/citelume/blob/main/backend/main.py): `backend/main.py`
- [Review data models](https://github.com/mbsai/citelume/blob/main/backend/models.py): `backend/models.py`
- [Query planning](https://github.com/mbsai/citelume/blob/main/backend/services/query_planning.py): `backend/services/query_planning.py`
- [Literature sources](https://github.com/mbsai/citelume/tree/main/backend/services): `backend/services`

### Review pipeline

- [Study selection](https://github.com/mbsai/citelume/blob/main/backend/services/paper_selection.py): `backend/services/paper_selection.py`
- [Corpus store](https://github.com/mbsai/citelume/blob/main/backend/services/corpus_store.py): `backend/services/corpus_store.py`
- [Full-text retrieval](https://github.com/mbsai/citelume/blob/main/backend/services/fulltext.py): `backend/services/fulltext.py`
- [Review protocol](https://github.com/mbsai/citelume/blob/main/backend/services/review_protocol.py): `backend/services/review_protocol.py`

### Evidence analysis

- [LLM service](https://github.com/mbsai/citelume/blob/main/backend/services/llm_service.py): `backend/services/llm_service.py`
- [Cited synthesis](https://github.com/mbsai/citelume/blob/main/backend/services/synthesis_engine.py): `backend/services/synthesis_engine.py`
- [Claim synthesis](https://github.com/mbsai/citelume/blob/main/backend/services/claim_synthesis.py): `backend/services/claim_synthesis.py`
- [Citation checks](https://github.com/mbsai/citelume/blob/main/backend/services/verification_gates.py): `backend/services/verification_gates.py`
- [Evidence table](https://github.com/mbsai/citelume/blob/main/backend/services/evidence_table_engine.py): `backend/services/evidence_table_engine.py`
- [Framework appraisal](https://github.com/mbsai/citelume/blob/main/backend/frameworks/appraisal_routes.py): `backend/frameworks/appraisal_routes.py`
- [Knowledge-gap matrix](https://github.com/mbsai/citelume/blob/main/backend/services/gap_matrix_engine.py): `backend/services/gap_matrix_engine.py`
- [Evidence gap map](https://github.com/mbsai/citelume/blob/main/backend/services/gap_map.py): `backend/services/gap_map.py`
- [Literature network](https://github.com/mbsai/citelume/blob/main/backend/services/network_engine.py): `backend/services/network_engine.py`

### Results and export

- [Review results](https://github.com/mbsai/citelume/blob/main/frontend/src/components/SynthesisPanel.jsx): `frontend/src/components/SynthesisPanel.jsx`
- [Evidence display](https://github.com/mbsai/citelume/blob/main/frontend/src/components/EvidenceTable.jsx): `frontend/src/components/EvidenceTable.jsx`
- [Gap display](https://github.com/mbsai/citelume/blob/main/frontend/src/components/KnowledgeGapMatrix.jsx): `frontend/src/components/KnowledgeGapMatrix.jsx`
- [Gap-map display](https://github.com/mbsai/citelume/blob/main/frontend/src/components/GapMap.jsx): `frontend/src/components/GapMap.jsx`
- [Network display](https://github.com/mbsai/citelume/blob/main/frontend/src/components/LiteratureGraph.jsx): `frontend/src/components/LiteratureGraph.jsx`
- [Review exports](https://github.com/mbsai/citelume/blob/main/backend/services/export_service.py): `backend/services/export_service.py`

### Other components

- **Researcher**
- **Academic databases**
- **LLM providers**

## Connections

- Researcher → Review workspace: asks question (evidence: `README.md`)
- Review workspace → Guided protocol: sets protocol (evidence: `frontend/src/App.jsx`)
- Guided protocol → API client: submits protocol (evidence: `frontend/src/components/GuidedReview.jsx`)
- Review workspace → API client: requests analysis (evidence: `frontend/src/App.jsx`)
- API client → HTTP API: calls endpoints (evidence: `frontend/src/utils/api.js`)
- HTTP API → Query planning: prepares query (evidence: `backend/main.py`)
- HTTP API → Review protocol: proposes protocol (evidence: `backend/main.py`)
- Query planning → LLM service: plans with model
- HTTP API → Literature sources: searches sources (evidence: `backend/main.py`)
- Literature sources → Academic databases: queries databases (evidence: `README.md`)
- HTTP API → Study selection: selects studies (evidence: `backend/main.py`)
- HTTP API → Corpus store: stores corpus (evidence: `backend/main.py`)
- HTTP API → Full-text retrieval: retrieves text (evidence: `README.md`)
- HTTP API → Cited synthesis: builds review (evidence: `README.md`)
- Cited synthesis → LLM service: requests generation (evidence: `backend/services/synthesis_engine.py`)
- LLM service → LLM providers: calls provider (evidence: `README.md`)
- Cited synthesis → Claim synthesis: builds claims (evidence: `backend/services/synthesis_engine.py`)
- Cited synthesis → Citation checks: checks citations (evidence: `backend/services/synthesis_engine.py`)
- Cited synthesis → Evidence table: builds evidence (evidence: `backend/services/synthesis_engine.py`)
- Evidence table → Framework appraisal: routes appraisal
- HTTP API → Knowledge-gap matrix: derives gaps
- Review workspace → Evidence gap map: requests counts (evidence: `frontend/src/App.jsx`)
- HTTP API → Literature network: builds network (evidence: `backend/main.py`)
- Review workspace → Review results: shows synthesis (evidence: `frontend/src/App.jsx`)
- Review workspace → Evidence display: shows evidence (evidence: `frontend/src/App.jsx`)
- Review workspace → Gap display: shows gaps (evidence: `frontend/src/App.jsx`)
- Review workspace → Gap-map display: shows map (evidence: `frontend/src/App.jsx`)
- Review workspace → Network display: shows network (evidence: `frontend/src/App.jsx`)
- HTTP API → Review exports: creates exports (evidence: `README.md`)
