# ayanokojikiyotaka2010/research-paper-analyzer architecture

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

- Interactive diagram: https://gitdiagram.com/ayanokojikiyotaka2010/research-paper-analyzer
- Repository: https://github.com/ayanokojikiyotaka2010/research-paper-analyzer

## Overview

Research Paper Analyzer supports account access, a personal paper corpus, structural paper analysis and graph views, plus idea novelty checks against external literature and corpus content. The main workflows are paper submission through ingestion and persistence, then idea submission through retrieval, comparison and a graded verdict; users inspect progress and results in the Next.js app. The README documents these capabilities, while source excerpts show ingestion and novelty orchestration. Many routers and frontend pages are indexed but unsampled, so their internal call edges are omitted where evidence is unavailable.

Main entry points: [`backend/app/services/ingestion_pipeline.py`](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/ingestion_pipeline.py) (Ingestion orchestrator), [`backend/app/services/novelty/pipeline.py`](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/novelty/pipeline.py) (Novelty orchestrator), [`backend/app/main.py`](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/main.py) (FastAPI application), [`backend/app/services/novelty/retrieval.py`](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/novelty/retrieval.py) (Candidate retrieval)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_web["Research workspace"]
  node_paper_views["Paper views"]
  node_idea_views["Idea checker views"]
  node_novelty_view["Novelty results"]
  node_graph_views["Graph visualizations"]
  node_api_proxy["API proxy routes"]
end

subgraph group_api["API and access"]
  node_backend["FastAPI application<br/>[main.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_paper_api["Paper endpoints<br/>[papers.py]"]
  node_idea_api["Idea endpoints<br/>[ideas.py]"]
end

subgraph group_ingest["Paper ingestion"]
  node_ingestion["Ingestion orchestrator"]
  node_sources["Metadata sources"]
  node_pdf_parse["PDF parsing<br/>[grobid_client.py]"]
  node_tei["TEI extraction<br/>[tei_parser.py]"]
  node_decomposition["Structural decomposition"]
  node_reference_resolution["Reference resolution"]
  node_gemini["Gemini client<br/>[gemini_client.py]"]
  node_embeddings["Embedding service"]
end

subgraph group_novelty["Novelty analysis"]
  node_novelty_pipeline["Novelty orchestrator<br/>[pipeline.py]"]
  node_fingerprinting["Idea fingerprinting<br/>[fingerprint.py]"]
  node_retrieval["Candidate retrieval<br/>[retrieval.py]"]
  node_ranking["Candidate ranking<br/>[ranking.py]"]
  node_comparison["Candidate comparison<br/>[comparison.py]"]
  node_verdict["Verdict aggregation<br/>[verdict.py]"]
end

subgraph group_knowledge["Corpus and graphs"]
  node_database[("PostgreSQL corpus<br/>[paper.py]")]
  node_embedding_model[("Block embeddings<br/>[embedding.py]")]
  node_graph_builder["Graph data builder<br/>[graph_builder.py]"]
end

node_researcher(("Researcher"))
node_arxiv{{"arXiv"}}
node_crossref{{"CrossRef"}}
node_semantic_scholar{{"Semantic Scholar"}}
node_grobid_service{{"GROBID"}}
node_gemini_service{{"Google Gemini"}}

node_researcher -->|"uses"| node_web
node_web -->|"submits requests"| node_api_proxy
node_api_proxy -->|"proxies requests"| node_backend
node_backend -->|"registers router"| node_auth
node_backend -->|"registers router"| node_paper_api
node_backend -->|"registers router"| node_idea_api
node_paper_views -.->|"ingests and polls"| node_api_proxy
node_idea_views -.->|"checks ideas"| node_api_proxy
node_paper_api -.->|"starts background ingestion"| node_ingestion
node_idea_api -.->|"starts background check"| node_novelty_pipeline
node_ingestion -->|"fetches metadata"| node_sources
node_sources -->|"queries and downloads"| node_arxiv
node_sources -.->|"resolves DOI"| node_crossref
node_ingestion -->|"parses PDF"| node_pdf_parse
node_pdf_parse -.->|"sends PDF"| node_grobid_service
node_ingestion -->|"parses TEI"| node_tei
node_ingestion -->|"tags sections"| node_decomposition
node_decomposition -.->|"requests decomposition"| node_gemini
node_ingestion -->|"resolves citations"| node_reference_resolution
node_reference_resolution -.->|"looks up references"| node_crossref
node_reference_resolution -.->|"fallback lookup"| node_semantic_scholar
node_ingestion -->|"embeds blocks"| node_embeddings
node_ingestion -->|"persists paper data"| node_database
node_ingestion -->|"stores vectors"| node_embedding_model
node_novelty_pipeline -->|"fingerprints idea"| node_fingerprinting
node_novelty_pipeline -->|"searches sources"| node_retrieval
node_retrieval -.->|"searches literature"| node_arxiv
node_retrieval -.->|"searches literature"| node_semantic_scholar
node_retrieval -.->|"searches corpus"| node_database
node_novelty_pipeline -->|"ranks candidates"| node_ranking
node_novelty_pipeline -->|"compares candidates"| node_comparison
node_comparison -.->|"requests assessment"| node_gemini
node_novelty_pipeline -->|"aggregates verdict"| node_verdict
node_novelty_pipeline -->|"records check"| node_database
node_idea_views -.->|"renders results"| node_novelty_view
node_novelty_view -->|"renders similarity map"| node_graph_views
node_paper_views -.->|"shows paper graphs"| node_graph_views
node_graph_views -.->|"requests graph data"| node_graph_builder
node_graph_builder -.->|"reads claims and references"| node_database

click node_web "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/tree/main/frontend/app"
click node_paper_views "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/tree/main/frontend/app/papers"
click node_idea_views "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/tree/main/frontend/app/ideas"
click node_novelty_view "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/frontend/components/novelty/NoveltyCheckView.tsx"
click node_graph_views "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/tree/main/frontend/components/graphs"
click node_api_proxy "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/tree/main/frontend/app/api"
click node_backend "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/main.py"
click node_auth "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/routers/auth.py"
click node_paper_api "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/routers/papers.py"
click node_idea_api "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/routers/ideas.py"
click node_ingestion "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/ingestion_pipeline.py"
click node_sources "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/tree/main/backend/app/services/sources"
click node_pdf_parse "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/grobid_client.py"
click node_tei "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/tei_parser.py"
click node_decomposition "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/structural_decomposition.py"
click node_reference_resolution "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/reference_resolution.py"
click node_gemini "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/llm/gemini_client.py"
click node_embeddings "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/embedding_service.py"
click node_novelty_pipeline "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/novelty/pipeline.py"
click node_fingerprinting "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/novelty/fingerprint.py"
click node_retrieval "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/novelty/retrieval.py"
click node_ranking "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/novelty/ranking.py"
click node_comparison "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/novelty/comparison.py"
click node_verdict "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/novelty/verdict.py"
click node_database "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/models/paper.py"
click node_embedding_model "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/models/embedding.py"
click node_graph_builder "https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/graph_builder.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_paper_views,node_idea_views,node_novelty_view,node_graph_views,node_api_proxy toneBlue
class node_backend,node_auth,node_paper_api,node_idea_api toneAmber
class node_ingestion,node_sources,node_pdf_parse,node_tei,node_decomposition,node_reference_resolution,node_gemini,node_embeddings toneMint
class node_novelty_pipeline,node_fingerprinting,node_retrieval,node_ranking,node_comparison,node_verdict toneRose
class node_database,node_embedding_model,node_graph_builder,node_researcher,node_arxiv,node_crossref,node_semantic_scholar,node_grobid_service,node_gemini_service toneIndigo
```

## Components

### Web application

- [Research workspace](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/tree/main/frontend/app): `frontend/app`
- [Paper views](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/tree/main/frontend/app/papers): `frontend/app/papers`
- [Idea checker views](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/tree/main/frontend/app/ideas): `frontend/app/ideas`
- [Novelty results](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/frontend/components/novelty/NoveltyCheckView.tsx): `frontend/components/novelty/NoveltyCheckView.tsx`
- [Graph visualizations](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/tree/main/frontend/components/graphs): `frontend/components/graphs`
- [API proxy routes](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/tree/main/frontend/app/api): `frontend/app/api`

### API and access

- [FastAPI application](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [Paper endpoints](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/routers/papers.py): `backend/app/routers/papers.py`
- [Idea endpoints](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/routers/ideas.py): `backend/app/routers/ideas.py`

### Paper ingestion

- [Ingestion orchestrator](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/ingestion_pipeline.py): `backend/app/services/ingestion_pipeline.py`
- [Metadata sources](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/tree/main/backend/app/services/sources): `backend/app/services/sources`
- [PDF parsing](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/grobid_client.py): `backend/app/services/grobid_client.py`
- [TEI extraction](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/tei_parser.py): `backend/app/services/tei_parser.py`
- [Structural decomposition](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/structural_decomposition.py): `backend/app/services/structural_decomposition.py`
- [Reference resolution](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/reference_resolution.py): `backend/app/services/reference_resolution.py`
- [Gemini client](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/llm/gemini_client.py): `backend/app/services/llm/gemini_client.py`
- [Embedding service](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/embedding_service.py): `backend/app/services/embedding_service.py`

### Novelty analysis

- [Novelty orchestrator](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/novelty/pipeline.py): `backend/app/services/novelty/pipeline.py`
- [Idea fingerprinting](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/novelty/fingerprint.py): `backend/app/services/novelty/fingerprint.py`
- [Candidate retrieval](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/novelty/retrieval.py): `backend/app/services/novelty/retrieval.py`
- [Candidate ranking](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/novelty/ranking.py): `backend/app/services/novelty/ranking.py`
- [Candidate comparison](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/novelty/comparison.py): `backend/app/services/novelty/comparison.py`
- [Verdict aggregation](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/novelty/verdict.py): `backend/app/services/novelty/verdict.py`

### Corpus and graphs

- [PostgreSQL corpus](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/models/paper.py): `backend/app/models/paper.py`
- [Block embeddings](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/models/embedding.py): `backend/app/models/embedding.py`
- [Graph data builder](https://github.com/ayanokojikiyotaka2010/research-paper-analyzer/blob/main/backend/app/services/graph_builder.py): `backend/app/services/graph_builder.py`

### Other components

- **Researcher**
- **arXiv**
- **CrossRef**
- **Semantic Scholar**
- **GROBID**
- **Google Gemini**

## Connections

- Researcher → Research workspace: uses
- Research workspace → API proxy routes: submits requests
- API proxy routes → FastAPI application: proxies requests (evidence: `frontend/app/api/papers/route.ts`)
- FastAPI application → Authentication: registers router (evidence: `backend/app/main.py`)
- FastAPI application → Paper endpoints: registers router (evidence: `backend/app/main.py`)
- FastAPI application → Idea endpoints: registers router (evidence: `backend/app/main.py`)
- Paper views → API proxy routes: ingests and polls
- Idea checker views → API proxy routes: checks ideas
- Paper endpoints → Ingestion orchestrator: starts background ingestion
- Idea endpoints → Novelty orchestrator: starts background check (evidence: `backend/app/services/novelty/pipeline.py`)
- Ingestion orchestrator → Metadata sources: fetches metadata (evidence: `backend/app/services/ingestion_pipeline.py`)
- Metadata sources → arXiv: queries and downloads (evidence: `backend/app/services/sources/arxiv_client.py`)
- Metadata sources → CrossRef: resolves DOI
- Ingestion orchestrator → PDF parsing: parses PDF (evidence: `backend/app/services/ingestion_pipeline.py`)
- PDF parsing → GROBID: sends PDF
- Ingestion orchestrator → TEI extraction: parses TEI (evidence: `backend/app/services/ingestion_pipeline.py`)
- Ingestion orchestrator → Structural decomposition: tags sections (evidence: `backend/app/services/ingestion_pipeline.py`)
- Structural decomposition → Gemini client: requests decomposition
- Ingestion orchestrator → Reference resolution: resolves citations (evidence: `backend/app/services/ingestion_pipeline.py`)
- Reference resolution → CrossRef: looks up references
- Reference resolution → Semantic Scholar: fallback lookup
- Ingestion orchestrator → Embedding service: embeds blocks (evidence: `backend/app/services/ingestion_pipeline.py`)
- Ingestion orchestrator → PostgreSQL corpus: persists paper data (evidence: `backend/app/services/ingestion_pipeline.py`)
- Ingestion orchestrator → Block embeddings: stores vectors (evidence: `backend/app/services/ingestion_pipeline.py`)
- Novelty orchestrator → Idea fingerprinting: fingerprints idea (evidence: `backend/app/services/novelty/pipeline.py`)
- Novelty orchestrator → Candidate retrieval: searches sources (evidence: `backend/app/services/novelty/pipeline.py`)
- Candidate retrieval → arXiv: searches literature
- Candidate retrieval → Semantic Scholar: searches literature
- Candidate retrieval → PostgreSQL corpus: searches corpus
- Novelty orchestrator → Candidate ranking: ranks candidates (evidence: `backend/app/services/novelty/pipeline.py`)
- Novelty orchestrator → Candidate comparison: compares candidates (evidence: `backend/app/services/novelty/pipeline.py`)
- Candidate comparison → Gemini client: requests assessment
- Novelty orchestrator → Verdict aggregation: aggregates verdict (evidence: `backend/app/services/novelty/pipeline.py`)
- Novelty orchestrator → PostgreSQL corpus: records check (evidence: `backend/app/services/novelty/pipeline.py`)
- Idea checker views → Novelty results: renders results
- Novelty results → Graph visualizations: renders similarity map (evidence: `frontend/components/novelty/NoveltyCheckView.tsx`)
- Paper views → Graph visualizations: shows paper graphs
- Graph visualizations → Graph data builder: requests graph data
- Graph data builder → PostgreSQL corpus: reads claims and references
