# truongminhduc2k4/ai_research_agent_prototype architecture

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

- Interactive diagram: https://gitdiagram.com/truongminhduc2k4/ai_research_agent_prototype
- Repository: https://github.com/truongminhduc2k4/ai_research_agent_prototype

## Overview

GameScope Research là ứng dụng web tiếng Việt tạo báo cáo có dẫn nguồn về thị trường trò chơi điện tử. Người dùng nhập câu hỏi và bộ lọc tùy chọn; giao diện gửi yêu cầu tới API, nơi kiểm tra giới hạn và phạm vi, tìm nguồn Tavily rồi yêu cầu Claude tổng hợp báo cáo đã kiểm tra định dạng. Giao diện trình bày báo cáo và nguồn, hỗ trợ so sánh, lịch sử và tải kết quả. README mô tả các khả năng này; các luồng nội bộ được thể hiện dưới đây chỉ khi có bằng chứng trong trích đoạn đã cung cấp.

Main entry points: [`app/api/research/route.ts`](https://github.com/truongminhduc2k4/ai_research_agent_prototype/blob/main/app/api/research/route.ts) (API nghiên cứu), [`app/page.tsx`](https://github.com/truongminhduc2k4/ai_research_agent_prototype/blob/main/app/page.tsx) (Giao diện nghiên cứu), [`app/types.ts`](https://github.com/truongminhduc2k4/ai_research_agent_prototype/blob/main/app/types.ts) (Kiểu dữ liệu nghiên cứu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Trải nghiệm người dùng"]
  node_web_ui["Giao diện nghiên cứu<br/>[page.tsx]"]
  node_report_view["Báo cáo và so sánh<br/>[page.tsx]"]
  node_exports["Tải báo cáo<br/>[page.tsx]"]
end

subgraph group_research["Nghiên cứu và báo cáo"]
  node_contracts["Kiểu dữ liệu nghiên cứu<br/>[types.ts]"]
  node_research_api["API nghiên cứu<br/>[route.ts]"]
  node_scope_check["Kiểm tra phạm vi<br/>[route.ts]"]
  node_source_search["Tìm và gộp nguồn<br/>[route.ts]"]
  node_report_synthesis["Tổng hợp và kiểm tra báo cáo<br/>[route.ts]"]
end

subgraph group_providers["Dịch vụ bên ngoài"]
  node_tavily["Tavily Search"]
  node_anthropic["Anthropic Claude"]
end

node_researcher(("Nhà nghiên cứu"))
node_download_user(("Người tải báo cáo"))

node_researcher -->|"nhập câu hỏi"| node_web_ui
node_web_ui -->|"gửi yêu cầu"| node_research_api
node_research_api -->|"kiểm tra phạm vi"| node_scope_check
node_research_api -->|"tìm nguồn"| node_source_search
node_research_api -->|"tổng hợp báo cáo"| node_report_synthesis
node_research_api -->|"phân loại phạm vi"| node_anthropic
node_research_api -->|"tìm web"| node_tavily
node_research_api -->|"tạo báo cáo"| node_anthropic
node_research_api -->|"trả kết quả"| node_web_ui
node_web_ui -->|"hiển thị kết quả"| node_report_view
node_web_ui -->|"tạo bản tải"| node_exports
node_exports -->|"tải xuống"| node_download_user
node_web_ui -->|"dùng kiểu dữ liệu"| node_contracts

click node_web_ui "https://github.com/truongminhduc2k4/ai_research_agent_prototype/blob/main/app/page.tsx"
click node_report_view "https://github.com/truongminhduc2k4/ai_research_agent_prototype/blob/main/app/page.tsx"
click node_exports "https://github.com/truongminhduc2k4/ai_research_agent_prototype/blob/main/app/page.tsx"
click node_contracts "https://github.com/truongminhduc2k4/ai_research_agent_prototype/blob/main/app/types.ts"
click node_research_api "https://github.com/truongminhduc2k4/ai_research_agent_prototype/blob/main/app/api/research/route.ts"
click node_scope_check "https://github.com/truongminhduc2k4/ai_research_agent_prototype/blob/main/app/api/research/route.ts"
click node_source_search "https://github.com/truongminhduc2k4/ai_research_agent_prototype/blob/main/app/api/research/route.ts"
click node_report_synthesis "https://github.com/truongminhduc2k4/ai_research_agent_prototype/blob/main/app/api/research/route.ts"

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_ui,node_report_view,node_exports toneBlue
class node_contracts,node_research_api,node_scope_check,node_source_search,node_report_synthesis toneAmber
class node_tavily,node_anthropic toneMint
class node_researcher,node_download_user toneIndigo
```

## Components

### Trải nghiệm người dùng

- [Giao diện nghiên cứu](https://github.com/truongminhduc2k4/ai_research_agent_prototype/blob/main/app/page.tsx): `app/page.tsx`
- [Báo cáo và so sánh](https://github.com/truongminhduc2k4/ai_research_agent_prototype/blob/main/app/page.tsx): `app/page.tsx`
- [Tải báo cáo](https://github.com/truongminhduc2k4/ai_research_agent_prototype/blob/main/app/page.tsx): `app/page.tsx`

### Nghiên cứu và báo cáo

- [Kiểu dữ liệu nghiên cứu](https://github.com/truongminhduc2k4/ai_research_agent_prototype/blob/main/app/types.ts): `app/types.ts`
- [API nghiên cứu](https://github.com/truongminhduc2k4/ai_research_agent_prototype/blob/main/app/api/research/route.ts): `app/api/research/route.ts`
- [Kiểm tra phạm vi](https://github.com/truongminhduc2k4/ai_research_agent_prototype/blob/main/app/api/research/route.ts): `app/api/research/route.ts`
- [Tìm và gộp nguồn](https://github.com/truongminhduc2k4/ai_research_agent_prototype/blob/main/app/api/research/route.ts): `app/api/research/route.ts`
- [Tổng hợp và kiểm tra báo cáo](https://github.com/truongminhduc2k4/ai_research_agent_prototype/blob/main/app/api/research/route.ts): `app/api/research/route.ts`

### Dịch vụ bên ngoài

- **Tavily Search**
- **Anthropic Claude**

### Other components

- **Nhà nghiên cứu**
- **Người tải báo cáo**

## Connections

- Nhà nghiên cứu → Giao diện nghiên cứu: nhập câu hỏi (evidence: `README.md`)
- Giao diện nghiên cứu → API nghiên cứu: gửi yêu cầu (evidence: `app/page.tsx`)
- API nghiên cứu → Kiểm tra phạm vi: kiểm tra phạm vi (evidence: `app/api/research/route.ts`)
- API nghiên cứu → Tìm và gộp nguồn: tìm nguồn (evidence: `app/api/research/route.ts`)
- API nghiên cứu → Tổng hợp và kiểm tra báo cáo: tổng hợp báo cáo (evidence: `app/api/research/route.ts`)
- API nghiên cứu → Anthropic Claude: phân loại phạm vi (evidence: `app/api/research/route.ts`)
- API nghiên cứu → Tavily Search: tìm web (evidence: `app/api/research/route.ts`)
- API nghiên cứu → Anthropic Claude: tạo báo cáo (evidence: `app/api/research/route.ts`)
- API nghiên cứu → Giao diện nghiên cứu: trả kết quả (evidence: `app/page.tsx`)
- Giao diện nghiên cứu → Báo cáo và so sánh: hiển thị kết quả (evidence: `README.md`)
- Giao diện nghiên cứu → Tải báo cáo: tạo bản tải (evidence: `app/page.tsx`)
- Tải báo cáo → Người tải báo cáo: tải xuống (evidence: `README.md`)
- Giao diện nghiên cứu → Kiểu dữ liệu nghiên cứu: dùng kiểu dữ liệu (evidence: `app/page.tsx`)
