# ricruan/ric-train architecture

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

- Interactive diagram: https://gitdiagram.com/ricruan/ric-train
- Repository: https://github.com/ricruan/ric-train

## Overview

This repository combines a FastAPI AI scaffold with Wolin’s interview-analysis application. The main user-to-result path is an API request routed into interview analysis, where audio and resume inputs are processed into analysis/report outputs and can be emailed. A separate chat API supports model-backed conversations and session summaries. The tree also contains a reusable workflow engine. Edges are limited to relationships visible in the excerpts, SOURCE INDEX references, or documented entry-point wiring; unsampled implementation details are not inferred.

Main entry points: [`Wolin/api/coreApi.py`](https://github.com/ricruan/ric-train/blob/master/Wolin/api/coreApi.py) (Interview API), [`Base/Service/llmSessionService.py`](https://github.com/ricruan/ric-train/blob/master/Base/Service/llmSessionService.py) (Session Summaries), [`Base/Api/ai/chatApi.py`](https://github.com/ricruan/ric-train/blob/master/Base/Api/ai/chatApi.py) (Chat API), [`Wolin/core/interviewAnalysis.py`](https://github.com/ricruan/ric-train/blob/master/Wolin/core/interviewAnalysis.py) (Interview Analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["HTTP Applications"]
  node_wolin_app["Wolin App<br/>[main.py]"]
  node_wolin_router["Wolin Router<br/>[router.py]"]
  node_interview_api["Interview API<br/>[coreApi.py]"]
  node_chat_app["Base App<br/>[main.py]"]
  node_chat_api["Chat API<br/>[chatApi.py]"]
end

subgraph group_interview["Interview Analysis"]
  node_interview_service["Interview Service"]
  node_analysis["Interview Analysis"]
  node_interview_state["Analysis State<br/>[iaState.py]"]
  node_analysis_nodes["Analysis Nodes<br/>[iaNodes.py]"]
  node_report_email["Report Email<br/>[emailService.py]"]
end

subgraph group_ai["AI Services"]
  node_llm_service["AI Service<br/>[aiService.py]"]
  node_llm_conversation_service["Conversation Service"]
  node_session_service["Session Summaries"]
  node_qwen["Qwen LLM<br/>[qwenLlm.py]"]
  node_llm_base["LLM Base<br/>[baseLlm.py]"]
  node_prompts["Prompt Templates<br/>[commonPrompt.py]"]
end

subgraph group_data["Persistence And Integrations"]
  node_conversation_model["Conversation Records"]
  node_session_model["Session Records<br/>[BaseLLMSession.py]"]
  node_sql_models["DB Model Layer<br/>[moduleDbModel.py]"]
  node_connection_manager["DB Connections"]
  node_sql_store[("SQL Database")]
  node_vector_conversation["Vector Conversations"]
  node_minio["Object Storage Client<br/>[minioClient.py]"]
end

subgraph group_workflow["Workflow Engine"]
  node_workflow_engine["Workflow Runtime<br/>[baseWorkFlow.py]"]
  node_workflow_nodes["Workflow Nodes<br/>[baseNode.py]"]
end

node_user(("API Client"))

node_user -->|"requests"| node_wolin_app
node_wolin_app -->|"registers router"| node_wolin_router
node_wolin_router -->|"routes to"| node_interview_api
node_interview_api -->|"invokes analysis"| node_analysis
node_interview_api -->|"uses state"| node_interview_state
node_interview_api -->|"uses nodes"| node_analysis_nodes
node_interview_api -.->|"uses service"| node_interview_service
node_analysis -->|"uses storage"| node_minio
node_analysis -->|"calls model"| node_qwen
node_analysis -->|"sends report"| node_report_email
node_user -->|"requests"| node_chat_app
node_chat_app -->|"registers API"| node_chat_api
node_chat_api -->|"uses service"| node_llm_service
node_chat_api -->|"uses service"| node_llm_conversation_service
node_chat_api -->|"uses service"| node_session_service
node_session_service -->|"reads and saves"| node_session_model
node_session_service -->|"reads conversations"| node_conversation_model
node_session_service -->|"summarizes with"| node_qwen
node_session_service -->|"renders prompt"| node_prompts
node_llm_conversation_service -->|"creates embeddings"| node_qwen
node_llm_conversation_service -->|"reads record"| node_conversation_model
node_llm_conversation_service -->|"saves vector record"| node_vector_conversation
node_qwen -->|"extends"| node_llm_base
node_conversation_model -->|"inherits persistence"| node_sql_models
node_session_model -->|"inherits persistence"| node_sql_models
node_sql_models -->|"uses connections"| node_connection_manager
node_connection_manager -.->|"manages connections"| node_sql_store
node_workflow_engine -.->|"runs nodes"| node_workflow_nodes

click node_wolin_app "https://github.com/ricruan/ric-train/blob/master/Wolin/main.py"
click node_wolin_router "https://github.com/ricruan/ric-train/blob/master/Wolin/router/router.py"
click node_interview_api "https://github.com/ricruan/ric-train/blob/master/Wolin/api/coreApi.py"
click node_chat_app "https://github.com/ricruan/ric-train/blob/master/Base/main.py"
click node_chat_api "https://github.com/ricruan/ric-train/blob/master/Base/Api/ai/chatApi.py"
click node_interview_service "https://github.com/ricruan/ric-train/blob/master/Wolin/service/interviewService.py"
click node_analysis "https://github.com/ricruan/ric-train/blob/master/Wolin/core/interviewAnalysis.py"
click node_interview_state "https://github.com/ricruan/ric-train/blob/master/Wolin/ai/interview/iaState.py"
click node_analysis_nodes "https://github.com/ricruan/ric-train/blob/master/Wolin/ai/interview/nodes/iaNodes.py"
click node_report_email "https://github.com/ricruan/ric-train/blob/master/Wolin/service/emailService.py"
click node_llm_service "https://github.com/ricruan/ric-train/blob/master/Base/Service/aiService.py"
click node_llm_conversation_service "https://github.com/ricruan/ric-train/blob/master/Base/Service/llmConversationService.py"
click node_session_service "https://github.com/ricruan/ric-train/blob/master/Base/Service/llmSessionService.py"
click node_qwen "https://github.com/ricruan/ric-train/blob/master/Base/Ai/llms/qwenLlm.py"
click node_llm_base "https://github.com/ricruan/ric-train/blob/master/Base/Ai/base/baseLlm.py"
click node_prompts "https://github.com/ricruan/ric-train/blob/master/Base/Ai/prompt/commonPrompt.py"
click node_conversation_model "https://github.com/ricruan/ric-train/blob/master/Base/Models/BaseLLMConversationModel.py"
click node_session_model "https://github.com/ricruan/ric-train/blob/master/Base/Models/BaseLLMSession.py"
click node_sql_models "https://github.com/ricruan/ric-train/blob/master/Base/Repository/models/moduleDbModel.py"
click node_connection_manager "https://github.com/ricruan/ric-train/blob/master/Base/Repository/base/connectionManager.py"
click node_vector_conversation "https://github.com/ricruan/ric-train/blob/master/Base/Models/VdbLLMConversation.py"
click node_minio "https://github.com/ricruan/ric-train/blob/master/Base/Client/minioClient.py"
click node_workflow_engine "https://github.com/ricruan/ric-train/blob/master/WorkFlow/base/baseWorkFlow.py"
click node_workflow_nodes "https://github.com/ricruan/ric-train/blob/master/WorkFlow/models/nodes/baseNode.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_wolin_app,node_wolin_router,node_interview_api,node_chat_app,node_chat_api,node_user toneBlue
class node_interview_service,node_analysis,node_interview_state,node_analysis_nodes,node_report_email toneAmber
class node_llm_service,node_llm_conversation_service,node_session_service,node_qwen,node_llm_base,node_prompts toneMint
class node_conversation_model,node_session_model,node_sql_models,node_connection_manager,node_sql_store,node_vector_conversation,node_minio toneRose
class node_workflow_engine,node_workflow_nodes toneIndigo
```

## Components

### HTTP Applications

- [Wolin App](https://github.com/ricruan/ric-train/blob/master/Wolin/main.py): `Wolin/main.py`
- [Wolin Router](https://github.com/ricruan/ric-train/blob/master/Wolin/router/router.py): `Wolin/router/router.py`
- [Interview API](https://github.com/ricruan/ric-train/blob/master/Wolin/api/coreApi.py): `Wolin/api/coreApi.py`
- [Base App](https://github.com/ricruan/ric-train/blob/master/Base/main.py): `Base/main.py`
- [Chat API](https://github.com/ricruan/ric-train/blob/master/Base/Api/ai/chatApi.py): `Base/Api/ai/chatApi.py`

### Interview Analysis

- [Interview Service](https://github.com/ricruan/ric-train/blob/master/Wolin/service/interviewService.py): `Wolin/service/interviewService.py`
- [Interview Analysis](https://github.com/ricruan/ric-train/blob/master/Wolin/core/interviewAnalysis.py): `Wolin/core/interviewAnalysis.py`
- [Analysis State](https://github.com/ricruan/ric-train/blob/master/Wolin/ai/interview/iaState.py): `Wolin/ai/interview/iaState.py`
- [Analysis Nodes](https://github.com/ricruan/ric-train/blob/master/Wolin/ai/interview/nodes/iaNodes.py): `Wolin/ai/interview/nodes/iaNodes.py`
- [Report Email](https://github.com/ricruan/ric-train/blob/master/Wolin/service/emailService.py): `Wolin/service/emailService.py`

### AI Services

- [AI Service](https://github.com/ricruan/ric-train/blob/master/Base/Service/aiService.py): `Base/Service/aiService.py`
- [Conversation Service](https://github.com/ricruan/ric-train/blob/master/Base/Service/llmConversationService.py): `Base/Service/llmConversationService.py`
- [Session Summaries](https://github.com/ricruan/ric-train/blob/master/Base/Service/llmSessionService.py): `Base/Service/llmSessionService.py`
- [Qwen LLM](https://github.com/ricruan/ric-train/blob/master/Base/Ai/llms/qwenLlm.py): `Base/Ai/llms/qwenLlm.py`
- [LLM Base](https://github.com/ricruan/ric-train/blob/master/Base/Ai/base/baseLlm.py): `Base/Ai/base/baseLlm.py`
- [Prompt Templates](https://github.com/ricruan/ric-train/blob/master/Base/Ai/prompt/commonPrompt.py): `Base/Ai/prompt/commonPrompt.py`

### Persistence And Integrations

- [Conversation Records](https://github.com/ricruan/ric-train/blob/master/Base/Models/BaseLLMConversationModel.py): `Base/Models/BaseLLMConversationModel.py`
- [Session Records](https://github.com/ricruan/ric-train/blob/master/Base/Models/BaseLLMSession.py): `Base/Models/BaseLLMSession.py`
- [DB Model Layer](https://github.com/ricruan/ric-train/blob/master/Base/Repository/models/moduleDbModel.py): `Base/Repository/models/moduleDbModel.py`
- [DB Connections](https://github.com/ricruan/ric-train/blob/master/Base/Repository/base/connectionManager.py): `Base/Repository/base/connectionManager.py`
- **SQL Database**
- [Vector Conversations](https://github.com/ricruan/ric-train/blob/master/Base/Models/VdbLLMConversation.py): `Base/Models/VdbLLMConversation.py`
- [Object Storage Client](https://github.com/ricruan/ric-train/blob/master/Base/Client/minioClient.py): `Base/Client/minioClient.py`

### Workflow Engine

- [Workflow Runtime](https://github.com/ricruan/ric-train/blob/master/WorkFlow/base/baseWorkFlow.py): `WorkFlow/base/baseWorkFlow.py`
- [Workflow Nodes](https://github.com/ricruan/ric-train/blob/master/WorkFlow/models/nodes/baseNode.py): `WorkFlow/models/nodes/baseNode.py`

### Other components

- **API Client**

## Connections

- API Client → Wolin App: requests (evidence: `Wolin/main.py`)
- Wolin App → Wolin Router: registers router (evidence: `Wolin/main.py`)
- Wolin Router → Interview API: routes to (evidence: `Wolin/router/router.py`)
- Interview API → Interview Analysis: invokes analysis (evidence: `Wolin/api/coreApi.py`)
- Interview API → Analysis State: uses state (evidence: `Wolin/api/coreApi.py`)
- Interview API → Analysis Nodes: uses nodes (evidence: `Wolin/api/coreApi.py`)
- Interview API → Interview Service: uses service
- Interview Analysis → Object Storage Client: uses storage (evidence: `Wolin/core/interviewAnalysis.py`)
- Interview Analysis → Qwen LLM: calls model (evidence: `Wolin/core/interviewAnalysis.py`)
- Interview Analysis → Report Email: sends report (evidence: `Wolin/core/interviewAnalysis.py`)
- API Client → Base App: requests (evidence: `Base/main.py`)
- Base App → Chat API: registers API (evidence: `Base/main.py`)
- Chat API → AI Service: uses service (evidence: `Base/Api/ai/chatApi.py`)
- Chat API → Conversation Service: uses service (evidence: `Base/Api/ai/chatApi.py`)
- Chat API → Session Summaries: uses service (evidence: `Base/Api/ai/chatApi.py`)
- Session Summaries → Session Records: reads and saves (evidence: `Base/Service/llmSessionService.py`)
- Session Summaries → Conversation Records: reads conversations (evidence: `Base/Service/llmSessionService.py`)
- Session Summaries → Qwen LLM: summarizes with (evidence: `Base/Service/llmSessionService.py`)
- Session Summaries → Prompt Templates: renders prompt (evidence: `Base/Service/llmSessionService.py`)
- Conversation Service → Qwen LLM: creates embeddings (evidence: `Base/Service/llmConversationService.py`)
- Conversation Service → Conversation Records: reads record (evidence: `Base/Service/llmConversationService.py`)
- Conversation Service → Vector Conversations: saves vector record (evidence: `Base/Service/llmConversationService.py`)
- Qwen LLM → LLM Base: extends (evidence: `Base/Ai/llms/qwenLlm.py`)
- Conversation Records → DB Model Layer: inherits persistence (evidence: `Base/Models/BaseLLMConversationModel.py`)
- Session Records → DB Model Layer: inherits persistence (evidence: `Base/Models/BaseLLMSession.py`)
- DB Model Layer → DB Connections: uses connections (evidence: `Base/Repository/models/moduleDbModel.py`)
- DB Connections → SQL Database: manages connections
- Workflow Runtime → Workflow Nodes: runs nodes
