Skip to content

samarthsaxena2004/ai-knowledge-hub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Knowledge Hub (Second Brain)

Project Status Docker Tech Stack

⚠️ Important Notice
It is strongly recommended to run this application locally using your own Google Gemini API key. The publicly deployed version is intended only as a demo and may be rate-limit heavily, become unavailable without notice, or incur unexpected costs when usage spikes. Running it locally gives you full control, unlimited usage (subject to your own key’s quota), and guarantees data privacy.

AI Knowledge Hub is a powerful Retrieval-Augmented Generation (RAG) platform that transforms static PDF documents into an interactive "Second Brain."

Users can upload textbooks, research papers, or legal documents and instantly receive concise summaries, study flashcards, and a semantic chat interface to ask deep questions about the content.

It leverages Google Gemini 2.5 Flash for high-speed, cost-effective analysis and ChromaDB for local vector storage, ensuring a privacy-first, zero-cost deployment architecture.


Features

  • PDF Ingestion Engine: Parses complex PDFs, splits them into semantic chunks, and creates vector embeddings
  • Instant Executive Summary: Generates a 5-point summary immediately after upload
  • Study Flashcards: AI-generated flashcards for active recall
  • RAG Chat: Ask questions and get context-aware answers strictly from the document
  • Bring Your Own Key (BYOK): API key is never stored — privacy-first
  • Fully Dockerized: One-command setup on any OS

Tech Stack

Frontend

  • Next.js 14 • Tailwind CSS • Shadcn/UI • Framer Motion • Lucide Icons

Backend

  • FastAPI • LangChain • ChromaDB (Embedded) • Google Gemini 2.5 Flash

DevOps

  • Docker + Docker Compose • Vercel (Frontend) • Render (Backend)

Getting Started (Local Setup)

Prerequisites

  • Docker Desktop
  • Git

1. Clone the repository

git clone https://github.com/yourusername/ai-knowledge-hub.git
cd ai-knowledge-hub

2. Run with Docker Compose (Recommended)

docker compose up --build

3. Open the app

  • Frontend: http://localhost:3000
  • Backend API docs: http://localhost:8000/docs
  • Mobile on same WiFi: http://<your-local-ip>:3000

Manual Installation (No Docker)

Backend

cd backend
python -m venv venv
source venv/bin/activate    # Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn main:app --reload --port 8000

Frontend

cd frontend
npm install
npm run dev

Deployment Guide

Backend → Render

  1. Create new Web Service → Runtime: Docker → Root Directory: backend
  2. Add environment variable:
GOOGLE_API_KEY=your_key_here
  1. Deploy → copy the backend URL

Frontend → Vercel

  1. Import the repo
  2. Set root directory to /frontend
  3. Add environment variable:
NEXT_PUBLIC_API_URL=https://your-backend.onrender.com
  1. Deploy

Project Structure

ai-knowledge-hub/
├── backend/
│   ├── chroma_db/
│   ├── Dockerfile
│   ├── main.py
│   ├── rag.py
│   └── requirements.txt
├── frontend/
│   ├── Dockerfile
│   ├── src/
│   │   ├── app/
│   │   ├── components/
│   │   └── lib/
│   └── public/
├── docker-compose.yml
├── package.json
└── README.md

Contributing

  1. Fork the repo
  2. Create your feature branch (git checkout -b feature/amazing)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing)
  5. Open a Pull Request

License

About

Engineered a containerized backend service using Docker and FastAPI, focusing on resource efficiency and deployment portability.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors