Mituvinci commited on
Commit
213fb21
Β·
1 Parent(s): 2e8d6bf

Add HF Spaces config, requirements, and architecture image

Browse files
Files changed (3) hide show
  1. README.md +13 -102
  2. images/study_agent_langraph.png +0 -0
  3. requirements.txt +8 -0
README.md CHANGED
@@ -1,3 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
  # Adaptive Study Agent
2
 
3
  A single-agent self-directed learning system built with LangGraph that ingests documents, quizzes itself, evaluates its own answers, and iterates until mastery.
@@ -16,75 +28,7 @@ The connection is conceptual and motivational. There is no shared infrastructure
16
 
17
  The agent operates as a LangGraph state machine with conditional branching. After evaluating each answer, the agent decides whether to re-read weak material, continue to the next question, or finalize the session.
18
 
19
- ```
20
- +-----------------------------+
21
- | START |
22
- | User provides document |
23
- +--------------+--------------+
24
- |
25
- v
26
- +-----------------------------+
27
- | INGEST |
28
- | Parse document |
29
- | Chunk into passages |
30
- | Embed -> ChromaDB |
31
- +--------------+--------------+
32
- |
33
- v
34
- +-----------------------------+
35
- | GENERATE QUESTION |
36
- | Query ChromaDB for a chunk |
37
- | LLM generates question |
38
- | from retrieved passage |
39
- +--------------+--------------+
40
- |
41
- v
42
- +-----------------------------+
43
- | ANSWER |
44
- | Agent retrieves relevant |
45
- | chunks from ChromaDB |
46
- | LLM generates answer |
47
- +--------------+--------------+
48
- |
49
- v
50
- +-----------------------------+
51
- | EVALUATE |
52
- | LLM grades own answer |
53
- | Score: 0.0 - 1.0 |
54
- | Updates session state |
55
- +--------------+--------------+
56
- |
57
- +---------+----------+
58
- | Conditional edge |
59
- | score < threshold? |
60
- +---------+----------+
61
- | |
62
- YES NO
63
- | |
64
- v v
65
- +--------------+ +------------------+
66
- | RE-READ | | enough questions |
67
- | Retrieve + | | answered? |
68
- | re-study | +--------+---------+
69
- | weak chunk | YES | NO
70
- +------+-------+ | |
71
- | v v
72
- | +----------------+
73
- +---------->| NEXT QUESTION|
74
- +-------+--------+
75
- |
76
- (loop back to
77
- GENERATE QUESTION)
78
- |
79
- mastery reached
80
- |
81
- v
82
- +---------------+
83
- | SUMMARIZE |
84
- | Write session|
85
- | report .md |
86
- +---------------+
87
- ```
88
 
89
  ---
90
 
@@ -102,39 +46,6 @@ The agent operates as a LangGraph state machine with conditional branching. Afte
102
 
103
  ---
104
 
105
- ## Project Structure
106
-
107
- ```
108
- adaptive_study_agent/
109
- β”œβ”€β”€ pyproject.toml
110
- β”œβ”€β”€ .env
111
- β”œβ”€β”€ README.md
112
- β”œβ”€β”€ app.py <- Gradio web interface
113
- β”œβ”€β”€ src/
114
- β”‚ β”œβ”€β”€ graph/
115
- β”‚ β”‚ β”œβ”€β”€ state.py <- StudyState TypedDict
116
- β”‚ β”‚ β”œβ”€β”€ nodes.py <- All node functions
117
- β”‚ β”‚ β”œβ”€β”€ edges.py <- Conditional edge logic
118
- β”‚ β”‚ └── build_graph.py <- Assembles the StateGraph
119
- β”‚ β”œβ”€β”€ tools/
120
- β”‚ β”‚ β”œβ”€β”€ ingest.py <- PDF/text chunking + ChromaDB insert
121
- β”‚ β”‚ └── retriever.py <- ChromaDB query wrapper
122
- β”‚ β”œβ”€β”€ prompts/
123
- β”‚ β”‚ β”œβ”€β”€ question_prompt.py <- Generate question from passage
124
- β”‚ β”‚ β”œβ”€β”€ answer_prompt.py <- Answer using retrieved context
125
- β”‚ β”‚ └── evaluate_prompt.py <- Grade answer 0.0-1.0 with reasoning
126
- β”‚ └── main.py <- CLI entry point
127
- β”œβ”€β”€ output/
128
- β”‚ └── session_reports/ <- Markdown report per session
129
- β”œβ”€β”€ data/
130
- β”‚ └── documents/ <- Drop PDFs or .txt files here
131
- └── tests/
132
- β”œβ”€β”€ test_edges.py
133
- └── test_ingest.py
134
- ```
135
-
136
- ---
137
-
138
  ## Setup
139
 
140
  **1. Install dependencies**
 
1
+ ---
2
+ title: Adaptive Study Agent
3
+ emoji: πŸ“š
4
+ colorFrom: blue
5
+ colorTo: purple
6
+ sdk: gradio
7
+ sdk_version: "4.0.0"
8
+ app_file: app.py
9
+ pinned: false
10
+ private: true
11
+ ---
12
+
13
  # Adaptive Study Agent
14
 
15
  A single-agent self-directed learning system built with LangGraph that ingests documents, quizzes itself, evaluates its own answers, and iterates until mastery.
 
28
 
29
  The agent operates as a LangGraph state machine with conditional branching. After evaluating each answer, the agent decides whether to re-read weak material, continue to the next question, or finalize the session.
30
 
31
+ ![Adaptive Study Agent Architecture](images/study_agent_langraph.png)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
  ---
34
 
 
46
 
47
  ---
48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  ## Setup
50
 
51
  **1. Install dependencies**
images/study_agent_langraph.png ADDED
requirements.txt ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ langgraph>=0.2.0
2
+ langchain-anthropic>=0.3.0
3
+ langchain-openai>=0.3.0
4
+ langchain-chroma>=0.2.0
5
+ chromadb>=0.5.0
6
+ pymupdf>=1.24.0
7
+ python-dotenv>=1.0.0
8
+ gradio>=4.0.0