# zhenqiangshi/about_ai_system architecture

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

- Interactive diagram: https://gitdiagram.com/zhenqiangshi/about_ai_system
- Repository: https://github.com/zhenqiangshi/about_ai_system

## Overview

This repository is an architecture and learning guide, not an executable application. Its documented principal workflow is user question → RAG retrieval and context assembly → LLM generation; a separate ingestion path turns image/PDF content into structured text for the knowledge base. The graph also preserves documented inference, agent, gateway, and observability capabilities. Relationships are limited to README statements; unsampled implementation details are not inferred.

Main entry points: [`RAG/RAG流程及技术.md`](https://github.com/zhenqiangshi/about_ai_system/blob/main/RAG/RAG%E6%B5%81%E7%A8%8B%E5%8F%8A%E6%8A%80%E6%9C%AF.md) (RAG retrieval), [`OCR/OCR.md`](https://github.com/zhenqiangshi/about_ai_system/blob/main/OCR/OCR.md) (OCR extraction), [`Agent`](https://github.com/zhenqiangshi/about_ai_system/tree/main/Agent) (Agent system), [`LLM/LLM.md`](https://github.com/zhenqiangshi/about_ai_system/blob/main/LLM/LLM.md) (Language model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_knowledge["Knowledge pipeline"]
  node_ocr["OCR extraction<br/>[OCR.md]"]
  node_rag["RAG retrieval<br/>[RAG流程及技术.md]"]
end

subgraph group_models["Model serving"]
  node_llm["Language model<br/>[LLM.md]"]
  node_vllm["vLLM serving<br/>[vLLM.md]"]
  node_xinference["Xinference serving<br/>[Xinference.md]"]
end

subgraph group_agents["Agent execution"]
  node_agent["Agent system"]
end

subgraph group_operations["Operations"]
  node_gateway["AI gateway<br/>[AI网关相关.md]"]
  node_litellm["LiteLLM API layer<br/>[LiteLLM.md]"]
  node_langfuse["Langfuse observability<br/>[langfuse.md]"]
end

node_user(("User"))
node_documents["Image/PDF input"]
node_tools{{"External tools"}}

node_user -->|"asks question"| node_rag
node_documents -->|"submits files"| node_ocr
node_ocr -->|"injects text"| node_rag
node_rag -->|"generates answer"| node_llm
node_agent -->|"calls tools"| node_tools

click node_ocr "https://github.com/zhenqiangshi/about_ai_system/blob/main/OCR/OCR.md"
click node_rag "https://github.com/zhenqiangshi/about_ai_system/blob/main/RAG/RAG%E6%B5%81%E7%A8%8B%E5%8F%8A%E6%8A%80%E6%9C%AF.md"
click node_llm "https://github.com/zhenqiangshi/about_ai_system/blob/main/LLM/LLM.md"
click node_vllm "https://github.com/zhenqiangshi/about_ai_system/blob/main/LLM/vLLM.md"
click node_xinference "https://github.com/zhenqiangshi/about_ai_system/blob/main/LLM/Xinference.md"
click node_agent "https://github.com/zhenqiangshi/about_ai_system/tree/main/Agent"
click node_gateway "https://github.com/zhenqiangshi/about_ai_system/blob/main/LLM/AI%E7%BD%91%E5%85%B3%E7%9B%B8%E5%85%B3.md"
click node_litellm "https://github.com/zhenqiangshi/about_ai_system/blob/main/Observability/LiteLLM.md"
click node_langfuse "https://github.com/zhenqiangshi/about_ai_system/blob/main/Observability/langfuse.md"

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_ocr,node_rag,node_user toneBlue
class node_llm,node_vllm,node_xinference toneAmber
class node_agent toneMint
class node_gateway,node_litellm,node_langfuse toneRose
class node_documents,node_tools toneIndigo
```

## Components

### Knowledge pipeline

- [OCR extraction](https://github.com/zhenqiangshi/about_ai_system/blob/main/OCR/OCR.md): `OCR/OCR.md`
- [RAG retrieval](https://github.com/zhenqiangshi/about_ai_system/blob/main/RAG/RAG%E6%B5%81%E7%A8%8B%E5%8F%8A%E6%8A%80%E6%9C%AF.md): `RAG/RAG流程及技术.md`

### Model serving

- [Language model](https://github.com/zhenqiangshi/about_ai_system/blob/main/LLM/LLM.md): `LLM/LLM.md`
- [vLLM serving](https://github.com/zhenqiangshi/about_ai_system/blob/main/LLM/vLLM.md): `LLM/vLLM.md`
- [Xinference serving](https://github.com/zhenqiangshi/about_ai_system/blob/main/LLM/Xinference.md): `LLM/Xinference.md`

### Agent execution

- [Agent system](https://github.com/zhenqiangshi/about_ai_system/tree/main/Agent): `Agent`

### Operations

- [AI gateway](https://github.com/zhenqiangshi/about_ai_system/blob/main/LLM/AI%E7%BD%91%E5%85%B3%E7%9B%B8%E5%85%B3.md): `LLM/AI网关相关.md`
- [LiteLLM API layer](https://github.com/zhenqiangshi/about_ai_system/blob/main/Observability/LiteLLM.md): `Observability/LiteLLM.md`
- [Langfuse observability](https://github.com/zhenqiangshi/about_ai_system/blob/main/Observability/langfuse.md): `Observability/langfuse.md`

### Other components

- **User**
- **Image/PDF input**
- **External tools**

## Connections

- User → RAG retrieval: asks question (evidence: `README.md`)
- Image/PDF input → OCR extraction: submits files (evidence: `README.md`)
- OCR extraction → RAG retrieval: injects text (evidence: `README.md`)
- RAG retrieval → Language model: generates answer (evidence: `README.md`)
- Agent system → External tools: calls tools (evidence: `README.md`)
