๐ English | ็ฎไฝไธญๆ
AI-powered learning annotation assistant โ Chat with AI to generate study content, annotate any text, get instant AI answers, and review with auto-generated summaries and quizzes.
๐จ๐ณ ไธญๆ็ฎไป๏ผStudyWise ๆฏไธๆฌพ AI ๅญฆไน ๆนๆณจๅฉๆใไธ AI ๅฏน่ฏ็ๆๅญฆไน ๅ ๅฎน๏ผ้ไธญๆๅญๆทปๅ ็ฌ่ฎฐ/้ฎ้ข๏ผAI ๅณๆถ็ปๅไธไธๆ่งฃ็ญ๏ผๅญฆๅฎ่ชๅจ็ๆๆป็ปไธๅคไน ้ข๏ผๅนถๆฏๆๅฏผๅบ็ฆป็บฟ HTMLใๆฐๆฎๅ จ้จๆฌๅฐๅญๅจ๏ผSQLite๏ผ๏ผ่ชๅธฆ API Key ๅณๅฏไฝฟ็จใๅฎๆดไธญๆๆๆกฃ่ง README.zh-CN.mdใ
๐ Ready for your next learning session.
โ ๏ธ Placeholder โ runnpm run dev, take screenshots, and drop them intodocs/screenshots/. Then update the image paths below.
| Main learning interface | Annotations & AI replies | Summary & review quiz |
|---|---|---|
![]() |
![]() |
![]() |
- ๐ฌ AI generates study content โ tell AI what you want to learn, and it produces structured HTML learning material in a single conversation.
- ๐ Select-and-annotate โ highlight any text in the content to add a note or ask a question; notes (green) and questions (yellow) are visually distinct.
- ๐ค Instant AI replies โ AI answers your questions with the surrounding content as context.
- ๐ Two-way scrolling sync โ click a highlight and the annotation panel scrolls to it (and vice versa); scrolling one panel auto-scrolls the other.
- ๐ Multi-turn follow-ups โ keep asking follow-up questions on any AI answer; the thread auto-collapses to the first reply.
- ๐ AI summary โ after learning, AI generates a knowledge summary based on your notes and questions.
- โ Review quizzes โ auto-generated fill-in-the-blank / Q&A review questions with interactive answering.
- ๐ค Export standalone HTML โ export content + annotations + summary + quiz into a single offline-readable HTML file.
- ๐ Multiple AI providers โ switchable providers (Volcengine DeepSeek / OpenAI-compatible / Claude) in one click.
- ๐พ Local-first data โ everything is stored in local SQLite; your API key stays yours.
- Node.js 20+ (CI runs on Node 24; developed and tested on Node 20/24)
- npm (bundled with Node)
- An API key from an OpenAI-compatible AI provider (Volcengine Ark recommended)
git clone https://github.com/free1101/studywise.git
cd studywisenpm installCopy .env.example to .env.local and fill in your API key:
cp .env.example .env.local| Variable | Description | How to get |
|---|---|---|
VOLCENGINE_API_KEY |
Volcengine Ark API key | Volcengine Ark console |
VOLCENGINE_ENDPOINT |
API endpoint (pre-filled) | Leave as-is |
VOLCENGINE_MODEL |
Model name (pre-filled) | Leave as-is |
OPENAI_API_KEY |
OpenAI (or any OpenAI-compatible endpoint) API key | OpenAI platform |
OPENAI_BASE_URL |
OpenAI-compatible endpoint URL (pre-filled) | Leave as-is |
OPENAI_MODEL |
Model name (pre-filled) | Leave as-is |
CLAUDE_API_KEY |
Anthropic Claude API key (ANTHROPIC_API_KEY also works) |
Anthropic console |
CLAUDE_BASE_URL |
Anthropic OpenAI-compatible endpoint (pre-filled) | Leave as-is |
CLAUDE_MODEL |
Claude model name (pre-filled) | Leave as-is |
DEFAULT_AI_PROVIDER |
Default provider: volcengine / openai / claude |
Default volcengine |
Three providers, one click โ switch via
DEFAULT_AI_PROVIDERor the in-app status bar:
volcengineโ Volcengine Ark (DeepSeek, recommended for CN users)openaiโ OpenAI official or any OpenAI-compatible endpoint (DeepSeek official, Qwen, Kimi, GLM, Ollama, etc. โ just pointOPENAI_BASE_URLat it)claudeโ Anthropic Claude via the official OpenAI-compatible endpoint
npm run devOpen http://localhost:3000 and start learning.
| Layer | Choice |
|---|---|
| Framework | Next.js 16 (App Router) |
| Language | TypeScript (strict mode) |
| UI | TailwindCSS + shadcn/ui |
| AI | Volcengine DeepSeek (OpenAI-compatible) |
| Database | SQLite + better-sqlite3 |
| ORM | Drizzle ORM |
| Annotation | @recogito/react-text-annotator |
studywise/
โโโ app/
โ โโโ page.tsx # Main learning UI (three-pane layout)
โ โโโ layout.tsx # Global layout
โ โโโ api/
โ โโโ chat/route.ts # AI conversation (streaming)
โ โโโ contents/route.ts # Save content
โ โโโ annotations/ # Annotation CRUD
โ โ โโโ route.ts
โ โ โโโ [id]/route.ts
โ โโโ ai/
โ โ โโโ reply/route.ts # AI reply to annotation (multi-turn)
โ โ โโโ summarize/route.ts # AI summary + review questions
โ โโโ summaries/route.ts # Persisted summary retrieval
โ โโโ export/route.ts # Export standalone HTML
โโโ components/
โ โโโ ui/ # shadcn/ui base components
โ โโโ chat/ # Chat panel & message
โ โโโ content/ # Content viewer + annotation popup
โ โโโ annotation/ # Annotation list & detail
โ โโโ summary/ # Summary + review quiz
โ โโโ export/ # Export dialog
โ โโโ layout/ # Sidebar, resizable panel, status bar
โโโ hooks/
โ โโโ useAnnotations.ts # Annotation CRUD hook
โ โโโ useChat.ts # AI chat hook
โโโ lib/
โ โโโ db.ts # Drizzle + SQLite connection
โ โโโ schema.ts # DB schema & types
โ โโโ ai/
โ โโโ providers.ts # Unified AI provider interface
โ โโโ volcengine.ts # Volcengine DeepSeek wrapper
โโโ scripts/ # Regression test scripts
โโโ docs/screenshots/ # Place screenshots here
โโโ AGENTS.md # Dev conventions
โโโ LICENSE
โโโ package.json
- Conversation โ Content โ you chat with AI; when AI produces HTML learning material, the front-end extracts and renders it into the central content viewer.
- Annotate โ Reply โ selecting text opens a popup to add a note/question; the annotation is stored in SQLite and AI replies with the surrounding content as context. Follow-up questions reuse the same endpoint with the previous reply for multi-turn coherence.
- Scroll Sync โ highlights and annotation cards share stable IDs; scrolling either panel reports the visible annotation and syncs the other side (with programmatic-scroll guards to prevent loops).
- Summarize & Export โ on completion, AI summarizes your notes/questions into a summary plus review questions (persisted to DB); the export endpoint merges content, annotations, summary, and quiz into one standalone HTML file.
- AGENTS.md โ development conventions, coding standards, and the self-check checklist.
- question.txt โ an audit trail of bug reports, root-cause analysis, and fixes across multiple iterations (evidence of quality and rigor).
- scripts/ โ regression tests:
node scripts/api-test.mjsโ API regression tests across all backend routes (needs the dev server running).node scripts/frontend-logic-test.mjsโ dependency-free front-end logic contract tests (HTML extraction).
How do I switch AI providers?
Set DEFAULT_AI_PROVIDER in .env.local to volcengine, openai, or claude, configure the matching API key, and (optionally) select the provider from the in-app status bar. Any OpenAI-compatible endpoint works with the openai provider.
Where is my data stored?
Locally in a SQLite database file (local.db) at the project root. Nothing leaves your machine except the AI API requests you make.
How do I deploy this?
It's a standard Next.js app โ build with npm run build, then npm run start (or deploy to Vercel). Just make sure the SQLite file path is writable in your deployment environment and that your API key is set.
Contributions are welcome! Please:
- Read AGENTS.md to follow the conventions.
- Fork the repo and create a feature branch.
- Ensure
npm run lintandnpm run buildpass, and run the regression tests in scripts/. - Open a pull request describing the change.
If you find StudyWise useful, please give it a star โญ โ it helps more people discover the project and keeps the motivation going!
This project is licensed under the MIT License.
- Local data only โ all learning content, annotations, and summaries are stored locally in SQLite. We never upload your data to any server.
- Bring your own API key โ StudyWise calls AI providers using your API key. You are responsible for the usage and cost of your own key.
- This is an open-source learning demo project; use at your own discretion.


