Skip to content
Anurag-5inghPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Knowly

Knowly is a minimal proof-of-concept web app that lets users upload PDFs and chat with their content using AI.

Architecture:

  • Backend: FastAPI (Python) handles file upload, text extraction, chunking, embedding, and vector DB storage (Chroma). It exposes endpoints for uploading PDFs and querying (chat).
  • Frontend: Next.js provides a UI to upload PDFs and chat.
  • Embeddings & LLM: Supports OpenAI embeddings + completion and HuggingFace embeddings fallback. Vector DB: Chroma (local) by default.

This prototype focuses on simplicity and modularity.

Quickstart (development):

  1. Backend: install requirements
cd backend
pip install -r requirements.txt

Create a .env file (see .env.example) with your OpenAI API key.

Run backend:

uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
  1. Frontend:
cd frontend
npm install
npm run dev

Open http://localhost:3000

Notes & next steps:

  • This POC uses local Chroma for vector storage. You can swap in Qdrant by replacing the vector store layer.
  • Security, scale, and production concerns are omitted for brevity.

Windows PowerShell quickstart

If you're on Windows and prefer PowerShell (no WSL), here are PowerShell-friendly steps to run both backend and frontend.

Backend (PowerShell):

cd backend
# install requirements
pip install -r requirements.txt
# create a .env file (copy from example if present) and add your keys
copy .env.example .env  # if .env.example exists
# run the backend server
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

Frontend (PowerShell):

cd frontend
copy .env.local.example .env.local  # if the example exists
npm install
npm run dev

Open http://localhost:3000 in your browser. The frontend expects the backend at http://localhost:8000 by default (set NEXT_PUBLIC_API_URL in .env.local to change).

Notes on networking:

  • If you run both frontend and backend on Windows, use http://localhost:8000 for the API URL.
  • If you run the backend in a remote container or VM, point NEXT_PUBLIC_API_URL to that host/port and ensure CORS is configured in backend/app/main.py if necessary. Frontend notes

  • The frontend reads NEXT_PUBLIC_API_URL from .env.local. Default in the example is http://localhost:8000.
  • If you need CORS or host adjustments, update backend/app/main.py.

Environment variables and obtaining API keys

Required variables (backend .env):

  • OPENAI_API_KEY - your OpenAI API key (required for embeddings and ChatCompletion)
  • CHROMA_DB_DIR - (optional) directory where Chroma will persist indices (default: ./chroma_db)

Optional variables:

  • HUGGINGFACE_API_KEY - (optional) if you want to use HuggingFace hosted APIs or models
  • QDRANT_URL / QDRANT_API_KEY - (optional) if you swap to a remote Qdrant vector DB

How to get the keys:

Security note

Treat API keys as secrets. Do not commit .env to git. .gitignore in the repo already excludes .env and chroma_db.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages