# datawhalechina/llm-universe architecture

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

- Interactive diagram: https://gitdiagram.com/datawhalechina/llm-universe
- Repository: https://github.com/datawhalechina/llm-universe

## Overview

LLM Universe is a hands-on tutorial for building LLM applications, centered on a personal knowledge-base assistant. The learner progresses from LLM/API concepts through document processing and vector indexing, then retrieval-augmented chat and evaluation; advanced RAG and application case studies are additional branches. The sampled Streamlit app shows the runtime retrieval-and-answer flow. Other chapter links and capabilities are represented from the README, not inspected source, so their internal wiring is omitted.

Main entry points: [`notebook/C4 构建 RAG 应用/streamlit_app.py`](https://github.com/datawhalechina/llm-universe/blob/main/notebook/C4%20%E6%9E%84%E5%BB%BA%20RAG%20%E5%BA%94%E7%94%A8/streamlit_app.py) (Streamlit RAG App), [`notebook/C3 搭建知识库`](https://github.com/datawhalechina/llm-universe/tree/main/notebook/C3%20%E6%90%AD%E5%BB%BA%E7%9F%A5%E8%AF%86%E5%BA%93) (Knowledge Base Course), [`notebook/C4 构建 RAG 应用/zhipuai_llm.py`](https://github.com/datawhalechina/llm-universe/blob/main/notebook/C4%20%E6%9E%84%E5%BB%BA%20RAG%20%E5%BA%94%E7%94%A8/zhipuai_llm.py) (Zhipu Chat Model), [`notebook/C7 高级 RAG 技巧/2. 数据处理`](https://github.com/datawhalechina/llm-universe/tree/main/notebook/C7%20%E9%AB%98%E7%BA%A7%20RAG%20%E6%8A%80%E5%B7%A7/2.%20%E6%95%B0%E6%8D%AE%E5%A4%84%E7%90%86) (Advanced Data Processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["LLM Learning"]
  node_intro["LLM Foundations"]
  node_api_course["LLM API Course"]
  node_prompt_course["Prompt Engineering"]
end

subgraph group_knowledge["Knowledge Preparation"]
  node_knowledge_course["Knowledge Base Course"]
  node_source_docs["Knowledge Documents"]
  node_zhipu_embed["Zhipu Embeddings"]
  node_spark_embed["Spark Embeddings"]
  node_vector_store[("Chroma Vector Store")]
end

subgraph group_rag["RAG Assistant"]
  node_rag_app["Streamlit RAG App<br/>[streamlit_app.py]"]
  node_chat_model["Zhipu Chat Model<br/>[zhipuai_llm.py]"]
  node_eval_course["System Evaluation"]
end

subgraph group_advanced["Advanced RAG"]
  node_qa_pairs["QA Pair Generation"]
  node_advanced_data["Advanced Data Processing<br/>[2. 数据处理]"]
  node_advanced_retrieval["Advanced Retrieval<br/>[4. 检索阶段]"]
  node_app_cases["Application Case Studies"]
end

node_learner(("Learner"))
node_llm_services{{"LLM API Providers"}}

node_learner -->|"studies"| node_intro
node_learner -->|"studies"| node_api_course
node_learner -->|"studies"| node_prompt_course
node_learner -->|"studies"| node_knowledge_course
node_learner -->|"uses"| node_rag_app
node_learner -->|"evaluates"| node_eval_course
node_knowledge_course -->|"processes"| node_source_docs
node_knowledge_course -->|"builds"| node_vector_store
node_rag_app -->|"loads retriever with"| node_zhipu_embed
node_rag_app -->|"retrieves from"| node_vector_store
node_rag_app -->|"generates with"| node_chat_model
node_chat_model -->|"calls"| node_llm_services
node_learner -->|"studies"| node_advanced_data
node_advanced_data -->|"includes"| node_qa_pairs
node_learner -->|"studies"| node_advanced_retrieval
node_learner -->|"studies"| node_app_cases
node_rag_app -->|"streams answers"| node_learner

click node_intro "https://github.com/datawhalechina/llm-universe/tree/main/notebook/C1%20%E5%A4%A7%E5%9E%8B%E8%AF%AD%E8%A8%80%E6%A8%A1%E5%9E%8B%20LLM%20%E4%BB%8B%E7%BB%8D"
click node_api_course "https://github.com/datawhalechina/llm-universe/tree/main/notebook/C2%20%E4%BD%BF%E7%94%A8%20LLM%20API%20%E5%BC%80%E5%8F%91%E5%BA%94%E7%94%A8"
click node_prompt_course "https://github.com/datawhalechina/llm-universe/tree/main/data_base/knowledge_db/prompt_engineering"
click node_knowledge_course "https://github.com/datawhalechina/llm-universe/tree/main/notebook/C3%20%E6%90%AD%E5%BB%BA%E7%9F%A5%E8%AF%86%E5%BA%93"
click node_source_docs "https://github.com/datawhalechina/llm-universe/tree/main/data_base/knowledge_db"
click node_zhipu_embed "https://github.com/datawhalechina/llm-universe/blob/main/notebook/C3%20%E6%90%AD%E5%BB%BA%E7%9F%A5%E8%AF%86%E5%BA%93/zhipuai_embedding.py"
click node_spark_embed "https://github.com/datawhalechina/llm-universe/blob/main/notebook/C3%20%E6%90%AD%E5%BB%BA%E7%9F%A5%E8%AF%86%E5%BA%93/sparkai_embedding.py"
click node_vector_store "https://github.com/datawhalechina/llm-universe/tree/main/data_base/vector_db/chroma"
click node_rag_app "https://github.com/datawhalechina/llm-universe/blob/main/notebook/C4%20%E6%9E%84%E5%BB%BA%20RAG%20%E5%BA%94%E7%94%A8/streamlit_app.py"
click node_chat_model "https://github.com/datawhalechina/llm-universe/blob/main/notebook/C4%20%E6%9E%84%E5%BB%BA%20RAG%20%E5%BA%94%E7%94%A8/zhipuai_llm.py"
click node_eval_course "https://github.com/datawhalechina/llm-universe/tree/main/notebook/C5%20%E7%B3%BB%E7%BB%9F%E8%AF%84%E4%BC%B0%E4%B8%8E%E4%BC%98%E5%8C%96"
click node_qa_pairs "https://github.com/datawhalechina/llm-universe/blob/main/notebook/C7%20%E9%AB%98%E7%BA%A7%20RAG%20%E6%8A%80%E5%B7%A7/2.%20%E6%95%B0%E6%8D%AE%E5%A4%84%E7%90%86/generate_qa_pairs.py"
click node_advanced_data "https://github.com/datawhalechina/llm-universe/tree/main/notebook/C7%20%E9%AB%98%E7%BA%A7%20RAG%20%E6%8A%80%E5%B7%A7/2.%20%E6%95%B0%E6%8D%AE%E5%A4%84%E7%90%86"
click node_advanced_retrieval "https://github.com/datawhalechina/llm-universe/tree/main/notebook/C7%20%E9%AB%98%E7%BA%A7%20RAG%20%E6%8A%80%E5%B7%A7/4.%20%E6%A3%80%E7%B4%A2%E9%98%B6%E6%AE%B5"
click node_app_cases "https://github.com/datawhalechina/llm-universe/tree/main/docs/C6"

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_intro,node_api_course,node_prompt_course toneBlue
class node_knowledge_course,node_source_docs,node_zhipu_embed,node_spark_embed,node_vector_store toneAmber
class node_rag_app,node_chat_model,node_eval_course,node_llm_services toneMint
class node_qa_pairs,node_advanced_data,node_advanced_retrieval,node_app_cases toneRose
class node_learner toneIndigo
```

## Components

### LLM Learning

- [LLM Foundations](https://github.com/datawhalechina/llm-universe/tree/main/notebook/C1%20%E5%A4%A7%E5%9E%8B%E8%AF%AD%E8%A8%80%E6%A8%A1%E5%9E%8B%20LLM%20%E4%BB%8B%E7%BB%8D): `notebook/C1 大型语言模型 LLM 介绍`
- [LLM API Course](https://github.com/datawhalechina/llm-universe/tree/main/notebook/C2%20%E4%BD%BF%E7%94%A8%20LLM%20API%20%E5%BC%80%E5%8F%91%E5%BA%94%E7%94%A8): `notebook/C2 使用 LLM API 开发应用`
- [Prompt Engineering](https://github.com/datawhalechina/llm-universe/tree/main/data_base/knowledge_db/prompt_engineering): `data_base/knowledge_db/prompt_engineering`

### Knowledge Preparation

- [Knowledge Base Course](https://github.com/datawhalechina/llm-universe/tree/main/notebook/C3%20%E6%90%AD%E5%BB%BA%E7%9F%A5%E8%AF%86%E5%BA%93): `notebook/C3 搭建知识库`
- [Knowledge Documents](https://github.com/datawhalechina/llm-universe/tree/main/data_base/knowledge_db): `data_base/knowledge_db`
- [Zhipu Embeddings](https://github.com/datawhalechina/llm-universe/blob/main/notebook/C3%20%E6%90%AD%E5%BB%BA%E7%9F%A5%E8%AF%86%E5%BA%93/zhipuai_embedding.py): `notebook/C3 搭建知识库/zhipuai_embedding.py`
- [Spark Embeddings](https://github.com/datawhalechina/llm-universe/blob/main/notebook/C3%20%E6%90%AD%E5%BB%BA%E7%9F%A5%E8%AF%86%E5%BA%93/sparkai_embedding.py): `notebook/C3 搭建知识库/sparkai_embedding.py`
- [Chroma Vector Store](https://github.com/datawhalechina/llm-universe/tree/main/data_base/vector_db/chroma): `data_base/vector_db/chroma`

### RAG Assistant

- [Streamlit RAG App](https://github.com/datawhalechina/llm-universe/blob/main/notebook/C4%20%E6%9E%84%E5%BB%BA%20RAG%20%E5%BA%94%E7%94%A8/streamlit_app.py): `notebook/C4 构建 RAG 应用/streamlit_app.py`
- [Zhipu Chat Model](https://github.com/datawhalechina/llm-universe/blob/main/notebook/C4%20%E6%9E%84%E5%BB%BA%20RAG%20%E5%BA%94%E7%94%A8/zhipuai_llm.py): `notebook/C4 构建 RAG 应用/zhipuai_llm.py`
- [System Evaluation](https://github.com/datawhalechina/llm-universe/tree/main/notebook/C5%20%E7%B3%BB%E7%BB%9F%E8%AF%84%E4%BC%B0%E4%B8%8E%E4%BC%98%E5%8C%96): `notebook/C5 系统评估与优化`

### Advanced RAG

- [QA Pair Generation](https://github.com/datawhalechina/llm-universe/blob/main/notebook/C7%20%E9%AB%98%E7%BA%A7%20RAG%20%E6%8A%80%E5%B7%A7/2.%20%E6%95%B0%E6%8D%AE%E5%A4%84%E7%90%86/generate_qa_pairs.py): `notebook/C7 高级 RAG 技巧/2. 数据处理/generate_qa_pairs.py`
- [Advanced Data Processing](https://github.com/datawhalechina/llm-universe/tree/main/notebook/C7%20%E9%AB%98%E7%BA%A7%20RAG%20%E6%8A%80%E5%B7%A7/2.%20%E6%95%B0%E6%8D%AE%E5%A4%84%E7%90%86): `notebook/C7 高级 RAG 技巧/2. 数据处理`
- [Advanced Retrieval](https://github.com/datawhalechina/llm-universe/tree/main/notebook/C7%20%E9%AB%98%E7%BA%A7%20RAG%20%E6%8A%80%E5%B7%A7/4.%20%E6%A3%80%E7%B4%A2%E9%98%B6%E6%AE%B5): `notebook/C7 高级 RAG 技巧/4. 检索阶段`
- [Application Case Studies](https://github.com/datawhalechina/llm-universe/tree/main/docs/C6): `docs/C6`

### Other components

- **Learner**
- **LLM API Providers**

## Connections

- Learner → LLM Foundations: studies (evidence: `README.md`)
- Learner → LLM API Course: studies (evidence: `README.md`)
- Learner → Prompt Engineering: studies (evidence: `README.md`)
- Learner → Knowledge Base Course: studies (evidence: `README.md`)
- Learner → Streamlit RAG App: uses (evidence: `README.md`)
- Learner → System Evaluation: evaluates (evidence: `README.md`)
- Knowledge Base Course → Knowledge Documents: processes (evidence: `README.md`)
- Knowledge Base Course → Chroma Vector Store: builds (evidence: `README.md`)
- Streamlit RAG App → Zhipu Embeddings: loads retriever with (evidence: `notebook/C4 构建 RAG 应用/streamlit_app.py`)
- Streamlit RAG App → Chroma Vector Store: retrieves from (evidence: `notebook/C4 构建 RAG 应用/streamlit_app.py`)
- Streamlit RAG App → Zhipu Chat Model: generates with (evidence: `notebook/C4 构建 RAG 应用/streamlit_app.py`)
- Zhipu Chat Model → LLM API Providers: calls (evidence: `notebook/C4 构建 RAG 应用/zhipuai_llm.py`)
- Learner → Advanced Data Processing: studies (evidence: `README.md`)
- Advanced Data Processing → QA Pair Generation: includes (evidence: `README.md`)
- Learner → Advanced Retrieval: studies (evidence: `README.md`)
- Learner → Application Case Studies: studies (evidence: `README.md`)
- Streamlit RAG App → Learner: streams answers (evidence: `notebook/C4 构建 RAG 应用/streamlit_app.py`)
