# recklore/entropy architecture

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

- Interactive diagram: https://gitdiagram.com/recklore/entropy
- Repository: https://github.com/recklore/entropy

## Overview

Entropy-Learning is a personalized learning application: student answers become a mastery estimate, a policy selects a skill, and retrieval supplies study content before another assessment. The graph also preserves the documented model-training path and the RAG knowledge-base setup. Source excerpts show the DKT/DQN internals and retrieval implementation; some app wiring and RAG storage details are represented only where the README or source index documents them.

Main entry points: [`app.py`](https://github.com/recklore/entropy/blob/main/app.py) (Learning app), [`src/DQN_agent/train.py`](https://github.com/recklore/entropy/blob/main/src/DQN_agent/train.py) (DQN training), [`src/RAG/lightrag_setup.py`](https://github.com/recklore/entropy/blob/main/src/RAG/lightrag_setup.py) (Knowledge-base setup), [`src/DKTplus/train.py`](https://github.com/recklore/entropy/blob/main/src/DKTplus/train.py) (DKT training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Learning experience"]
  node_app["Learning app<br/>[app.py]"]
  node_assessment["Assessment generation<br/>[retrieve.py]"]
  node_interaction_history[("Interaction history<br/>[app.py]")]
end

subgraph group_knowledge["Knowledge tracing"]
  node_preprocessing["Data preprocessing"]
  node_interaction_data["Processed interactions"]
  node_dkt_dataset["Sequence dataset<br/>[dataset.py]"]
  node_dkt_training["DKT training<br/>[train.py]"]
  node_dkt_model["Knowledge tracer<br/>[model.py]"]
  node_dkt_artifact["Trained DKT model<br/>[DKT_model.pt]"]
end

subgraph group_policy["Skill policy"]
  node_dqn_training["DQN training<br/>[train.py]"]
  node_student_env["Student simulator<br/>[student_env.py]"]
  node_epsilon_policy["Exploration policy<br/>[policy.py]"]
  node_replay_memory["Replay memory<br/>[replay_memory.py]"]
  node_dqn_model["Q-network<br/>[dqn.py]"]
  node_dqn_artifact["Trained DQN model<br/>[DQN_agent.pt]"]
end

subgraph group_content["Learning content"]
  node_rag_setup["Knowledge-base setup<br/>[lightrag_setup.py]"]
  node_sl_content["SL learning content<br/>[sl.md]"]
  node_retrieval["Content retrieval<br/>[retrieve.py]"]
  node_rag_store[("RAG graph and vectors")]
end

node_student(("Student"))
node_neo4j[("Neo4j storage")]
node_faiss[("FAISS vector storage")]
node_groq["Groq LLM"]
node_gemini["Gemini embeddings"]

node_student -->|"uses"| node_app
node_app -->|"requests questions"| node_assessment
node_assessment -->|"generates questions"| node_groq
node_app -->|"records answers"| node_interaction_history
node_interaction_history -->|"provides sequence"| node_dkt_model
node_app -->|"estimates mastery"| node_dkt_model
node_dkt_model -->|"returns mastery"| node_app
node_app -->|"selects skill"| node_dqn_model
node_app -->|"requests content"| node_retrieval
node_retrieval -->|"queries knowledge"| node_rag_store
node_rag_store -->|"returns content"| node_app
node_student -->|"answers assessment"| node_app
node_preprocessing -->|"produces sequences"| node_interaction_data
node_interaction_data -->|"trains on data"| node_dkt_training
node_dkt_training -->|"uses dataset"| node_dkt_dataset
node_dkt_training -->|"trains model"| node_dkt_model
node_dkt_training -->|"saves model"| node_dkt_artifact
node_dkt_artifact -->|"simulates with"| node_dqn_training
node_dqn_training -->|"uses environment"| node_student_env
node_dqn_training -->|"selects actions"| node_epsilon_policy
node_dqn_training -->|"stores transitions"| node_replay_memory
node_dqn_training -->|"trains network"| node_dqn_model
node_dqn_training -->|"saves policy"| node_dqn_artifact
node_sl_content -->|"ingests content"| node_rag_setup
node_rag_setup -->|"builds index"| node_rag_store
node_rag_setup -->|"configures graph"| node_neo4j
node_rag_setup -->|"configures vectors"| node_faiss
node_rag_setup -->|"configures generation"| node_groq
node_rag_setup -->|"configures embeddings"| node_gemini

click node_app "https://github.com/recklore/entropy/blob/main/app.py"
click node_assessment "https://github.com/recklore/entropy/blob/main/src/RAG/retrieve.py"
click node_interaction_history "https://github.com/recklore/entropy/blob/main/app.py"
click node_preprocessing "https://github.com/recklore/entropy/blob/main/src/data_preprocessing.ipynb"
click node_interaction_data "https://github.com/recklore/entropy/blob/main/data/ASSISTments/ASSISTments_processed_data.json"
click node_dkt_dataset "https://github.com/recklore/entropy/blob/main/src/DKTplus/dataset.py"
click node_dkt_training "https://github.com/recklore/entropy/blob/main/src/DKTplus/train.py"
click node_dkt_model "https://github.com/recklore/entropy/blob/main/src/DKTplus/model.py"
click node_dkt_artifact "https://github.com/recklore/entropy/blob/main/models/DKT_model.pt"
click node_dqn_training "https://github.com/recklore/entropy/blob/main/src/DQN_agent/train.py"
click node_student_env "https://github.com/recklore/entropy/blob/main/src/DQN_agent/student_env.py"
click node_epsilon_policy "https://github.com/recklore/entropy/blob/main/src/DQN_agent/policy.py"
click node_replay_memory "https://github.com/recklore/entropy/blob/main/src/DQN_agent/replay_memory.py"
click node_dqn_model "https://github.com/recklore/entropy/blob/main/src/DQN_agent/dqn.py"
click node_dqn_artifact "https://github.com/recklore/entropy/blob/main/models/DQN_agent.pt"
click node_rag_setup "https://github.com/recklore/entropy/blob/main/src/RAG/lightrag_setup.py"
click node_sl_content "https://github.com/recklore/entropy/blob/main/data/SL/sl.md"
click node_retrieval "https://github.com/recklore/entropy/blob/main/src/RAG/retrieve.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_app,node_assessment,node_interaction_history toneBlue
class node_preprocessing,node_interaction_data,node_dkt_dataset,node_dkt_training,node_dkt_model,node_dkt_artifact,node_neo4j,node_faiss toneAmber
class node_dqn_training,node_student_env,node_epsilon_policy,node_replay_memory,node_dqn_model,node_dqn_artifact toneMint
class node_rag_setup,node_sl_content,node_retrieval,node_rag_store toneRose
class node_student,node_groq,node_gemini toneIndigo
```

## Components

### Learning experience

- [Learning app](https://github.com/recklore/entropy/blob/main/app.py): `app.py`
- [Assessment generation](https://github.com/recklore/entropy/blob/main/src/RAG/retrieve.py): `src/RAG/retrieve.py`
- [Interaction history](https://github.com/recklore/entropy/blob/main/app.py): `app.py`

### Knowledge tracing

- [Data preprocessing](https://github.com/recklore/entropy/blob/main/src/data_preprocessing.ipynb): `src/data_preprocessing.ipynb`
- [Processed interactions](https://github.com/recklore/entropy/blob/main/data/ASSISTments/ASSISTments_processed_data.json): `data/ASSISTments/ASSISTments_processed_data.json`
- [Sequence dataset](https://github.com/recklore/entropy/blob/main/src/DKTplus/dataset.py): `src/DKTplus/dataset.py`
- [DKT training](https://github.com/recklore/entropy/blob/main/src/DKTplus/train.py): `src/DKTplus/train.py`
- [Knowledge tracer](https://github.com/recklore/entropy/blob/main/src/DKTplus/model.py): `src/DKTplus/model.py`
- [Trained DKT model](https://github.com/recklore/entropy/blob/main/models/DKT_model.pt): `models/DKT_model.pt`

### Skill policy

- [DQN training](https://github.com/recklore/entropy/blob/main/src/DQN_agent/train.py): `src/DQN_agent/train.py`
- [Student simulator](https://github.com/recklore/entropy/blob/main/src/DQN_agent/student_env.py): `src/DQN_agent/student_env.py`
- [Exploration policy](https://github.com/recklore/entropy/blob/main/src/DQN_agent/policy.py): `src/DQN_agent/policy.py`
- [Replay memory](https://github.com/recklore/entropy/blob/main/src/DQN_agent/replay_memory.py): `src/DQN_agent/replay_memory.py`
- [Q-network](https://github.com/recklore/entropy/blob/main/src/DQN_agent/dqn.py): `src/DQN_agent/dqn.py`
- [Trained DQN model](https://github.com/recklore/entropy/blob/main/models/DQN_agent.pt): `models/DQN_agent.pt`

### Learning content

- [Knowledge-base setup](https://github.com/recklore/entropy/blob/main/src/RAG/lightrag_setup.py): `src/RAG/lightrag_setup.py`
- [SL learning content](https://github.com/recklore/entropy/blob/main/data/SL/sl.md): `data/SL/sl.md`
- [Content retrieval](https://github.com/recklore/entropy/blob/main/src/RAG/retrieve.py): `src/RAG/retrieve.py`
- **RAG graph and vectors**

### Other components

- **Student**
- **Neo4j storage**
- **FAISS vector storage**
- **Groq LLM**
- **Gemini embeddings**

## Connections

- Student → Learning app: uses (evidence: `README.md`)
- Learning app → Assessment generation: requests questions (evidence: `app.py`)
- Assessment generation → Groq LLM: generates questions (evidence: `src/RAG/retrieve.py`)
- Learning app → Interaction history: records answers (evidence: `app.py`)
- Interaction history → Knowledge tracer: provides sequence (evidence: `README.md`)
- Learning app → Knowledge tracer: estimates mastery (evidence: `app.py`)
- Knowledge tracer → Learning app: returns mastery (evidence: `app.py`)
- Learning app → Q-network: selects skill (evidence: `README.md`)
- Learning app → Content retrieval: requests content (evidence: `app.py`)
- Content retrieval → RAG graph and vectors: queries knowledge (evidence: `src/RAG/retrieve.py`)
- RAG graph and vectors → Learning app: returns content (evidence: `README.md`)
- Student → Learning app: answers assessment (evidence: `README.md`)
- Data preprocessing → Processed interactions: produces sequences (evidence: `README.md`)
- Processed interactions → DKT training: trains on data (evidence: `README.md`)
- DKT training → Sequence dataset: uses dataset (evidence: `src/DKTplus/train.py`)
- DKT training → Knowledge tracer: trains model (evidence: `src/DKTplus/train.py`)
- DKT training → Trained DKT model: saves model (evidence: `README.md`)
- Trained DKT model → DQN training: simulates with (evidence: `README.md`)
- DQN training → Student simulator: uses environment (evidence: `src/DQN_agent/train.py`)
- DQN training → Exploration policy: selects actions (evidence: `src/DQN_agent/train.py`)
- DQN training → Replay memory: stores transitions (evidence: `src/DQN_agent/train.py`)
- DQN training → Q-network: trains network (evidence: `src/DQN_agent/train.py`)
- DQN training → Trained DQN model: saves policy (evidence: `README.md`)
- SL learning content → Knowledge-base setup: ingests content (evidence: `README.md`)
- Knowledge-base setup → RAG graph and vectors: builds index (evidence: `src/RAG/lightrag_setup.py`)
- Knowledge-base setup → Neo4j storage: configures graph (evidence: `src/RAG/lightrag_setup.py`)
- Knowledge-base setup → FAISS vector storage: configures vectors (evidence: `src/RAG/lightrag_setup.py`)
- Knowledge-base setup → Groq LLM: configures generation (evidence: `src/RAG/lightrag_setup.py`)
- Knowledge-base setup → Gemini embeddings: configures embeddings (evidence: `src/RAG/lightrag_setup.py`)
