Spaces:
Sleeping
Sleeping
Lumiin0us commited on
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# AutoScholar
|
| 2 |
+
|
| 3 |
+
AutoScholar is an autonomous multi-step research agent/assistant built with LangGraph. Given any research topic, it plans a search strategy, queries the web, reads and extracts content from sources, and formulates a structured, cited report β without any manual intervention.
|
| 4 |
+
It uses a self-reflection loop to evaluate the quality of its output and automatically re-searches if the report doesn't fully answer the original question.
|
| 5 |
+
|
| 6 |
+
---
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
## How It Works
|
| 10 |
+
|
| 11 |
+
When a user submits a research topic, the agent runs through a graph of nodes β each responsible for one stage of the research process:
|
| 12 |
+
1. Planner β The LLM breaks the topic into 3-4 specific sub-questions worth searching for independently.
|
| 13 |
+
2. Search β Each sub-question is sent to the Tavily Search API, which returns clean, LLM-ready results including URLs and content snippets.
|
| 14 |
+
3. Reader β The top URLs are fetched and parsed with BeautifulSoup, extracting the main body text and stripping unwanted data.
|
| 15 |
+
4. Synthesizer β All gathered content is assembled into a prompt and sent to the LLM, which writes a structured report with an introduction, key findings, and conclusion.
|
| 16 |
+
5. Reflection β The LLM evaluates whether the report fully answers the original question. If not, the agent loops back to the Search node with refined queries. The loop is capped at 2 iterations to prevent infinite cycles.
|
| 17 |
+
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
## Agent Graph
|
| 21 |
+
|
| 22 |
+
```
|
| 23 |
+
[Planner] β [Search] β [Reader] β [Synthesizer] β [Reflection]
|
| 24 |
+
β β
|
| 25 |
+
βββββββββββββ re-search if needed ββββββββ
|
| 26 |
+
β
|
| 27 |
+
END
|
| 28 |
+
```
|
| 29 |
+
|
| 30 |
+
---
|
| 31 |
+
|
| 32 |
+
## Project Structure
|
| 33 |
+
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
AutoScholar/
|
| 37 |
+
βββ app/
|
| 38 |
+
β βββ agent/
|
| 39 |
+
β β βββ nodes/
|
| 40 |
+
β β β βββ planner.py
|
| 41 |
+
β β β βββ search.py
|
| 42 |
+
β β β βββ reader.py
|
| 43 |
+
β β β βββ synthesizer.py
|
| 44 |
+
β β β βββ reflection.py
|
| 45 |
+
β β βββ graph.py
|
| 46 |
+
β β βββ state.py
|
| 47 |
+
β βββ streamlit.py
|
| 48 |
+
βββ README.md
|
| 49 |
+
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
---
|
| 53 |
+
|
| 54 |
+
## Workflow
|
| 55 |
+
|
| 56 |
+
User Topic
|
| 57 |
+
β
|
| 58 |
+
Planner (LLM)
|
| 59 |
+
β
|
| 60 |
+
Tavily Web Search Γ N sub-questions
|
| 61 |
+
β
|
| 62 |
+
BeautifulSoup Page Reader
|
| 63 |
+
β
|
| 64 |
+
Synthesizer (LLM)
|
| 65 |
+
β
|
| 66 |
+
Reflection (LLM)
|
| 67 |
+
β
|
| 68 |
+
Structured Report
|
| 69 |
+
|
| 70 |
+
---
|
| 71 |
+
|
| 72 |
+
## AutoScholar UI
|
| 73 |
+
|
| 74 |
+
<img width="388" height="642" alt="Screenshot 2026-03-12 at 11 15 39 AM" src="https://github.com/user-attachments/assets/8dce02eb-03e2-46f5-9ab6-5310cec131f6" />
|
| 75 |
+
|