Skip to content

Repository files navigation

NO-Notes

A full-stack AI-powered knowledge management and personal research assistant. Upload documents, create notes, and have intelligent conversations with your personal knowledge base.


Table of Contents


Overview

NO-Notes helps you organize, search, and intelligently query your personal documents using AI. It combines document processing with semantic search and conversational AI to create a powerful personal knowledge assistant.

Key Capabilities:

  • Upload and process PDF documents with automatic text extraction
  • Chat with an AI assistant that understands your documents
  • Visualize relationships between topics in an interactive knowledge graph
  • Track token usage and manage multiple chat sessions
  • Bring your own API key (OpenAI, Groq, or any compatible provider)

Features

Dashboard

The main dashboard provides an overview of your knowledge base:

  • Statistics showing total notes, uploaded PDFs, chat sessions, and embeddings
  • Token utilization chart displaying daily consumption over the past 30 days
  • Real-time updates every 15 seconds

Document Upload

Upload and manage your PDF documents:

  • Drag-and-drop file upload interface
  • Support for multiple files in a single batch
  • Progress tracking during upload and processing
  • Document status indicators (processing, ready, failed)
  • Search and filter through uploaded documents
  • View file size, page count, and upload date

AI Chat

Have intelligent conversations with your knowledge base:

  • Multi-session chat management with session search
  • Full conversation history with markdown support
  • Code blocks with syntax highlighting and copy functionality
  • Memory context display showing retrieved sources
  • Support for follow-up questions with conversation context

Knowledge Graph

Visualize the topics and relationships in your content:

  • Interactive force-directed graph using D3.js
  • Two-level hierarchy with main topics and subtopics
  • Weighted edges based on term frequency
  • Zoom, pan, and drag functionality
  • Graph statistics including node count and average edge weight

Settings

Manage your account and preferences:

  • Update account password
  • Configure LLM provider API key
  • Delete account with all associated data

Tech Stack

Frontend

Technology Version Purpose
Next.js 16.2.0 React framework
React 19.2.4 UI library
Tailwind CSS 4.0 Styling
D3.js 7.9.0 Data visualization
Zustand 4.4.0 State management
Axios 1.6.4 HTTP client

Backend

Technology Version Purpose
Bun 1.3.8 JavaScript runtime
Express.js 5.2.1 Web framework
Prisma 7.6.0 Database ORM
PostgreSQL - Primary database
pgvector - Vector similarity search

AI

Technology Purpose
LangChain LLM orchestration
LangGraph Agent reasoning
OpenAI API LLM and embeddings
Groq API Alternative LLM provider

Security

Technology Purpose
Helmet.js Security headers
express-rate-limit Rate limiting
bcrypt Password hashing
JWT Authentication tokens

Getting Started

Prerequisites

  • Node.js 20 or higher
  • Bun 1.3 or higher
  • Docker and Docker Compose
  • PostgreSQL with pgvector extension (provided via Docker)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/NO-Notes.git
cd NO-Notes
  1. Install dependencies:
bun install
  1. Set up environment variables:
# Backend
cp backend/.env.example backend/.env

# Database
cp packages/db/.env.example packages/db/.env
  1. Start the database:
docker-compose up -d
  1. Initialize the database:
cd packages/db
bunx prisma generate
bunx prisma db push
  1. Start the development servers:
npm run dev

The application will be available at:


Configuration

Backend Environment Variables

Create a .env file in the backend/ directory:

# Server
PORT=3002
NODE_ENV=development

# Authentication (required)
JWT_SECRET=your-secret-key-minimum-32-characters
API_KEY_ENCRYPTION_SECRET=another-secret-key-32-chars

# File Storage (optional)
UPLOADTHING_TOKEN=your-uploadthing-token

# CORS
FRONTEND_URL=http://localhost:3000

# LLM Configuration (optional - uses user-provided keys by default)
LLM_MODEL=gpt-4o-mini
EMBEDDING_MODEL=text-embedding-3-small

Database Environment Variables

Create a .env file in the packages/db/ directory:

DATABASE_URL="postgresql://NoNotes:NoNotes@localhost:5432/NoNotes"

For production, use a managed PostgreSQL service:

# Supabase
DATABASE_URL="postgresql://postgres:[PASSWORD]@db.[PROJECT].supabase.co:5432/postgres"

# Neon
DATABASE_URL="postgresql://[USER]:[PASSWORD]@[HOST].neon.tech/neondb?sslmode=require"

Frontend Environment Variables

Create a .env.local file in the frontend/ directory:

NEXT_PUBLIC_API_URL=http://localhost:3002

Architecture

Chat Flow

The AI chat uses a LangGraph ReAct agent with retrieval-augmented generation (RAG):

User Message
    |
    v
LangGraph Agent
    |
    +-- Agent Decides --+
    |                   |
    v                   v
Needs Context?      Can Answer Directly
    |                   |
    v                   |
search_memory tool      |
    |                   |
    v                   |
Query Embedding         |
    |                   |
    v                   |
pgvector Search         |
    |                   |
    v                   |
Retrieved Context       |
    |                   |
    +-------------------+
    |
    v
LLM Generation
    |
    v
Response to User

Process Details:

  1. User sends a message with optional conversation history
  2. The agent evaluates whether it needs additional context
  3. If needed, the search_memory tool converts the query to embeddings
  4. Similar documents are retrieved using pgvector similarity search
  5. The LLM generates a response using the context and conversation history
  6. Response is saved for future context and returned to the user

Document Processing Pipeline

PDF Upload
    |
    v
File Validation (50MB max, PDF only)
    |
    v
Cloud Upload (UploadThing) [optional]
    |
    v
PDF Parsing (extract text by page)
    |
    v
Text Cleaning (normalize whitespace)
    |
    v
Chunking (512 tokens, 64 overlap)
    |
    v
Embedding Generation (OpenAI)
    |
    v
Vector Storage (pgvector)
    |
    v
Document Ready

Deployment

Production Build

Build the frontend:

cd frontend
npm run build

Build the backend (optional, Bun runs TypeScript directly):

cd backend
bun run build

Running in Production

  1. Set NODE_ENV=production in backend environment
  2. Configure production database URL
  3. Set strong values for JWT_SECRET and API_KEY_ENCRYPTION_SECRET
  4. Configure FRONTEND_URL for CORS

Start the servers:

# Frontend
cd frontend && npm start

# Backend
cd backend && bun run start

Database Schema

Core Models

User - Stores account information and encrypted API keys

Document - Uploaded PDF metadata with processing status

Embedding - Document chunk vectors (1536 dimensions)

ChatMessage - Conversation history with session support

MemoryEmbedding - Combined memories from all sources

Note - User-created text notes

NoteEdge - Knowledge graph relationships

TokenUsage - API token consumption tracking


By- Pradyumn-cloud

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages