A full-stack knowledge vault for saving notes, uploading PDFs, and asking questions over your own content using semantic search and vector embeddings.
live demo link : https://naveen-cs50-cse.github.io/TheArchive-AI.Powered/
The project includes:
- User authentication with signup/login and JWT-protected API routes
- Note capture, PDF ingestion, and document chunk embedding
- Semantic search and retrieval over stored content
- Retrieval-augmented generation (RAG) responses grounded in your archived notes
- Persistent chat memory for context-aware assistant replies
- Backend: Node.js + Express
- Database: Prisma ORM with SQLite (
backend/prisma/schema.prisma) - AI Embeddings: Google Gemini text-embedding-004
- PDF extraction:
unpdf - Frontend: static HTML/CSS/JavaScript (
frontend/index.html,frontend/app.js,frontend/style.css)
backend/
package.json
server.js
db.js
clean.js
middleware/
auth.js # JWT auth middleware
routes/
auth.js # signup/login routes
groq_ai.js # answer generation / AI completion logic
routes.js # main notes/query/pdf API routes
services/
gemini_ai.js # Google Gemini embedding provider
prisma/
schema.prisma # data model definitions
frontend/
index.html # UI and layout
app.js # frontend logic and API calls
style.css # styling
README.md
- Register and login with email/password
- Store text notes into a personal archive
- Upload PDF files, extract text, and create searchable chunks
- Search by natural language query using embeddings
- Receive assistant answers grounded in your archive
- Reset the local archive from the frontend
The Prisma schema defines:
User— users with name, email, passwordNote— raw note and PDF content linked to a userChunk— text chunks with serialized vector embeddingsChat— assistant and user messages for chat history
- Open a terminal in
backend/. - Install packages:
npm install- Generate Prisma client:
npx prisma generate- Apply Prisma migrations (if available):
npx prisma migrate deploy- Create a
.envfile inbackend/.
PORT=4000
JWT_SECRET=your_jwt_secret_here
GEMINI_API_KEY=your_google_gemini_api_keyThe current backend is configured to use SQLite via
backend/prisma/schema.prisma.
From backend/:
npm run devThen open frontend/index.html in a browser, or serve the frontend/ directory with a simple static server.
POST /auth/signup— create an accountPOST /auth/login— authenticate and receive JWTGET /api/notes— list current user notesPOST /api/write— save a new text notePOST /api/query— ask a semantic search questionPOST /api/upload-pdf— upload and process a PDFGET /api/reset— clear/reset stored data
- Register or sign in from the frontend.
- Save notes or upload PDFs.
- Enter a search query and view the AI-assisted answer.
- Use the “Consult Full Ledger” button to list saved notes.
- The backend stores embeddings as JSON strings in the
Chunkmodel. - The search route uses cosine similarity plus simple keyword boosting to retrieve relevant chunks.
- The assistant answer service combines retrieved context with recent chat history.
- Change the embedding provider in
backend/services/gemini_ai.jsto switch models. - Customize prompt generation in
backend/routes/groq_ai.js. - Inspect the local database with
npx prisma studiofrom thebackend/folder.
Built for The Archive project.