studylens 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +118 -107
- package/bin/studylens.js +7 -5
- package/package.json +9 -2
- package/portal/dist/assets/{index-C94Qe946.js → index-BdS0V2DX.js} +18 -18
- package/portal/dist/index.html +1 -1
- package/server/index.js +555 -555
package/README.md
CHANGED
|
@@ -1,107 +1,118 @@
|
|
|
1
|
-
# StudyLens
|
|
2
|
-
|
|
3
|
-
AI-powered deep study assistant. Paste notes, upload files, or provide URLs — StudyLens extracts knowledge points, organizes them for browsing, and generates topic pages with AI-driven Q&A.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- **Multi-source ingestion** — text, PDF, DOCX, XLSX, and web URLs
|
|
8
|
-
- **LLM-powered extraction** — automatically identifies knowledge points, tags, and relationships
|
|
9
|
-
- **Knowledge graph** — visual force-directed graph of connected concepts
|
|
10
|
-
- **Topic pages** — AI-generated study pages with version history
|
|
11
|
-
- **Deep analysis** — drill down into any concept with AI-powered sub-topic expansion
|
|
12
|
-
- **Smart Q&A** — ask questions about your knowledge base with context-aware answers
|
|
13
|
-
- **Timeline & category views** — browse knowledge by time or subject
|
|
14
|
-
- **Export** — single-page HTML export with print-optimized CSS
|
|
15
|
-
- **Granularity control** — limit max knowledge points per ingestion for high-level summaries
|
|
16
|
-
- **Multi-provider LLM** — supports OpenAI-compatible APIs, Ollama, and custom endpoints
|
|
17
|
-
|
|
18
|
-
##
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
npm
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
Open `http://localhost:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
##
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
├──
|
|
73
|
-
|
|
74
|
-
├──
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
npm
|
|
102
|
-
npm run
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
1
|
+
# StudyLens
|
|
2
|
+
|
|
3
|
+
AI-powered deep study assistant. Paste notes, upload files, or provide URLs — StudyLens extracts knowledge points, organizes them for browsing, and generates topic pages with AI-driven Q&A.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Multi-source ingestion** — text, PDF, DOCX, XLSX, and web URLs
|
|
8
|
+
- **LLM-powered extraction** — automatically identifies knowledge points, tags, and relationships
|
|
9
|
+
- **Knowledge graph** — visual force-directed graph of connected concepts
|
|
10
|
+
- **Topic pages** — AI-generated study pages with version history
|
|
11
|
+
- **Deep analysis** — drill down into any concept with AI-powered sub-topic expansion
|
|
12
|
+
- **Smart Q&A** — ask questions about your knowledge base with context-aware answers
|
|
13
|
+
- **Timeline & category views** — browse knowledge by time or subject
|
|
14
|
+
- **Export** — single-page HTML export with print-optimized CSS
|
|
15
|
+
- **Granularity control** — limit max knowledge points per ingestion for high-level summaries
|
|
16
|
+
- **Multi-provider LLM** — supports OpenAI-compatible APIs, Ollama, and custom endpoints
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install -g studylens
|
|
22
|
+
studylens
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Open `http://localhost:3000` — on first launch the Settings panel opens automatically to guide you through LLM setup.
|
|
26
|
+
|
|
27
|
+
Data is stored in `./studylens-data/` in the current directory. Set `STUDYLENS_DATA_DIR` to change the location.
|
|
28
|
+
|
|
29
|
+
## Quick Start (Development)
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm run setup # Install dependencies (server + portal)
|
|
33
|
+
npm run dev # Start server (port 3000) + dev portal (port 3001)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Open `http://localhost:3001` for development (hot-reload, recommended).
|
|
37
|
+
|
|
38
|
+
Port 3000 serves the production build — run `npm run build` first to generate `portal/dist/`, otherwise it will only serve the API.
|
|
39
|
+
|
|
40
|
+
## LLM Configuration
|
|
41
|
+
|
|
42
|
+
StudyLens requires an LLM backend. On first launch the Settings panel opens automatically to guide you through setup. Three options:
|
|
43
|
+
|
|
44
|
+
### Option A: Agent Maestro (recommended for GitHub Copilot users)
|
|
45
|
+
|
|
46
|
+
Zero API key needed — uses your existing Copilot subscription via VS Code.
|
|
47
|
+
|
|
48
|
+
1. Install the [Agent Maestro](https://marketplace.visualstudio.com/items?itemName=Joouis.agent-maestro) VS Code extension
|
|
49
|
+
2. It starts a local proxy at `http://localhost:23333`
|
|
50
|
+
3. In StudyLens settings, enable `agent-maestro` and test the connection
|
|
51
|
+
|
|
52
|
+
### Option B: OpenAI-compatible API
|
|
53
|
+
|
|
54
|
+
Works with OpenAI, Azure OpenAI, DeepSeek, or any compatible endpoint.
|
|
55
|
+
|
|
56
|
+
1. In StudyLens settings, enable `openai-compatible`
|
|
57
|
+
2. Set `baseUrl` (default: `https://api.openai.com/v1`), `apiKey`, and `model`
|
|
58
|
+
|
|
59
|
+
### Option C: Ollama (fully local, free)
|
|
60
|
+
|
|
61
|
+
Run models locally with no API key or internet required.
|
|
62
|
+
|
|
63
|
+
1. Install [Ollama](https://ollama.com) and pull a model: `ollama pull llama3.2`
|
|
64
|
+
2. In StudyLens settings, enable `ollama` (default URL: `http://localhost:11434`)
|
|
65
|
+
|
|
66
|
+
Configuration is stored in `wiki/config/llm-config.json`. A template is at `config/llm-config.template.json`.
|
|
67
|
+
|
|
68
|
+
## Project Structure
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
StudyLens/
|
|
72
|
+
├── server/ # Express API server
|
|
73
|
+
│ └── index.js
|
|
74
|
+
├── core/ # Business logic
|
|
75
|
+
│ ├── extractor.js # Knowledge extraction prompts
|
|
76
|
+
│ ├── llm-provider.js # Multi-provider LLM client
|
|
77
|
+
│ └── wiki-storage.js # Markdown-based file storage
|
|
78
|
+
├── portal/ # React frontend (Vite)
|
|
79
|
+
│ └── src/
|
|
80
|
+
│ ├── components/ # UI components
|
|
81
|
+
│ └── lib/ # Shared utilities
|
|
82
|
+
├── config/ # Configuration templates
|
|
83
|
+
├── e2e/ # Playwright E2E tests
|
|
84
|
+
├── tests/ # API integration tests
|
|
85
|
+
├── scripts/ # Utility scripts
|
|
86
|
+
└── docs/ # User & developer guides
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Data Storage
|
|
90
|
+
|
|
91
|
+
All data is stored as Markdown files in the `wiki/` directory (gitignored by default):
|
|
92
|
+
|
|
93
|
+
- `wiki/entries/` — knowledge point Markdown files with YAML frontmatter
|
|
94
|
+
- `wiki/topic-pages/` — generated topic page HTML
|
|
95
|
+
- `wiki/index/` — JSON indexes for fast lookup
|
|
96
|
+
- `wiki/config/` — runtime configuration
|
|
97
|
+
|
|
98
|
+
## Testing
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
npm test # Unit tests (API + portal)
|
|
102
|
+
npm run test:e2e # Playwright E2E tests
|
|
103
|
+
npm run test:api # API tests only
|
|
104
|
+
npm run test:portal # Portal component tests only
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Scripts
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
npm run server # Start API server only (port 3000)
|
|
111
|
+
npm run portal # Start Vite dev server only (port 3001)
|
|
112
|
+
npm run dev # Start both concurrently
|
|
113
|
+
npm run setup # Install all dependencies
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## License
|
|
117
|
+
|
|
118
|
+
MIT
|
package/bin/studylens.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const dataDir = process.env.STUDYLENS_DATA_DIR || path.join(process.cwd(), 'studylens-data');
|
|
4
|
-
process.env.STUDYLENS_WIKI_DIR = process.env.STUDYLENS_WIKI_DIR || dataDir;
|
|
5
|
-
require('../server/index.js');
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const dataDir = process.env.STUDYLENS_DATA_DIR || path.join(process.cwd(), 'studylens-data');
|
|
4
|
+
process.env.STUDYLENS_WIKI_DIR = process.env.STUDYLENS_WIKI_DIR || dataDir;
|
|
5
|
+
const app = require('../server/index.js');
|
|
6
|
+
const PORT = process.env.PORT || 3000;
|
|
7
|
+
app.listen(PORT, () => console.log(`StudyLens server running on http://localhost:${PORT}`));
|
package/package.json
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "studylens",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "AI-powered deep study assistant — turn notes into structured knowledge",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/cdlliuy/studygraph.git"
|
|
9
9
|
},
|
|
10
|
-
"keywords": [
|
|
10
|
+
"keywords": [
|
|
11
|
+
"study",
|
|
12
|
+
"learning",
|
|
13
|
+
"llm",
|
|
14
|
+
"ai",
|
|
15
|
+
"education",
|
|
16
|
+
"knowledge"
|
|
17
|
+
],
|
|
11
18
|
"main": "server/index.js",
|
|
12
19
|
"bin": {
|
|
13
20
|
"studylens": "./bin/studylens.js"
|