The Problem
Researchers and professionals need a secure, local-first way to query their documents with AI assistance. Current solutions either require cloud services (posing privacy risks) or complex self-hosted setups (demanding technical overhead). There's a gap for a lightweight, standalone application that provides retrieval-augmented generation (RAG) without compromising privacy or requiring extensive configuration.
What This Does
KnowNote is a desktop application built with Electron and React that enables local document retrieval and question answering. It processes PDFs, Word documents, PowerPoints, and webpages, embedding their content locally for private, traceable RAG interactions.
Key components:
- Vector Database: SQLite-based storage in
src/main/vectorstore/for document passages and embeddings - Embedding Engine: Local model support in
src/main/embedding/with download handling - Document Processing: File parsing and chunking in
src/main/services/ - User Interface: Three-column layout implemented in
src/renderer/src/App.tsx
The application emphasizes transparency by showing answer sources and avoids cloud dependencies by running all processing locally.
How It Is Wired
Execution begins at src/main/index.ts, the Electron main process entry point. Key control flows:
- Application Startup: - Window creation in
src/main/windows/mainWindow.ts- Database initialization viasrc/main/db/index.ts- IPC channel setup insrc/main/ipc/index.ts
- Document Processing Pipeline: - File parsing handled by loaders in
src/main/services/loaders/- Text chunking insrc/main/services/ChunkingService.ts- Embedding viasrc/main/embedding/
- RAG Retrieval: - Vector search through
src/main/services/retrieval/- Answer generation via model protocols insrc/main/models/protocols/
Critical hubs:
src/main/ipc/(270+ invocations): Centralizes all frontend-backend communicationsrc/main/services/(150+ invocations): Core processing logic
The architecture maintains clear separation between:
- Main process (Electron backend)
- Renderer process (React frontend)
- Persistent storage (SQLite database)
How To Use It
Setup:
git clone https://github.com/moses-y/KnowNote.git
cd KnowNote
npm install
Configuration:
- Required:
src/main/config/settingsManager.tsfor database paths - Optional: Model configuration in
src/main/config/defaults.ts
Running:
npm run dev
Key Operations:
- Import documents via file dialog (handled by
src/main/ipc/dialogHandlers.ts) - Query documents through the UI (processed by
src/main/ipc/knowledgeHandlers.ts) - View results with source tracing in
src/renderer/src/App.tsx
Real-World Use
A researcher could:
- Import academic papers as PDFs
- Query "What are the key findings about X?"
- Receive answers with direct references to specific pages/paragraphs
- Export findings as structured notes
Example document processing flow:
// src/main/services/FileParserService.ts
async function parseFile(filePath) {
const loader = new PdfLoader(filePath);
const text = await loader.load();
return ChunkingService.chunkText(text);
}
Code Health & Issues
- Testing: 41 test files present
- Documentation: 11 doc files including architecture and design decisions
- Configuration: Proper
.gitignoreand.prettierrc.yamlpresent
Measured analysis found no major structural issues. The project maintains good practices with:
- TypeScript typing throughout
- Clear separation of concerns
- Comprehensive test coverage
- Open source licensing (MIT)
The Bottom Line
KnowNote provides a solid local-first RAG solution for document analysis. It's well-architected with clear separation of components and comprehensive documentation. The Electron implementation ensures cross-platform compatibility while maintaining privacy. The project is actively developed with good testing practices. It's particularly suitable for researchers or professionals needing secure document analysis without cloud dependencies.