feat(notes): add ai-powered url analyzer with opt-in toggle - #46
Open
sanjanasingineedi wants to merge 2 commits into
Open
feat(notes): add ai-powered url analyzer with opt-in toggle#46sanjanasingineedi wants to merge 2 commits into
sanjanasingineedi wants to merge 2 commits into
Conversation
- add source_urls column to notes table with migration - add url manager ui to save multiple source urls per note - add ai analyzer toggle (disabled by default, opt-in) - add notes:analyzeUrls ipc handler that fetches all saved urls via electron main process (bypasses cors), extracts readable text, sends to local llm / ollama fallback for analysis - ai returns structured study notes shown in two-panel modal (section headings left, full content right) - add import selected text, import full section, append all options - add IPCAnalyzeUrlsResult, IPCUrlSection, IPCFetchUrlResult types - expose window.api.notes.analyzeUrls via contextBridge preload - graceful degradation when no ai model available Closes ManabBiswas#42
Owner
|
@sanjanasingineedi can you give me demo video or its link here. |
Owner
|
@sanjanasingineedi can you give me any screenshots?
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #42
Adds a Source URL Manager and AI-powered web content analyzer to the Notes Panel, allowing students to save reference URLs and generate structured study notes from them using a local AI model.
Type of Change
Related Issues
Closes #42
Changes Made
Part 1 — Source URL Manager (always visible)
http/httpsURL and click Add to save itsource_urlscolumn) with automatic migration for existing databasesPart 2 — AI Web Analyzer (opt-in toggle, off by default)
AI Stack
node-llama-cpp)generateNoteInsights)phi(as configured in the project)phiortinyllamamay return plain text which is auto-parsed into sections as a fallbackFiles Changed
src/main/db/database.tssource_urlscolumn + automatic migration for existing DBssrc/main/db/queries.tsinsertNoteandupdateNoteto includesource_urlssrc/main/handlers/ipcHandlers.tsnotes:fetchUrlandnotes:analyzeUrlsIPC handlerssrc/preload.tswindow.api.notes.fetchUrlandwindow.api.notes.analyzeUrlsvia contextBridgesrc/shared/ipc.tsIPCUrlSection,IPCFetchUrlResult,IPCAnalyzeUrlsResulttypes; addedsource_urlstoIPCNote,IPCNoteCreateInput,IPCNoteUpdateInputsrc/index.d.tsIPCNotesinterface withfetchUrlandanalyzeUrlssrc/components/NotesPanel.tsxTesting
Limitations (by design)
http/httpsURLs supported(llama3, mistral) produce better structured output than tinyllama
Known Limitation & Proposed Improvement
When the AI returns plain text instead of structured JSON (common with smaller models like
phiortinyllama), the response is auto-parsed into sections by sentence chunking, which may produce fewer sections than expected.Proposed follow-up improvement: Pre-section the content using HTML headings extracted during fetch (already available in the pipeline), then use AI only to summarize each section — this would give reliable sections regardless of model size and is planned as a follow-up.
Checklist